/* v65: one owner per safe inset; no inline screen padding or floating exits. */
:root {
  --ff-safe-top: env(safe-area-inset-top, 0px);
  --ff-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ff-gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --ff-gutter-right: max(16px, env(safe-area-inset-right, 0px));
  --ff-nav-height: 52px;
  --ff-preview-height: 0px;
}
body { --ff-page-safe-top: var(--ff-safe-top); --ff-page-nav-top: 0px; }
body.admin-customer-preview {
  --ff-page-safe-top: 0px;
  --ff-page-nav-top: var(--ff-preview-height);
}
/* Supersede the earlier category-spacing account rules at the same specificity. */
body #customer-shell #main .screen[data-screen="account"],
body.ff-from-profile #customer-shell #main .screen:is([data-screen="orders"],[data-screen="wishlist"]) {
  padding-top: 0 !important;
  padding-left: var(--ff-gutter-left) !important;
  padding-right: var(--ff-gutter-right) !important;
  margin-top: 0 !important;
}
body #customer-shell .fa-account .account-page-header,
body.ff-from-profile #customer-shell .profile-return-row {
  position: sticky;
  top: var(--ff-page-nav-top);
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: calc(var(--ff-nav-height) + var(--ff-page-safe-top));
  min-height: calc(var(--ff-nav-height) + var(--ff-page-safe-top));
  padding: var(--ff-page-safe-top) var(--ff-gutter-right) 0 var(--ff-gutter-left);
  margin: 0 calc(-1 * var(--ff-gutter-right)) 0 calc(-1 * var(--ff-gutter-left));
  background: var(--fa-paper);
  border: 0;
  z-index: 30;
}
body #customer-shell .fa-account .account-page-header button,
body.ff-from-profile #customer-shell .profile-return-row button {
  width: 44px; height: 44px; min-height: 44px;
  display: grid; place-items: center;
  margin: 0; padding: 10px; border: 0; border-radius: 8px;
  background: none; box-shadow: none;
}
.fa-account .account-page-header h1 { text-align: center; }
body #customer-shell .fa-account .profile-identity-card { padding-top: 16px !important; }
/* Labels are text, not the icon containers used by the pre-overhaul shortcut. */
.fa-account .profile-shortcuts button > span {
  display: block; width: auto; height: auto; min-height: 0;
  margin: 0; padding: 0; border-radius: 0; background: none !important;
  line-height: 1.3; white-space: nowrap;
}
.fa-account .profile-shortcuts button > svg { flex: 0 0 23px; }

/* A single bounded SVG owns circle/heart geometry; its box cannot shrink. */
body #customer-shell #wishlist-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 32px 20px; margin: 16px 0 0;
  min-height: min(540px, 65dvh); height: auto;
  text-align: center; box-sizing: border-box;
}
body #customer-shell #wishlist-empty[hidden] { display: none !important; }
body #customer-shell #wishlist-empty > .ff-wishlist-art {
  position: relative; flex: 0 0 132px; width: 144px; height: 132px;
  margin: 0 0 24px; padding: 0; background: none; line-height: 0;
}
.ff-wishlist-art svg { display: block; width: 144px; height: 132px; overflow: hidden; }
body #customer-shell #wishlist-empty h2 { margin: 0; line-height: 1.35; font-size: 18px; }
body #customer-shell #wishlist-empty p { margin: 16px 0 0; max-width: 280px; line-height: 1.5; font-size: 14px; }
body #customer-shell #wishlist-empty button { margin: 24px 0 0; min-height: 44px; padding: 12px 16px; line-height: 1.3; }

/* Full-screen account/address dialogs own their own inset, even in preview mode. */
#ff-account-pages, #ff-address-dialog {
  box-sizing: border-box; padding: 0; overflow: hidden;
  height: 100dvh; max-height: 100dvh;
}
#ff-account-pages[open], #ff-address-dialog[open] { display: flex; flex-direction: column; }
#ff-account-pages > header, #ff-address-dialog > header {
  flex: 0 0 auto; box-sizing: border-box;
  height: calc(var(--ff-nav-height) + var(--ff-safe-top));
  min-height: calc(var(--ff-nav-height) + var(--ff-safe-top));
  padding: var(--ff-safe-top) var(--ff-gutter-right) 0 var(--ff-gutter-left);
  margin: 0; gap: 0; border: 0;
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 88px; align-items: center;
}
#ff-address-dialog > header { grid-template-columns: 44px minmax(0, 1fr) 44px; }
#ff-account-pages > header h2, #ff-address-dialog > header h2 {
  margin: 0; min-width: 0; line-height: 1.25; text-align: center;
}
#ff-account-pages > header button, #ff-address-dialog > header button {
  position: static; transform: none; box-sizing: border-box;
  width: 44px; height: 44px; min-height: 44px; padding: 10px; margin: 0;
  display: grid; place-items: center;
}
.fa-nav-actions { display: flex; justify-content: flex-end; align-items: center; }
#ff-account-pages #fa-page-close { font-size: 26px; line-height: 1; }
#fa-page-body, #ff-address-dialog .ff-address-body {
  flex: 1 1 auto; min-height: 0; height: auto;
  overflow: auto; overscroll-behavior: contain;
  padding: 16px var(--ff-gutter-right) calc(24px + var(--ff-safe-bottom)) var(--ff-gutter-left);
}
#fa-page-status {
  position: static; flex: 0 0 auto; width: auto;
  padding: 12px var(--ff-gutter-right) calc(12px + var(--ff-safe-bottom)) var(--ff-gutter-left);
}
#ff-account-pages .fa-caption { margin: 0 0 16px; padding: 0; line-height: 1.5; }
#ff-account-pages .fa-wallet-hero { margin-left: calc(-1 * var(--ff-gutter-left)); margin-right: calc(-1 * var(--ff-gutter-right)); }
/* Support previously added the same top inset to both dialog and header. */
#ff-dialog.ff-support-dialog { padding-top: 0; }
#ff-dialog.ff-support-dialog > header {
  padding-top: calc(8px + var(--ff-safe-top));
  padding-left: var(--ff-gutter-left); padding-right: var(--ff-gutter-right);
}
/* Generic dialog exits live in a reserved row instead of at viewport y=0. */
.app-dialog-exit-bar {
  position: sticky; top: 0; z-index: 20; box-sizing: border-box; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: flex-end;
  min-height: calc(var(--ff-nav-height) + var(--ff-safe-top));
  padding: var(--ff-safe-top) var(--ff-gutter-right) 0 var(--ff-gutter-left);
  background: var(--fa-paper, #fff);
}
.app-dialog-exit-bar > .app-dialog-exit { position: static; margin: 0; min-height: 44px; }
@media (min-width: 600px) {
  #ff-account-pages, #ff-address-dialog { height: 94dvh; max-height: 94dvh; }
}

/* Manu requested: solid white profile, native-sized address choices and icon-only back controls. */
body[data-active-screen=account],body[data-active-screen=account] #customer-shell,body[data-active-screen=account] #main,
body[data-active-screen=account] #customer-shell [data-screen=account],body #customer-shell .fa-account,body #customer-shell .fa-account .account-page-header {
 background:#fff!important;background-image:none!important;color:#202020;--fa-paper:#fff;--fa-bg:#fff;--fa-ink:#202020;--fa-muted:#858589;
}
body[data-active-screen=account] [data-screen=account]::before,
body[data-active-screen=account] [data-screen=account]::after {background:none!important;}
#ff-address-dialog .ab-recipient-choice {display:flex;flex-wrap:wrap;gap:8px 24px;margin:8px 0 16px;}
#ff-address-dialog .ab-recipient-choice label {display:flex!important;align-items:center;flex:0 1 auto;gap:10px;min-height:44px;margin:0!important;padding:0;line-height:1.4;}
#ff-address-dialog .ab-recipient-choice input[type=radio],
#ff-address-dialog input[type=checkbox] {appearance:auto;-webkit-appearance:auto;display:inline-block!important;position:static!important;flex:0 0 20px;width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;max-width:20px;padding:0!important;margin:0!important;box-shadow:none;accent-color:#278517;}
#ff-address-dialog .ab-phone-wrap {display:flex;align-items:flex-end;gap:8px;min-width:0;}
#ff-address-dialog .ab-phone-wrap>label {flex:1;min-width:0;}
#ff-address-dialog .ab-phone-wrap>span {flex:none;padding-bottom:14px;}
#ff-address-dialog .ab-phone-wrap>button {flex:0 0 44px;}
#ff-address-dialog .ff-address-fields label {min-width:0;}
#ff-address-dialog .ff-address-fields input:not([type=radio]):not([type=checkbox]) {box-sizing:border-box;max-width:100%;min-width:0;}
#ff-address-dialog .ff-address-check {display:flex;align-items:center;gap:10px;line-height:1.4;}
:is(button[aria-label^="Back"],button[aria-label^="Go back"],.auth-back,.notification-back-button,.profile-return-row>button,.app-screen-back,#ff-address-back,#fa-page-back) {
 background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;-webkit-tap-highlight-color:transparent;
}
:is(button[aria-label^="Back"],button[aria-label^="Go back"],.auth-back,.notification-back-button,.profile-return-row>button,.app-screen-back,#ff-address-back,#fa-page-back):focus {outline:none!important;}
:is(button[aria-label^="Back"],button[aria-label^="Go back"],.auth-back,.notification-back-button,.profile-return-row>button,.app-screen-back,#ff-address-back,#fa-page-back):focus-visible {outline:none!important;text-decoration:underline;text-underline-offset:5px;filter:drop-shadow(0 0 2px #278517);}
#ff-invoice-fields {display:grid;gap:12px;margin-top:16px;}
#ff-invoice-fields[hidden],#ff-invoice-notice[hidden] {display:none!important;}
#ff-invoice-fields label {display:grid;gap:6px;min-width:0;}
#ff-invoice-fields input,#ff-invoice-fields textarea {box-sizing:border-box;width:100%;min-width:0;}
#ff-invoice-notice {font-size:13px;line-height:1.5;}
