/* =============================================================
   BL-57 account shell: every account page in the storefront's own header
   and footer (includes/portal_header.php, portal_footer.php), with no left
   sidebar or bottom bar. Tokens only.
   ============================================================= */

/* The document scrolls, as on every storefront page, not .portal-main inside
   a box sized to the dashboard's old two-row header; nothing reserves room
   for the sidebar or the phone bar, which are gone. */
body.shop--account .portal-body { display: block; height: auto; min-height: calc(100vh - var(--store-hdr)); }
body.shop--account .portal-main {
  overflow: visible;
  min-height: calc(100vh - var(--store-hdr));
  /* The page's side gutter is the store header's (16px), and its content sits
     in the header's own 78rem column below. The variable stays the inline
     padding, so .pt-foot's negative margin still cancels it exactly. */
  --portal-main-pad: 16px;
  padding: 32px var(--portal-main-pad) 0;
}
body.shop--account .portal-main > :not(.pt-foot):not(.pt-foot-gap) {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(78rem - 32px);
  /* !important: several pages' own top-level headings and dividers carry an
     inline margin shorthand (margin: 0 0 14px), which would otherwise pin
     them to the left edge of a wide screen, outside the content column. */
  margin-inline: auto !important;
}
body.shop--account .portal-main > .pt-foot { margin-block-end: 0; }

/* The account menu: its head (who is signed in) opens the dashboard home,
   and Sign out is a POST form that reads as the menu's last line. */
/* A plain header row with only the divider below (tl-1936): no radius, which
   bent the divider up at both ends into what read as a card inside the menu. */
.pt-menu__head[data-acct-home] { text-decoration: none; color: inherit; border-radius: 0; }
.pt-menu__head[data-acct-home]:hover { background: var(--store-bg2); }
.pt-menu__head[data-acct-home]:focus-visible { outline: 3px solid var(--base); outline-offset: 2px; }
.pt-menu__whois { display: flex; flex-direction: column; min-width: 0; }
.pt-menu__email { font-size: 13px; color: var(--store-muted); overflow-wrap: anywhere; }
.pt-menu__form { margin: 0; }
.pt-menu__form .pt-menu__link { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.pt-menu__badge { margin-inline-start: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--store-accent); color: var(--on-dark); font-size: 12px; font-weight: 700; text-align: center; }

/* Licenses' two actions side by side (Add-ons, then Add a license). */
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Settings' links to the account pages the menu does not name. */
.acct-more { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: -8px 0 20px; }
.acct-more a { color: var(--store-accent); font-weight: 600; text-decoration: none; }
.acct-more a:hover { text-decoration: underline; }
.acct-more a:focus-visible { outline: 3px solid var(--base); outline-offset: 2px; border-radius: 4px; }

/* logout.php's "Sign out?" page, where an old GET sign-out link lands. */
body.shop--account .acct-signout { display: grid; gap: 20px; padding-block: 24px 48px; }
body.shop--account .acct-signout__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
body.shop--account .acct-signout__actions form { margin: 0; }

/* The header wallet chip, its top-up dialog and the dialog's pots live in
   chrome.css (header revamp step 1): the chip shows on every page for
   someone signed in, store pages too. */

/* The Licenses page's key line: the mask, the eye, Copy and the hide note. */
.lic-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-block: 6px; }
.lic-key__text { font-family: var(--store-mono); font-size: .88rem; overflow-wrap: anywhere; }
.lic-key__text.is-full { background: var(--store-accent-soft); padding: .1em .35em; border-radius: 5px; }
.lic-key__eye {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; cursor: pointer;
  border: 1px solid var(--store-line); border-radius: 8px; background: var(--store-card); color: var(--store-muted);
}
.lic-key__eye:hover { color: var(--store-accent); border-color: var(--store-accent); }
.lic-key__eye:focus-visible { outline: 3px solid var(--store-accent); outline-offset: 2px; }
.lic-key__eye[aria-pressed="true"] { color: var(--store-accent); border-color: var(--store-accent); background: var(--store-accent-soft); }
.lic-key__off { display: none; }
.lic-key__eye[aria-pressed="true"] .lic-key__on { display: none; }
.lic-key__eye[aria-pressed="true"] .lic-key__off { display: block; }
.lic-key__hides, .lic-key__logged { font-size: .8rem; color: var(--store-muted); }
.lic-key__logged { margin-block: 12px 0; }
/* Copy and the hide note are [hidden] until a key is shown; .btn-secondary's
   own display would otherwise draw Copy beside a masked key. */
.lic-key [hidden] { display: none; }
/* The account menu bar (includes/account_bar.php) is row 2 of the two menu
   rows, drawn on store pages too, so its styles live with the header in
   chrome.css (.pt-row, .acct-bar). */
/* The header's avatar and account menu on the account shell, at the BL-57
   mockup's values (.avatar, .acct-menu; cto-0417). Scoped to the shell: the
   shop's and home's headers keep their own look (tl Q2). The avatar is the
   mockup's plain 40px circle, accent on accent-soft, 700 .85rem, ringed when
   open; the card is 260px, 14px radius, 6px padding, its items .6em .75em at
   500 .95rem with 18px icons in muted, hover on bg2. */
body.shop--account .pt-chrome--store .pt-acct__btn {
  width: 40px; min-width: 40px; height: 40px; padding: 0; gap: 0;
  border-radius: 50%; border: 1px solid var(--store-line);
  background: var(--store-accent-soft); color: var(--store-accent);
}
body.shop--account .pt-chrome--store .pt-acct__btn:hover { background: var(--store-accent-soft); border-color: var(--store-accent); color: var(--store-accent); }
body.shop--account .pt-chrome--store .pt-acct__btn[aria-expanded="true"] { border-color: var(--store-accent); box-shadow: 0 0 0 3px var(--store-accent-soft); }
body.shop--account .pt-chrome--store .pt-acct__btn .pt-acct__avatar {
  width: 100%; height: 100%; background: none; color: inherit;
  font: 700 .85rem/1 var(--store-body); letter-spacing: .02em;
}
body.shop--account .pt-chrome--store .pt-acct__btn .pt-acct__caret { display: none; }
body.shop--account .pt-chrome--store .pt-acct .pt-menu {
  width: 260px; padding: 6px; border-radius: 14px;
  background: var(--store-card); border: 1px solid var(--store-line);
  box-shadow: var(--store-menu-shadow), var(--store-shadow);
}
body.shop--account .pt-chrome--store .pt-acct .pt-menu__head { padding: 10px 12px 12px; margin-block-end: 6px; border-block-end: 1px solid var(--store-line); }
body.shop--account .pt-chrome--store .pt-acct .pt-acct__avatar--lg { display: none; }
body.shop--account .pt-chrome--store .pt-acct .pt-menu__who { font-size: 1rem; font-weight: 700; color: var(--store-ink); }
body.shop--account .pt-chrome--store .pt-acct .pt-menu__email { font-size: .8rem; color: var(--store-muted); }
body.shop--account .pt-chrome--store .pt-acct .pt-menu__link {
  padding: .6em .75em; border-radius: 9px;
  color: var(--store-ink); font: 500 .95rem var(--store-body);
}
body.shop--account .pt-chrome--store .pt-acct .pt-menu__link:hover { background: var(--store-bg2); color: var(--store-ink); }
body.shop--account .pt-chrome--store .pt-acct .pt-menu__link svg { width: 18px; height: 18px; stroke-width: 1.8; color: var(--store-muted); opacity: 1; }
body.shop--account .pt-chrome--store .pt-acct .pt-menu__sep { margin-block-start: 6px; padding-block-start: 6px; border-block-start: 1px solid var(--store-line); }
/* Phones: the card spans the header row, 16px from each side (the mockup's
   599px rule: .acct static, the menu left/right 16px). */
@media (max-width: 599px) {
  body.shop--account .pt-chrome--store .pt-acct,
  body.shop--account .pt-chrome--store .pt-top__right { position: static; }
  body.shop--account .pt-chrome--store .pt-top__inner { position: relative; }
  body.shop--account .pt-chrome--store .pt-acct .pt-menu { inset-inline: 16px; width: auto; top: calc(100% + 6px); }
}

/* The Wallet page's balance card in the BL-57 mockup's .balcard wash: gold-soft
   to accent-soft at 135deg over the card (tl Q5, look only). On the wash the
   page's grey (--text3, 4.28:1 at the blue end) and teal (4.25:1) fall short
   of 4.5:1, so inside the card they take the mockup's --store-muted (5.44:1)
   and the darker --teal-d; the card's notes colour themselves inline with
   those two variables, so redefining them here is what reaches them. */
.wallet-card--balance {
  --text3: var(--store-muted);
  --teal: var(--teal-d);
  background: linear-gradient(135deg, var(--store-gold-soft), var(--store-accent-soft)), var(--store-card);
  border: 1px solid var(--store-line);
  border-radius: 14px;
}

.lic-key__hides, .lic-key__logged { font-size: .78rem; }
/* Type at the BL-57 mockup's values (cto-0417): an account page's title is
   its .page-h (Fraunces 500, 1.8rem to 2.6rem with the width), and the
   Wallet's balance figure its .bal (Fraunces 500, 2rem to 2.6rem). */
body.shop--account .page-title { font: 500 clamp(1.8rem, 4.6vw, 2.6rem)/1.1 var(--store-display); letter-spacing: -.01em; color: var(--store-ink); }
body.shop--account .wallet-balance__figure { font: 500 clamp(2rem, 6vw, 2.6rem)/1.05 var(--store-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--store-ink); }

/* The phone bottom nav (includes/account_bottomnav.php; cmo-0618, tl (a)):
   Shop · Cart · Account at 768px and below, the same width .shop-bottomnav
   (shop/shop.css) appears at, and the same family: its 66px footprint plus
   the safe area, icon over an 11px label. There the header's cart and avatar
   leave the top bar, and the page keeps the bar's footprint free at its foot,
   so the footer's last line and the toast stay clear of it. */
.acct-bnav { display: none; }
.acct-sheet[open] { display: block; }
@media (max-width: 768px) {
  body.shop--account:has(.acct-bnav) {
    --acct-bnav-h: calc(66px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--acct-bnav-h);
  }
  body.shop--account:has(.acct-bnav) .pt-chrome--store .pt-cart,
  body.shop--account:has(.acct-bnav) .pt-chrome--store .pt-acct { display: none; }
  body.shop--account:has(.acct-bnav) #toast { bottom: calc(var(--acct-bnav-h) + 12px); }
  .acct-bnav {
    display: flex;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 200;
    box-sizing: border-box; min-height: var(--acct-bnav-h);
    padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px));
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
    background: var(--store-card);
    border-block-start: 1px solid var(--store-line);
    box-shadow: var(--shadow-nav-stuck);
  }
  .acct-bnav__item {
    flex: 1 1 0; min-width: 0; min-height: 44px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 4px 2px; border: 0; background: none; cursor: pointer;
    color: var(--store-ink); text-decoration: none;
    font: 500 11px/1.2 var(--store-body);
  }
  .acct-bnav__item:hover, .acct-bnav__item[aria-expanded="true"] { color: var(--store-accent); }
  .acct-bnav__item:focus-visible { outline: 3px solid var(--store-accent); outline-offset: -3px; border-radius: 10px; }
  .acct-bnav__icon { position: relative; display: inline-flex; }
  .acct-bnav__qty {
    position: absolute; top: -6px; inset-inline-end: -10px; min-width: 18px; padding: 0 4px; box-sizing: border-box;
    border-radius: 999px; background: var(--store-gold-l); color: var(--store-gold-ink);
    font: 700 11px/18px var(--store-body); text-align: center;
  }
  /* The account menu as a sheet from the bottom: the header's own menu,
     cloned by account.js, in the mockup's menu values. */
  .acct-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .acct-sheet__body { padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .acct-sheet .pt-menu__head { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px 12px; margin-block-end: 6px; border-block-end: 1px solid var(--store-line); text-decoration: none; color: inherit; }
  .acct-sheet .pt-acct__avatar--lg { display: none; }
  .acct-sheet .pt-menu__who { font-size: 1rem; font-weight: 700; color: var(--store-ink); }
  .acct-sheet .pt-menu__email { font-size: .8rem; color: var(--store-muted); }
  .acct-sheet .pt-menu__list { list-style: none; margin: 0; padding: 0; }
  .acct-sheet .pt-menu__link { display: flex; align-items: center; gap: 10px; min-height: 44px; box-sizing: border-box; padding: .6em .75em; border-radius: 9px; color: var(--store-ink); font: 500 .95rem var(--store-body); text-decoration: none; }
  .acct-sheet .pt-menu__link:hover { background: var(--store-bg2); }
  .acct-sheet .pt-menu__link svg { width: 18px; height: 18px; stroke-width: 1.8; color: var(--store-muted); flex: none; }
  .acct-sheet .pt-menu__sep { margin-block-start: 6px; padding-block-start: 6px; border-block-start: 1px solid var(--store-line); }

  /* The full balance on top at every phone width (the owner's ask): with the
     cart and avatar gone from the bar there is room, so the chip keeps its
     amount (no icon-only form) and its icon from 360px. */
  body.shop--account:has(.acct-bnav) .pt-wchip { width: auto; padding-inline: 10px 12px; gap: 6px; justify-content: flex-start; }
  body.shop--account:has(.acct-bnav) .pt-wchip svg { display: block; }
  body.shop--account:has(.acct-bnav) .pt-wchip__amt { position: static; width: auto; height: auto; overflow: visible; clip-path: none; min-width: 0; }
}
@media (max-width: 359.98px) {
  body.shop--account:has(.acct-bnav) .pt-wchip { padding-inline: 10px; gap: 0; }
  body.shop--account:has(.acct-bnav) .pt-wchip svg { display: none; }
}

