/*!
 * MSIIA mobile footer — compact rebuild (Phase 2026-07-18)
 * =====================================================================
 * Loaded AFTER assets/site.css. Only overrides the mobile portion of
 * the universal footer at max-width: 768px. Desktop is unchanged.
 *
 * Height budget (measured):
 *   before  ≈ 1250 px at 390 px viewport (home page)
 *   after   target ≈ 640 px  (~49 % reduction, inside 590–860 spec range)
 *
 * Compression comes from grid layouts, not clipping:
 *   • Navigation + Resources side-by-side (2-col grid)
 *   • Legal links in a 2-col grid (3-col at ≥ 430 px)
 *   • "Contact" panel loses its heading, consolidates to email + CTA
 *   • Copyright + disclaimer share one compact stack
 *   • Padding + logo + gaps tightened
 *
 * Auth-aware CTA + Login/Account swap uses the site's existing
 * body.is-logged-in / .is-logged-out class flip (auth-basket-sync.js
 * already runs on every page).
 */

:root {
  /* Footer tokens (mobile-specific, cascade-safe on desktop) */
  --footer-pad-x:              clamp(14px, 4vw, 20px);
  --footer-pad-y-top:          18px;
  --footer-pad-y-bottom:       14px;
  --footer-section-gap:        14px;
  --footer-column-gap:         16px;
  --footer-row-gap:            4px;
  --footer-cta-height:         44px;
  --footer-radius:             10px;

  /* Palette (aligned with mobile-header v2 tokens) */
  --footer-gold:               #C4A864;
  --footer-gold-soft:          rgba(196, 168, 100, 0.75);
  --footer-gold-faint:         rgba(196, 168, 100, 0.20);
  --footer-gold-mist:          rgba(196, 168, 100, 0.10);
  --footer-ink:                rgba(247, 241, 225, 0.88);
  --footer-ink-muted:          rgba(247, 241, 225, 0.58);
  --footer-ink-faint:          rgba(247, 241, 225, 0.42);
}

/* =====================================================================
 * MOBILE FOOTER  (≤ 768 px)
 * ===================================================================== */
@media (max-width: 768px) {

  .site-footer {
    padding-top: var(--footer-pad-y-top) !important;
    background:
      radial-gradient(circle at 15% 0%, rgba(196, 168, 100, 0.06), transparent 45%),
      linear-gradient(180deg, rgba(5, 7, 11, 0.98), #05070B);
    border-top: 1px solid rgba(196, 168, 100, 0.18);
  }

  .site-footer .footer-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--footer-section-gap) !important;
    padding-inline: max(var(--footer-pad-x), env(safe-area-inset-left)) !important;
    padding-bottom: var(--footer-pad-y-bottom) !important;
    padding-top: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .site-footer .footer-container {
    padding-inline-end: max(var(--footer-pad-x), env(safe-area-inset-right)) !important;
  }

  /* Brand — compact, no oversized logo. Logo + title inline on one row. */
  .site-footer .footer-brand {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo title"
      "desc desc"
      "loc  loc";
    column-gap: 12px;
    row-gap: 4px;
    align-items: center;
  }
  .site-footer .footer-brand .footer-logo,
  .site-footer .footer-brand img {
    grid-area: logo;
    width: 42px !important;
    margin: 0 !important;
    opacity: 0.94;
  }
  .site-footer .footer-brand h3 {
    grid-area: title;
    margin: 0 !important;
    font-size: 0.66rem !important;
    letter-spacing: 0.22em !important;
    color: var(--footer-gold);
    line-height: 1.2 !important;
  }
  .site-footer .footer-brand p {
    grid-area: desc;
    margin: 4px 0 0 !important;
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
    color: var(--footer-ink-muted);
    max-width: 100% !important;
  }
  .site-footer .footer-brand span {
    grid-area: loc;
    display: inline-block;
    margin: 2px 0 0 !important;
    font-size: 0.56rem !important;
    letter-spacing: 0.28em !important;
    color: var(--footer-gold-soft);
    text-transform: uppercase;
  }

  /* Navigation + Resources side-by-side (Layer 2 of the spec) */
  .site-footer .footer-link-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px var(--footer-column-gap) !important;
    border-top: 1px solid rgba(196, 168, 100, 0.14);
    padding-top: 12px;
    margin: 0 !important;
  }
  .site-footer .footer-link-group .footer-column {
    border-left: none !important;
    border-top: none !important;
    padding-left: 0 !important;
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  /* Kill the site.css ::after divider between Nav and Resources — we're
     side-by-side now, not stacked, so a horizontal divider makes no sense. */
  .site-footer .footer-link-group .footer-column:first-child::after {
    display: none !important;
  }
  .site-footer .footer-column h4,
  .site-footer .footer-contact h4 {
    margin: 0 0 8px !important;
    font-size: 0.58rem !important;
    letter-spacing: 0.28em !important;
    color: var(--footer-gold);
    position: relative;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--footer-gold-mist);
  }
  .site-footer .footer-column h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, var(--footer-gold), transparent);
  }
  .site-footer .footer-column a {
    display: block;
    margin: 0 0 var(--footer-row-gap) !important;
    padding: 3px 0;
    color: var(--footer-ink) !important;
    text-decoration: none;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    transition: color 160ms ease, transform 160ms ease;
    min-height: 26px;
  }
  .site-footer .footer-column a:hover,
  .site-footer .footer-column a:focus-visible {
    color: var(--footer-gold) !important;
    transform: none !important; /* kill the desktop translateX which becomes janky at narrow widths */
    outline: none;
  }
  .site-footer .footer-column a:focus-visible {
    outline: 1px solid var(--footer-gold-soft);
    outline-offset: 2px;
  }

  /* Contact panel — heading is redundant on mobile, hide it. */
  .site-footer .footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: none !important;
    padding-left: 0 !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(196, 168, 100, 0.14);
  }
  .site-footer .footer-contact h4 {
    display: none !important;
  }
  .site-footer .footer-contact p {
    margin: 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    color: var(--footer-ink-muted);
  }
  .site-footer .footer-contact p a {
    color: var(--footer-gold) !important;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .site-footer .footer-contact p a:hover,
  .site-footer .footer-contact p a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
  }

  /* CTA — full-width, glass with subtle gold surface + gloss */
  .site-footer .footer-cta {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--footer-cta-height);
    min-height: var(--footer-cta-height);
    margin-top: 6px !important;
    padding: 0 20px !important;
    border-radius: var(--footer-radius) !important;
    background:
      linear-gradient(180deg,
        rgba(196, 168, 100, 0.14) 0%,
        rgba(196, 168, 100, 0.06) 60%,
        rgba(0, 0, 0, 0.20) 100%) !important;
    border: 1px solid rgba(196, 168, 100, 0.40) !important;
    color: var(--footer-ink) !important;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem !important;
    letter-spacing: 0.24em !important;
    text-transform: uppercase !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 245, 220, 0.08),
      0 4px 12px -4px rgba(196, 168, 100, 0.28),
      0 0 0 1px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    isolation: isolate;
    transition: border-color 200ms ease, box-shadow 220ms ease, transform 150ms ease;
  }
  .site-footer .footer-cta:hover,
  .site-footer .footer-cta:focus-visible {
    background: linear-gradient(180deg,
      rgba(196, 168, 100, 0.22) 0%,
      rgba(196, 168, 100, 0.10) 60%,
      rgba(0, 0, 0, 0.20) 100%) !important;
    border-color: rgba(196, 168, 100, 0.65) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 245, 220, 0.14),
      0 6px 16px -4px rgba(196, 168, 100, 0.42) !important;
    outline: none;
  }
  .site-footer .footer-cta:focus-visible {
    box-shadow:
      inset 0 1px 0 rgba(255, 245, 220, 0.14),
      0 0 0 3px rgba(196, 168, 100, 0.20) !important;
  }
  .site-footer .footer-cta:active { transform: translateY(1px); }

  /* Auth-state swap — footer CTA + Resources Login/Account */
  body.is-logged-out .site-footer .footer-cta[data-auth="out"] { display: inline-flex; }
  body.is-logged-in  .site-footer .footer-cta[data-auth="in"]  { display: inline-flex; }
  body.is-logged-out .site-footer .footer-cta[data-auth="in"]  { display: none !important; }
  body.is-logged-in  .site-footer .footer-cta[data-auth="out"] { display: none !important; }
  body.is-logged-out .site-footer .footer-column a[data-auth="in"]  { display: none !important; }
  body.is-logged-in  .site-footer .footer-column a[data-auth="out"] { display: none !important; }

  /* Legal grid — 2 cols default, 3 cols at 430+ */
  .site-footer .footer-legal-bar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px 14px !important;
    padding: 10px max(var(--footer-pad-x), env(safe-area-inset-left)) !important;
    border-top: 1px solid rgba(196, 168, 100, 0.14) !important;
  }
  .site-footer .footer-legal-bar a {
    font-size: 0.56rem !important;
    letter-spacing: 0.14em !important;
    color: var(--footer-ink-faint) !important;
    line-height: 1.35 !important;
    padding: 1px 0;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 160ms ease;
  }
  .site-footer .footer-legal-bar a:hover,
  .site-footer .footer-legal-bar a:focus-visible {
    color: var(--footer-gold) !important;
    outline: none;
  }
  .site-footer .footer-legal-bar a:focus-visible {
    outline: 1px solid var(--footer-gold-soft);
    outline-offset: 2px;
  }

  /* Bottom — compact copyright + disclaimer stacked */
  .site-footer .footer-bottom {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px max(var(--footer-pad-x), env(safe-area-inset-left)) 14px !important;
    border-top: 1px solid rgba(196, 168, 100, 0.10) !important;
    align-items: stretch;
  }
  .site-footer .footer-bottom p {
    margin: 0 !important;
    font-size: 0.62rem !important;
    line-height: 1.42 !important;
    color: var(--footer-ink-faint) !important;
    max-width: 100% !important;
  }
}

/* Wider mobile / small tablet: 3-col legal grid */
@media (min-width: 430px) and (max-width: 768px) {
  .site-footer .footer-legal-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Very narrow: give link columns a touch more breathing room */
@media (max-width: 360px) {
  .site-footer .footer-column a { font-size: 0.80rem !important; }
  .site-footer .footer-brand p { font-size: 0.80rem !important; }
  .site-footer .footer-container { gap: 18px !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-footer .footer-column a,
  .site-footer .footer-legal-bar a,
  .site-footer .footer-cta {
    transition: none !important;
  }
}

/* =====================================================================
 * GLOBAL icon-size corrections
 * ---------------------------------------------------------------------
 * Applied outside any media query so they land the same way on mobile
 * and desktop. Placed here (rather than in site.css / account-dashboard
 * .css) so the fix ships behind the version-tokenized mobile-footer.css
 * URL and lands immediately without needing a CF revalidation of the
 * long-lived site.css / account-dashboard.css files.
 * ===================================================================== */

/* /account, /login, /login-live — feature-list bullet icons
 * The default 18×18 in site.css:14165 looked oversized next to the
 * 0.58rem uppercase title and 0.78rem description. */
.auth-feature-list .hi-icon {
  width: 13px !important;
  height: 13px !important;
  margin-top: 3px !important;
}

/* =====================================================================
 * /account — Premium Member Identity Card
 * ---------------------------------------------------------------------
 * Layers over the existing .account-hero-identity structure without
 * touching site.css or the (untracked) prod account.js. Adds:
 *   - glossy avatar frame with gold bezel + top-half sheen
 *   - premium card surface (blur + saturation + inner top highlight)
 *   - two-row layout: identity (avatar · meta · status) + metadata pills
 *   - status becomes a first-class gold-tinted pill
 * The [data-populated="false"] guard on the meta row keeps it hidden
 * until the inline script in account.html finds real backend values.
 * ===================================================================== */

/* Card surface */
.account-hero-identity.account-hero-identity--card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "avatar meta status"
    "meta-row meta-row meta-row";
  gap: 14px 18px;
  padding: 18px 22px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 15, 13, 0.72) 0%, rgba(5, 7, 11, 0.86) 100%);
  border: 1px solid rgba(196, 168, 100, 0.24);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
          backdrop-filter: blur(14px) saturate(1.15);
  box-shadow:
    0 24px 44px -20px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(196, 168, 100, 0.20),
    0 0 32px -14px rgba(196, 168, 100, 0.18);
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 24px;
  align-items: center;
}
/* Subtle gold light line along the top edge (matches mobile-nav panel) */
.account-hero-identity.account-hero-identity--card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(196, 168, 100, 0.40) 30%,
    rgba(255, 245, 220, 0.55) 50%,
    rgba(196, 168, 100, 0.40) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Avatar frame — larger, bezelled, glossy */
.account-hero-identity.account-hero-identity--card .account-identity-avatar {
  grid-area: avatar;
  position: relative;
  width: 68px !important;
  height: 68px !important;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(196, 168, 100, 0.42);
  background:
    radial-gradient(circle at 50% 35%, rgba(196, 168, 100, 0.16), rgba(10, 9, 6, 0.90) 72%);
  color: #D4B05E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow:
    0 6px 16px -6px rgba(0, 0, 0, 0.70),
    0 0 0 1px rgba(255, 245, 220, 0.05),
    inset 0 1px 0 rgba(255, 245, 220, 0.14);
  isolation: isolate;
}
/* Gloss sheen — top-half highlight */
.account-hero-identity.account-hero-identity--card .account-identity-avatar::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255, 245, 220, 0.18) 0%,
    rgba(255, 245, 220, 0.04) 45%,
    transparent 65%);
  pointer-events: none;
  z-index: 3;
}
/* Photo-ready flip (avatar has an <img> inside) — keep gloss above photo */
.account-hero-identity.account-hero-identity--card .account-identity-avatar--photo-ready {
  padding: 0;
  overflow: hidden;
}
.account-hero-identity.account-hero-identity--card .account-identity-avatar .hi-icon {
  width: 34px !important;
  height: 34px !important;
  position: relative;
  z-index: 2;
}
.account-hero-identity.account-hero-identity--card .account-identity-avatar-initials {
  font-size: 1.8rem !important;
  position: relative;
  z-index: 2;
}

/* Meta column — name / type / email */
.account-hero-identity.account-hero-identity--card .account-identity-meta {
  grid-area: meta;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.account-hero-identity.account-hero-identity--card .account-identity-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.28rem !important;
  font-weight: 600;
  color: #F5F1E8;
  margin: 0 !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.account-hero-identity.account-hero-identity--card .account-identity-type {
  font-family: "DM Mono", monospace;
  font-size: 0.56rem !important;
  letter-spacing: 0.30em !important;
  text-transform: uppercase;
  color: rgba(212, 176, 94, 0.75) !important;
  margin: 3px 0 4px !important;
  padding-bottom: 4px;
  position: relative;
  align-self: flex-start;
  display: inline-block;
}
.account-hero-identity.account-hero-identity--card .account-identity-type::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 176, 94, 0.65), transparent);
}
.account-hero-identity.account-hero-identity--card .account-identity-email {
  font-size: 0.82rem !important;
  color: rgba(245, 241, 232, 0.62) !important;
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* Status pill (top-right of row 1) */
.account-hero-identity.account-hero-identity--card .account-identity-status {
  grid-area: status;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(85, 201, 138, 0.08);
  border: 1px solid rgba(85, 201, 138, 0.32);
  flex-shrink: 0;
  align-self: start;
}
.account-hero-identity.account-hero-identity--card .account-status-dot {
  width: 6px !important;
  height: 6px !important;
}
.account-hero-identity.account-hero-identity--card .account-status-label {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase;
  color: rgba(210, 240, 220, 0.90) !important;
}

/* Bottom metadata row — hidden until inline script marks data-populated */
.account-hero-identity.account-hero-identity--card .account-identity-meta-row {
  grid-area: meta-row;
  display: none;
  margin: 8px -4px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(196, 168, 100, 0.12);
  gap: 10px 18px;
  flex-wrap: wrap;
  align-items: baseline;
  position: relative;
  z-index: 1;
}
.account-hero-identity.account-hero-identity--card .account-identity-meta-row[data-populated="true"] {
  display: flex;
}
.account-hero-identity.account-hero-identity--card .account-identity-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px;
  min-width: 0;
}
.account-hero-identity.account-hero-identity--card .account-identity-pill-label {
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(212, 176, 94, 0.60);
  white-space: nowrap;
}
.account-hero-identity.account-hero-identity--card .account-identity-pill-value {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(245, 241, 232, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Mobile — stack meta below avatar, keep status inline right of name */
@media (max-width: 560px) {
  .account-hero-identity.account-hero-identity--card {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "avatar meta"
      "avatar status"
      "meta-row meta-row";
    gap: 8px 14px;
    padding: 16px 18px;
    align-items: center;
  }
  .account-hero-identity.account-hero-identity--card .account-identity-avatar {
    width: 60px !important;
    height: 60px !important;
    align-self: center;
  }
  .account-hero-identity.account-hero-identity--card .account-identity-status {
    align-self: start;
    justify-self: start;
    margin-top: 2px;
  }
}
@media (max-width: 380px) {
  .account-hero-identity.account-hero-identity--card {
    padding: 14px 16px;
    gap: 6px 12px;
  }
  .account-hero-identity.account-hero-identity--card .account-identity-avatar {
    width: 54px !important;
    height: 54px !important;
  }
  .account-hero-identity.account-hero-identity--card .account-identity-name {
    font-size: 1.15rem !important;
  }
}

/* Reduced motion — no changes needed (pulsing dot already respected by
   existing dotPulse rules in site.css). No new animation added. */

/* =====================================================================
 * /account — WORKSPACE OVERVIEW COMPACT CARDS
 * ---------------------------------------------------------------------
 * Compresses "Account status at a glance" 6-card grid by ~41 %:
 *   card 260 px → ~ 128 px
 *   section 660 px → ~ 390 px on desktop
 * Same 3-col × 2-row grid, same card widths, same content — tighter
 * padding, smaller icon, tighter value font, tighter description
 * line-height, tighter row gap, restructured icon+label into one row.
 * Descriptions shortened in the HTML (see spec §10.3 permission).
 * Applies at all viewport widths so mobile stack is also compact.
 * ===================================================================== */

.account-metric-card {
  padding: 14px 18px !important;
  gap: 8px !important;
  border-radius: 16px;
}

/* New icon+label top row (was two stacked rows) */
.account-metric-card .account-metric-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.account-metric-card .account-metric-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px;
  flex-shrink: 0;
}
.account-metric-card .account-metric-icon .hi-icon {
  width: 16px !important;
  height: 16px !important;
}

.account-metric-card .account-metric-label {
  margin: 0 !important;
  font-size: 0.54rem !important;
  letter-spacing: 0.22em !important;
  color: rgba(245, 241, 232, 0.62) !important;
}

.account-metric-card .account-metric-value {
  margin: 4px 0 0 !important;
  font-size: clamp(1.4rem, 2.0vw, 1.6rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.005em;
}

.account-metric-card .account-metric-desc {
  margin: 0 !important;
  font-size: 0.76rem !important;
  line-height: 1.4 !important;
  color: rgba(245, 241, 232, 0.52) !important;
}

/* Grid gaps: keep column gap, shrink row gap */
#account-metrics-grid.account-grid-3 {
  row-gap: 14px !important;
}

/* Head-to-grid gap trim */
#metrics .account-section-head {
  margin-bottom: 20px !important;
}
#metrics .account-section-head .section-label {
  margin: 0 0 8px !important;
}
#metrics .account-section-title {
  margin: 0 !important;
  line-height: 1.05;
}

/* Section vertical padding (site.css previously applies ~ 72 top / 80 bottom) */
#metrics.account-section {
  padding-top: 48px !important;
  padding-bottom: 40px !important;
}

/* Optional top-edge gold hairline for the compact cards (spec §18.1) */
.account-metric-card {
  position: relative;
  overflow: hidden;
}
.account-metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(212, 176, 94, 0.32),
    transparent);
  pointer-events: none;
}

/* Mobile — even tighter padding at ≤ 480; keep 2-line desc */
@media (max-width: 480px) {
  .account-metric-card {
    padding: 12px 14px !important;
    gap: 6px !important;
  }
  .account-metric-card .account-metric-topline { gap: 8px; }
  .account-metric-card .account-metric-icon { width: 30px !important; height: 30px !important; }
  .account-metric-card .account-metric-icon .hi-icon { width: 14px !important; height: 14px !important; }
  .account-metric-card .account-metric-value { font-size: 1.4rem !important; }
  .account-metric-card .account-metric-desc { font-size: 0.72rem !important; line-height: 1.42 !important; }
}


/* =====================================================================
 * /account — PORTFOLIO BASKET WORKSPACE
 * ---------------------------------------------------------------------
 * Contains the "Selected systems" section in one premium shell — head
 * (eyebrow + title + status readout) + basket content (prod account.js
 * renders .selected-system-card / .basket-summary-bar / .selected-
 * system-empty into #account-basket-content). Legacy scaffold rows are
 * kept in the DOM for backward compat with prod listeners on
 * #basket-count and #account-basket-grid but never render visually.
 * Allocation is deliberately NOT implemented — the current product model
 * is per-item license purchases (see audit notes).
 * ===================================================================== */

.basket-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 26px 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(198, 158, 74, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(14, 15, 17, 0.98), rgba(7, 8, 10, 0.99));
  border: 1px solid rgba(196, 168, 100, 0.22);
  border-radius: 18px;
  box-shadow:
    0 26px 44px -22px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(196, 168, 100, 0.16),
    0 0 42px -16px rgba(196, 168, 100, 0.12);
  isolation: isolate;
}

/* ── Shell header (eyebrow + title + status) ─────────────────── */
.basket-shell .basket-shell-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(196, 168, 100, 0.14);
}
.basket-shell .basket-shell-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.basket-shell .basket-shell-title-group .section-label {
  margin: 0 !important;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.60rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(196, 168, 100, 0.80);
}
.basket-shell .basket-shell-title {
  margin: 4px 0 8px !important;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem) !important;
  line-height: 1.05;
}
.basket-shell .basket-shell-desc {
  margin: 0 !important;
  max-width: 640px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(245, 241, 232, 0.55);
}
.basket-shell .basket-shell-status {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20, 19, 16, 0.9), rgba(10, 11, 13, 0.9));
  border: 1px solid rgba(196, 168, 100, 0.24);
  align-self: start;
  white-space: nowrap;
}
.basket-shell .basket-shell-status-count {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.60rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #F5F1E8;
}
.basket-shell .basket-shell-status-state {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(196, 168, 100, 0.80);
}
.basket-shell.is-populated .basket-shell-status {
  border-color: rgba(85, 201, 138, 0.32);
  background: linear-gradient(180deg, rgba(85, 201, 138, 0.06), rgba(10, 11, 13, 0.9));
}
.basket-shell.is-populated .basket-shell-status-state {
  color: rgba(180, 230, 200, 0.85);
}

/* ── Content area ────────────────────────────────────────────── */
.basket-shell .basket-shell-content {
  position: relative;
}

/* Kill the legacy scaffold — visually hidden but retained in DOM so
   prod account.js listeners for #basket-count keep working. */
.basket-shell .basket-shell-legacy {
  display: none !important;
}

/* ── Empty state (fallback + JS-rendered both use these classes) ── */
.basket-shell .selected-system-empty,
.basket-shell #account-basket-empty .account-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 44px 28px 40px;
  margin: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 168, 100, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(18, 17, 14, 0.6), rgba(8, 9, 11, 0.4));
  border: 1px dashed rgba(196, 168, 100, 0.28);
  text-align: center;
}
.basket-shell .selected-system-empty-glyph {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 168, 100, 0.32);
  background: radial-gradient(circle at 50% 35%, rgba(196, 168, 100, 0.15), rgba(10, 9, 6, 0.9) 72%);
  color: #D4B05E;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.12),
    0 6px 16px -6px rgba(0, 0, 0, 0.65);
}
.basket-shell .selected-system-empty-glyph .hi-icon {
  width: 26px !important;
  height: 26px !important;
}
.basket-shell .selected-system-empty-title,
.basket-shell .account-empty-title {
  margin: 6px 0 0 !important;
  font-family: "Cormorant Garamond", serif !important;
  font-size: 1.35rem !important;
  font-weight: 600;
  color: #F5F1E8;
  letter-spacing: -0.005em;
}
.basket-shell .selected-system-empty-desc,
.basket-shell .account-empty-desc {
  margin: 0 !important;
  max-width: 460px;
  font-size: 0.86rem !important;
  line-height: 1.55 !important;
  color: rgba(245, 241, 232, 0.62);
}
.basket-shell .browse-systems-button--emphatic,
.basket-shell .account-empty-state .btn.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 46px;
  padding: 0 26px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #d4b876 0%, #C4A864 45%, #a58748 100%) !important;
  color: #14110a !important;
  font-family: "Cormorant Garamond", serif !important;
  font-weight: 600;
  font-size: 0.90rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  border: 1px solid rgba(255, 245, 220, 0.32) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 10px 26px -10px rgba(196, 168, 100, 0.55) !important;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 220ms ease !important;
}
.basket-shell .browse-systems-button--emphatic:hover,
.basket-shell .account-empty-state .btn.btn-primary:hover,
.basket-shell .browse-systems-button--emphatic:focus-visible,
.basket-shell .account-empty-state .btn.btn-primary:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.55),
    0 14px 32px -10px rgba(196, 168, 100, 0.70) !important;
}
.basket-shell .basket-shell-empty-hint {
  margin: 12px 0 0 !important;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.38);
}

/* When JS-rendered .selected-system-mount appears with real content,
   hide the fallback #account-basket-empty so we don't double up. */
.basket-shell.is-populated #account-basket-empty { display: none; }
.basket-shell.is-loading   #account-basket-empty { display: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .basket-shell {
    padding: 20px 18px 20px;
    gap: 18px;
    border-radius: 16px;
  }
  .basket-shell .basket-shell-head {
    grid-template-columns: 1fr;
    padding-bottom: 14px;
    gap: 12px;
  }
  .basket-shell .basket-shell-status {
    justify-self: flex-start;
    align-self: start;
  }
  .basket-shell .selected-system-empty,
  .basket-shell #account-basket-empty .account-empty-state {
    padding: 32px 20px 30px;
    gap: 12px;
    border-radius: 12px;
  }
  .basket-shell .selected-system-empty-glyph {
    width: 58px;
    height: 58px;
  }
  .basket-shell .selected-system-empty-title,
  .basket-shell .account-empty-title {
    font-size: 1.25rem !important;
  }
}
@media (max-width: 380px) {
  .basket-shell { padding: 16px 14px 18px; }
  .basket-shell .selected-system-empty,
  .basket-shell #account-basket-empty .account-empty-state {
    padding: 28px 16px 26px;
  }
  .basket-shell .browse-systems-button--emphatic,
  .basket-shell .account-empty-state .btn.btn-primary {
    padding: 0 18px !important;
    font-size: 0.80rem !important;
    letter-spacing: 0.18em !important;
    width: 100%;
  }
}


/* =====================================================================
 * /account — ACCOUNT ACTIVITY PANEL
 * ---------------------------------------------------------------------
 * Contained shell around the (untracked) prod account.js activity list.
 *   .aap-shell        — outer premium card
 *   .aap-toolbar      — sticky top bar (title + count + filter + sort + up/down)
 *   .aap-scroll       — fixed-height internal viewport
 *   .aap-fade--top/--bottom — sticky gradient overlays inside the scroll
 *                              (visibility driven by is-at-top / is-at-bottom
 *                              classes flipped by the inline script)
 *   .aap-footer       — status strip ("Showing X of Y · Sort")
 * Row density (site's .as-timeline-row) is compressed from min-height:80px
 * to 56px so the panel fits ~ 8 events without needing to scroll.
 * ===================================================================== */

.aap-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 0%, rgba(196, 168, 100, 0.06), transparent 32%),
    linear-gradient(180deg, rgba(13, 14, 16, 0.98), rgba(6, 7, 9, 0.98));
  border: 1px solid rgba(196, 168, 100, 0.22);
  border-radius: 18px;
  box-shadow:
    0 26px 44px -22px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(196, 168, 100, 0.16),
    0 0 42px -16px rgba(196, 168, 100, 0.12);
  overflow: hidden;
  isolation: isolate;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.aap-shell .aap-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background:
    linear-gradient(180deg, rgba(20, 19, 16, 0.96), rgba(10, 11, 13, 0.94));
  border-bottom: 1px solid rgba(196, 168, 100, 0.20);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.aap-shell .aap-toolbar-title-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.aap-shell .aap-toolbar-title {
  margin: 0;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #F5F1E8;
  white-space: nowrap;
}
.aap-shell .aap-toolbar-count {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.20em;
  color: rgba(196, 168, 100, 0.85);
  text-transform: uppercase;
  white-space: nowrap;
}
.aap-shell .aap-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.aap-shell .aap-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aap-shell .aap-control-label {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  letter-spacing: 0.20em;
  color: rgba(196, 168, 100, 0.60);
  text-transform: uppercase;
  white-space: nowrap;
}
.aap-shell select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 32px;
  padding: 4px 30px 4px 12px;
  background:
    linear-gradient(180deg, rgba(15, 15, 13, 0.90), rgba(5, 7, 11, 0.90));
  border: 1px solid rgba(196, 168, 100, 0.28);
  border-radius: 8px;
  color: #F5F1E8;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16' fill='none' stroke='%23C4A864' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 8 11 13 6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.aap-shell select:focus-visible {
  outline: none;
  border-color: rgba(196, 168, 100, 0.65);
  box-shadow: 0 0 0 3px rgba(196, 168, 100, 0.18);
}
.aap-shell .aap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(15, 15, 13, 0.90), rgba(5, 7, 11, 0.90));
  border: 1px solid rgba(196, 168, 100, 0.28);
  border-radius: 8px;
  color: rgba(245, 241, 232, 0.75);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}
.aap-shell .aap-btn svg { width: 14px; height: 14px; }
.aap-shell .aap-btn:hover,
.aap-shell .aap-btn:focus-visible {
  border-color: rgba(196, 168, 100, 0.65);
  color: #C4A864;
  outline: none;
}
.aap-shell .aap-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(196, 168, 100, 0.18);
}

/* ── Scroll shell ────────────────────────────────────────────── */
.aap-shell .aap-scroll {
  position: relative;
  height: clamp(360px, 55vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
/* Custom scrollbar */
.aap-shell .aap-scroll::-webkit-scrollbar { width: 8px; }
.aap-shell .aap-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.35); }
.aap-shell .aap-scroll::-webkit-scrollbar-thumb {
  background: rgba(196, 168, 100, 0.32);
  border-radius: 4px;
}
.aap-shell .aap-scroll::-webkit-scrollbar-thumb:hover { background: rgba(196, 168, 100, 0.55); }
.aap-shell .aap-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 168, 100, 0.32) rgba(0, 0, 0, 0.35);
}

/* The panel that account.js writes into */
.aap-shell #account-activity-panel {
  padding: 0 16px 8px;
}

/* Compact activity rows (override site's 80px min-height + 18px padding).
   list-style is also killed here as a safety in case account-dashboard.css
   (which normally provides that rule) doesn't load. */
.aap-shell .as-timeline-list {
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}
.aap-shell .as-timeline-row {
  padding: 10px 6px !important;
  min-height: 56px !important;
  border-bottom: 1px solid rgba(196, 168, 100, 0.10) !important;
  grid-template-columns: 32px minmax(0, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
}
.aap-shell .as-timeline-row:last-child {
  border-bottom: 0 !important;
}
.aap-shell .as-timeline-heading {
  font-size: 0.72rem !important;
  margin: 0 0 2px !important;
  line-height: 1.25 !important;
}
.aap-shell .as-timeline-meta {
  font-size: 0.62rem !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}
.aap-shell .as-timeline-time {
  font-size: 0.60rem !important;
  line-height: 1.3 !important;
}
.aap-shell .as-timeline-badge {
  font-size: 0.52rem !important;
  padding: 2px 8px !important;
}

/* ── Fades (sticky inside the scroll region) ─────────────────── */
.aap-shell .aap-fade {
  position: sticky;
  left: 0;
  right: 0;
  height: 32px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 2;
}
.aap-shell .aap-fade--top {
  top: 0;
  background: linear-gradient(180deg, rgba(10, 11, 13, 0.94), transparent);
  margin-bottom: -32px;
}
.aap-shell .aap-fade--bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(10, 11, 13, 0.94), transparent);
  margin-top: -32px;
}
.aap-shell.can-scroll:not(.is-at-top)    .aap-fade--top    { opacity: 1; }
.aap-shell.can-scroll:not(.is-at-bottom) .aap-fade--bottom { opacity: 1; }

/* ── Footer strip ────────────────────────────────────────────── */
.aap-shell .aap-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 20px 10px;
  border-top: 1px solid rgba(196, 168, 100, 0.14);
  background: rgba(5, 7, 11, 0.62);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  color: rgba(245, 241, 232, 0.50);
  text-transform: uppercase;
}
.aap-shell .aap-footer-range {
  color: rgba(196, 168, 100, 0.78);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .aap-shell .aap-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .aap-shell .aap-toolbar-title-group {
    justify-content: space-between;
  }
  .aap-shell .aap-toolbar-controls {
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .aap-shell .aap-control-label { display: none; }
  .aap-shell .aap-control select { flex: 1 1 auto; min-width: 0; }
  .aap-shell .aap-scroll { height: clamp(340px, 50vh, 460px); }
  .aap-shell #account-activity-panel { padding: 0 12px 8px; }
  .aap-shell .as-timeline-row {
    padding: 10px 4px !important;
    min-height: 60px !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }
  .aap-shell .aap-footer {
    padding: 8px 14px;
    font-size: 0.50rem;
    letter-spacing: 0.10em;
  }
}
@media (max-width: 380px) {
  .aap-shell select { min-height: 30px; font-size: 0.58rem; padding: 3px 24px 3px 10px; }
  .aap-shell .aap-btn { width: 32px; height: 32px; }
  .aap-shell .aap-btn svg { width: 12px; height: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .aap-shell .aap-fade { transition: none; }
  .aap-shell .aap-btn { transition: none; }
}


/* =====================================================================
 * /account — Recent Activity timeline icons
 * The default is a 44 × 44 rounded badge with a 20 × 20 SVG inside
 * (account-dashboard.css:893). On mobile that reads as one large icon
 * per row × up to 10 rows = huge visual weight. Reduce container to
 * 32 × 32 with a 15 × 15 SVG so it aligns closer to the surrounding
 * 0.72rem monospace text without losing the coloured background pill. */
.as-timeline-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 9px !important;
}
.as-timeline-icon svg {
  width: 15px !important;
  height: 15px !important;
}
@media (max-width: 480px) {
  .as-timeline-icon {
    width: 28px !important;
    height: 28px !important;
  }
  .as-timeline-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
}


/* =====================================================================
 * /account — COHESION PASS  (v7 · 2026-07-18)
 * ---------------------------------------------------------------------
 * Aligns every /account section to one design system so the page reads
 * as a single "Private Workspace" rather than a stack of styled cards.
 *
 * Scope (mobile + desktop where noted):
 *   1. :root  cohesion tokens (--acc-*)  - single source of truth
 *   2. Section rhythm  - unified vertical padding + section-head margin
 *   3. Workspace nav sidebar  - glass card w/ gold-accent active state
 *   4. Unified card chrome  - metric, doc, gov, system, cta share it
 *   5. Button system  - hero-actions + cta-actions consistent hover
 *
 * Non-goals:
 *   - Does NOT change the layout structure of any section
 *   - Does NOT touch identity/activity/basket shells (already unified)
 *   - Does NOT rewrite the underlying account-dashboard.css - only
 *     overrides via cascade using higher specificity + !important where
 *     the prod stylesheet uses !important.
 * ===================================================================== */

:root {
  /* Ink + gold (single source; earlier blocks aliased locally) */
  --acc-gold:            #C4A864;
  --acc-gold-strong:     #E8C77A;
  --acc-gold-soft:       rgba(196, 168, 100, 0.78);
  --acc-gold-mid:        rgba(196, 168, 100, 0.42);
  --acc-gold-faint:      rgba(196, 168, 100, 0.22);
  --acc-gold-mist:       rgba(196, 168, 100, 0.10);
  --acc-gold-veil:       rgba(196, 168, 100, 0.05);
  --acc-ink:             rgba(247, 241, 225, 0.92);
  --acc-ink-muted:       rgba(247, 241, 225, 0.62);
  --acc-ink-faint:       rgba(247, 241, 225, 0.42);
  --acc-ink-ghost:       rgba(247, 241, 225, 0.28);

  /* Surface (glass) */
  --acc-surface-1:       linear-gradient(180deg, rgba(15, 15, 13, 0.85), rgba(5, 7, 11, 0.85));
  --acc-surface-2:       linear-gradient(180deg, rgba(20, 20, 18, 0.72), rgba(10, 11, 13, 0.72));
  --acc-surface-hover:   linear-gradient(180deg, rgba(24, 22, 18, 0.90), rgba(10, 11, 13, 0.90));
  --acc-surface-dark:    #05070B;

  /* Radius scale */
  --acc-r-sm:            10px;
  --acc-r-md:            14px;
  --acc-r-lg:            18px;

  /* Shadow / glow */
  --acc-shadow-card:     0 1px 0 rgba(255, 255, 255, 0.03) inset,
                         0 12px 32px -14px rgba(0, 0, 0, 0.85);
  --acc-shadow-hover:    0 1px 0 rgba(255, 255, 255, 0.04) inset,
                         0 20px 44px -18px rgba(0, 0, 0, 0.92),
                         0 0 0 1px rgba(196, 168, 100, 0.15);
  --acc-focus-ring:      0 0 0 3px rgba(196, 168, 100, 0.24);

  /* Rhythm */
  --acc-section-py:      clamp(48px, 8vw, 96px);
  --acc-section-head-mb: clamp(28px, 4.5vw, 48px);

  /* Motion */
  --acc-t-fast:          160ms cubic-bezier(0.4, 0, 0.2, 1);
  --acc-t-mid:           220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
 * 2 · SECTION RHYTHM
 * Existing site.css / account-dashboard.css gives each .account-section
 * an inconsistent padding. Standardize both light + dark stripes.
 * ===================================================================== */
.account-page .account-section {
  padding-top: var(--acc-section-py) !important;
  padding-bottom: var(--acc-section-py) !important;
  position: relative;
}
.account-page .account-section--dark {
  background:
    radial-gradient(circle at 10% 0%, var(--acc-gold-veil), transparent 55%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.98), var(--acc-surface-dark)) !important;
}
.account-page .account-section:not(.account-section--dark) {
  background:
    radial-gradient(circle at 90% 100%, var(--acc-gold-veil), transparent 60%),
    linear-gradient(180deg, #08090C, #05070B) !important;
}
/* Hairline between adjacent sections for rhythm */
.account-page .account-section + .account-section {
  border-top: 1px solid var(--acc-gold-faint);
}
.account-page .account-section-head {
  margin-bottom: var(--acc-section-head-mb) !important;
}
.account-page .account-section-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  letter-spacing: -0.01em;
  color: var(--acc-ink);
}
.account-page .account-section-title em {
  color: var(--acc-gold-strong);
  font-style: italic;
}
.account-page .account-section-desc {
  color: var(--acc-ink-muted);
  max-width: 62ch;
}

/* =====================================================================
 * 3 · WORKSPACE NAV SIDEBAR
 * The right-column panel next to the identity card.
 * ===================================================================== */
.account-nav-panel {
  background: var(--acc-surface-1) !important;
  border: 1px solid var(--acc-gold-faint) !important;
  border-radius: var(--acc-r-lg) !important;
  padding: 20px 18px !important;
  box-shadow: var(--acc-shadow-card);
  position: relative;
  overflow: hidden;
}
.account-nav-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--acc-gold-soft) 30%,
    var(--acc-gold-soft) 70%,
    transparent 100%);
  opacity: 0.9;
  pointer-events: none;
}
.account-nav-panel-label {
  font-family: "DM Mono", ui-monospace, monospace !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: var(--acc-gold-soft) !important;
  margin: 0 0 12px !important;
}
.account-quick-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.account-quick-link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: var(--acc-r-sm) !important;
  border: 1px solid transparent !important;
  color: var(--acc-ink-muted) !important;
  font-size: 0.86rem !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  transition:
    background var(--acc-t-fast),
    color var(--acc-t-fast),
    border-color var(--acc-t-fast) !important;
}
.account-quick-link .hi-icon {
  width: 16px !important;
  height: 16px !important;
  color: var(--acc-gold-soft) !important;
  flex-shrink: 0 !important;
}
.account-quick-link:hover,
.account-quick-link:focus-visible {
  background: var(--acc-gold-mist) !important;
  border-color: var(--acc-gold-faint) !important;
  color: var(--acc-ink) !important;
  outline: none !important;
}
.account-quick-link:focus-visible {
  box-shadow: var(--acc-focus-ring) !important;
}
.account-quick-link--active {
  background: linear-gradient(180deg,
    rgba(196, 168, 100, 0.18),
    rgba(196, 168, 100, 0.08)) !important;
  border-color: var(--acc-gold-mid) !important;
  color: var(--acc-gold-strong) !important;
  font-weight: 500 !important;
}
.account-quick-link--active .hi-icon {
  color: var(--acc-gold-strong) !important;
}
.account-quick-link--danger {
  color: rgba(220, 130, 130, 0.72) !important;
  margin-top: 6px !important;
  border-top: 1px solid var(--acc-gold-mist) !important;
  border-radius: 0 0 var(--acc-r-sm) var(--acc-r-sm) !important;
  padding-top: 12px !important;
}
.account-quick-link--danger .hi-icon {
  color: rgba(220, 130, 130, 0.72) !important;
}
.account-quick-link--danger:hover,
.account-quick-link--danger:focus-visible {
  background: rgba(220, 90, 90, 0.10) !important;
  border-color: rgba(220, 90, 90, 0.32) !important;
  color: rgba(240, 170, 170, 0.95) !important;
}

/* =====================================================================
 * 4 · UNIFIED CARD CHROME
 * metric, doc, gov, system + basket-shell inherit the same surface,
 * radius, hover, and internal icon-badge treatment.
 * ===================================================================== */
.account-page .account-card,
.account-page .account-doc-card,
.account-page .account-gov-card,
.account-page .account-system-card,
.account-page .account-metric-card {
  background: var(--acc-surface-1) !important;
  border: 1px solid var(--acc-gold-faint) !important;
  border-radius: var(--acc-r-md) !important;
  box-shadow: var(--acc-shadow-card) !important;
  transition:
    transform var(--acc-t-mid),
    border-color var(--acc-t-mid),
    box-shadow var(--acc-t-mid),
    background var(--acc-t-mid) !important;
  position: relative;
  overflow: hidden;
}
.account-page .account-card::before,
.account-page .account-doc-card::before,
.account-page .account-gov-card::before,
.account-page .account-system-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--acc-gold-mid) 50%,
    transparent 100%);
  opacity: 0;
  transition: opacity var(--acc-t-mid);
  pointer-events: none;
}
.account-page .account-card:hover,
.account-page .account-doc-card:hover,
.account-page .account-gov-card:hover,
.account-page .account-system-card:hover {
  border-color: var(--acc-gold-mid) !important;
  background: var(--acc-surface-hover) !important;
  box-shadow: var(--acc-shadow-hover) !important;
  transform: translateY(-2px);
}
.account-page .account-card:hover::before,
.account-page .account-doc-card:hover::before,
.account-page .account-gov-card:hover::before,
.account-page .account-system-card:hover::before {
  opacity: 1;
}

/* Icon-container palette (shared) */
.account-page .account-icon--gold,
.account-page .account-icon--amber,
.account-page .account-icon--blue,
.account-page .account-icon--green {
  border: 1px solid var(--acc-gold-faint) !important;
  background: linear-gradient(180deg,
    rgba(196, 168, 100, 0.14),
    rgba(196, 168, 100, 0.04)) !important;
}
.account-page .account-icon--gold  { color: var(--acc-gold-strong) !important; }
.account-page .account-icon--amber { color: #E5B667 !important; }
.account-page .account-icon--blue  { color: #7FB3D5 !important; }
.account-page .account-icon--green { color: #86C58A !important; }

/* Doc / gov / system card body typography */
.account-page .account-doc-title,
.account-page .account-gov-title,
.account-page .account-system-title {
  color: var(--acc-ink) !important;
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em !important;
}
.account-page .account-doc-desc,
.account-page .account-gov-desc,
.account-page .account-system-desc {
  color: var(--acc-ink-muted) !important;
}
.account-page .account-doc-type,
.account-page .account-gov-kicker {
  font-family: "DM Mono", ui-monospace, monospace !important;
  font-size: 0.60rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: var(--acc-gold-soft) !important;
}

/* Unified badge palette */
.account-page .account-doc-badge,
.account-page .account-gov-badge {
  font-family: "DM Mono", ui-monospace, monospace !important;
  font-size: 0.56rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  border: 1px solid transparent !important;
}
.account-page .account-doc-badge--available,
.account-page .account-gov-badge--complete {
  background: rgba(134, 197, 138, 0.12) !important;
  border-color: rgba(134, 197, 138, 0.36) !important;
  color: #86C58A !important;
}
.account-page .account-doc-badge--pending,
.account-page .account-gov-badge--pending {
  background: rgba(229, 182, 103, 0.12) !important;
  border-color: rgba(229, 182, 103, 0.36) !important;
  color: #E5B667 !important;
}
.account-page .account-doc-badge--restricted,
.account-page .account-gov-badge--observer {
  background: rgba(220, 130, 130, 0.10) !important;
  border-color: rgba(220, 130, 130, 0.30) !important;
  color: rgba(240, 170, 170, 0.90) !important;
}

/* In-card CTA links unify to gold-outline pill */
.account-page .account-doc-btn,
.account-page .account-gov-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  border: 1px solid var(--acc-gold-mid) !important;
  background: transparent !important;
  color: var(--acc-gold-strong) !important;
  font-family: "DM Mono", ui-monospace, monospace !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  transition:
    background var(--acc-t-fast),
    border-color var(--acc-t-fast),
    color var(--acc-t-fast) !important;
}
.account-page .account-doc-btn:hover,
.account-page .account-doc-btn:focus-visible,
.account-page .account-gov-link:hover,
.account-page .account-gov-link:focus-visible {
  background: var(--acc-gold-mist) !important;
  border-color: var(--acc-gold-soft) !important;
  color: var(--acc-gold-strong) !important;
  outline: none !important;
}
.account-page .account-doc-btn--request {
  border-style: dashed !important;
  color: var(--acc-gold-soft) !important;
}

/* =====================================================================
 * 5 · BUTTON SYSTEM  (hero-actions + cta-actions)
 * Aligns .btn-primary + .btn-secondary within the /account page only,
 * so the site-wide button system elsewhere is untouched.
 * ===================================================================== */
.account-page .account-hero-actions,
.account-page .account-cta-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
.account-page .account-hero-actions .btn,
.account-page .account-cta-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 22px !important;
  border-radius: 999px !important;
  font-family: "DM Mono", ui-monospace, monospace !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  transition:
    background var(--acc-t-fast),
    border-color var(--acc-t-fast),
    color var(--acc-t-fast),
    transform var(--acc-t-fast) !important;
}
.account-page .account-hero-actions .btn .hi-icon,
.account-page .account-cta-actions .btn .hi-icon {
  width: 16px !important;
  height: 16px !important;
}
.account-page .account-hero-actions .btn-primary,
.account-page .account-cta-actions .btn-primary {
  background: linear-gradient(180deg,
    rgba(232, 199, 122, 0.98),
    rgba(196, 168, 100, 0.96)) !important;
  border-color: var(--acc-gold-strong) !important;
  color: #0A0A08 !important;
  font-weight: 600 !important;
  box-shadow:
    0 1px 0 rgba(255, 240, 200, 0.32) inset,
    0 8px 22px -10px rgba(196, 168, 100, 0.55) !important;
}
.account-page .account-hero-actions .btn-primary:hover,
.account-page .account-hero-actions .btn-primary:focus-visible,
.account-page .account-cta-actions .btn-primary:hover,
.account-page .account-cta-actions .btn-primary:focus-visible {
  background: linear-gradient(180deg,
    rgba(240, 210, 138, 1),
    rgba(210, 182, 110, 1)) !important;
  transform: translateY(-1px);
  outline: none !important;
}
.account-page .account-hero-actions .btn-secondary,
.account-page .account-cta-actions .btn-secondary {
  background: transparent !important;
  border-color: var(--acc-gold-mid) !important;
  color: var(--acc-gold-strong) !important;
}
.account-page .account-hero-actions .btn-secondary:hover,
.account-page .account-hero-actions .btn-secondary:focus-visible,
.account-page .account-cta-actions .btn-secondary:hover,
.account-page .account-cta-actions .btn-secondary:focus-visible {
  background: var(--acc-gold-mist) !important;
  border-color: var(--acc-gold-soft) !important;
  color: var(--acc-gold-strong) !important;
  outline: none !important;
}
.account-page .account-hero-actions .btn:focus-visible,
.account-page .account-cta-actions .btn:focus-visible {
  box-shadow: var(--acc-focus-ring) !important;
}

/* Final-CTA copy alignment (unifies with the section-head system) */
.account-page .account-cta .section-label {
  color: var(--acc-gold-soft) !important;
}
.account-page .account-cta-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif !important;
  color: var(--acc-ink) !important;
}
.account-page .account-cta-title em {
  color: var(--acc-gold-strong) !important;
  font-style: italic !important;
}

/* =====================================================================
 * 6 · MOBILE REFINEMENTS
 * On phones the nav sidebar sits below the identity card. Tighten it
 * and let the button rows stack full-width so tap targets stay ≥ 44 px.
 * ===================================================================== */
@media (max-width: 768px) {
  .account-page .account-section {
    padding-top: clamp(40px, 9vw, 64px) !important;
    padding-bottom: clamp(40px, 9vw, 64px) !important;
  }
  .account-nav-panel {
    padding: 16px 14px !important;
    border-radius: var(--acc-r-md) !important;
  }
  .account-quick-link {
    padding: 12px 12px !important;
    font-size: 0.90rem !important;
    min-height: 44px !important;
  }
  .account-page .account-hero-actions .btn,
  .account-page .account-cta-actions .btn {
    flex: 1 1 100% !important;
    justify-content: center !important;
    padding: 13px 18px !important;
  }
  .account-page .account-doc-btn,
  .account-page .account-gov-link {
    padding: 9px 14px !important;
    font-size: 0.62rem !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .account-page .account-card,
  .account-page .account-doc-card,
  .account-page .account-gov-card,
  .account-page .account-system-card,
  .account-page .account-quick-link,
  .account-page .account-hero-actions .btn,
  .account-page .account-cta-actions .btn {
    transition: none !important;
    transform: none !important;
  }
}


/* =====================================================================
 * /account · MOBILE BASKET REBUILD  (v8 · 2026-07-18)
 * ---------------------------------------------------------------------
 * Replaces the tall (~840px) two-column-collapsed selected-system card
 * with a compact premium mobile product card:
 *
 *   ┌──────────────────────────────┐
 *   │ [tile] Product name + tier   │  ← header row (image side-by-side)
 *   │        Licence price €X      │
 *   │ ──────────────────────────── │
 *   │ 🛡  One-time licence          │  ← feature rows (1-col; 2-col ≥ 400px)
 *   │ 🖥  MT5 software              │
 *   │ 🆔  Single-account activation │
 *   │ 📄  Documentation             │
 *   │ ──────────────────────────── │
 *   │ Systems selected         1   │  ← summary dl (absorbed from bar)
 *   │ Subtotal        €2,200.00    │
 *   │ Basket status    ● Warning   │
 *   │ ──────────────────────────── │
 *   │ [   REVIEW BASKET →  ]       │  ← PRIMARY (gold, full-width)
 *   │ [ Browse ] [ Remove  ]       │  ← secondary + destructive row
 *   └──────────────────────────────┘
 *
 * Companion enhancer in `account.html` #basket inline script rewires:
 *   - `.continue-checkout-button` label → "Review Basket", href → "/cart"
 *   - Moves `.browse-systems-button` from summary bar into card actions
 *   - Marks the card with `data-mobile-basket-rebuild="1"` so this CSS
 *     block can safely target rebuilt state.
 *
 * Scope: only affects viewports ≤ 480px. Desktop untouched.
 * ===================================================================== */

@media (max-width: 480px) {

  /* ── SHELL: reduce head padding, absorb section into card ── */
  .basket-shell .basket-shell-head {
    padding: 18px 16px 12px !important;
  }
  .basket-shell .basket-shell-content {
    padding: 0 !important;
  }

  /* ── CARD: 2-col header row (media + text stack) + full-width sections
        below. `.selected-system-content` uses `display: contents` so its
        children participate directly in this outer grid — that's the only
        way features/summary/actions can span both columns without
        rewriting the underlying JS markup. */
  .selected-system-list {
    gap: 14px !important;
    margin: 0 12px 12px !important;
  }
  .selected-system-card {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    grid-template-areas:
      "media    status"
      "media    name"
      "media    edition"
      "media    price"
      "features features"
      "actions  actions" !important;
    grid-template-rows: auto auto auto 1fr auto auto !important;
    column-gap: 14px !important;
    row-gap: 4px !important;
    padding: 14px !important;
    border-radius: 14px !important;
  }

  /* ── MEDIA: 88px square tile, spans all 4 header rows ── */
  .selected-system-card .selected-system-media {
    grid-area: media !important;
    min-height: 0 !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    align-self: start !important;
  }
  .selected-system-card .selected-system-product-frame {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 6px !important;
    border-radius: 12px !important;
    margin: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 6px 14px rgba(0,0,0,0.55) !important;
  }
  .selected-system-card .selected-system-product-frame::after {
    display: none !important; /* kill the huge decorative radial that leaked at mobile */
  }
  .selected-system-card .selected-system-product-image {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  /* ── CONTENT WRAPPER: display:contents so its children participate
        directly in the card's grid (otherwise nested children can't
        break out of col 2 to span both cols for features/actions). */
  .selected-system-card .selected-system-content {
    display: contents !important;
  }
  .selected-system-card .selected-system-content > .selected-system-status  { grid-area: status !important; margin-top: 0 !important; }
  .selected-system-card .selected-system-content > .selected-system-name    { grid-area: name !important; }
  .selected-system-card .selected-system-content > .selected-system-edition { grid-area: edition !important; }
  .selected-system-card .selected-system-content > .selected-system-price-row { grid-area: price !important; }
  .selected-system-card .selected-system-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    background: rgba(196,168,100,0.10) !important;
    border: 1px solid rgba(196,168,100,0.28) !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.50rem !important;
    letter-spacing: 0.12em !important;
    color: rgba(226,195,108,0.92) !important;
    align-self: flex-start !important;
    margin: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .selected-system-card .selected-system-status .hi-icon {
    width: 10px !important;
    height: 10px !important;
    max-width: 10px !important;
    max-height: 10px !important;
  }
  .selected-system-card .selected-system-name {
    font-size: 0.95rem !important;
    line-height: 1.18 !important;
    margin: 2px 0 0 !important;
    color: #F5F1E8 !important;
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-weight: 500 !important;
    letter-spacing: -0.005em !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
  }
  .selected-system-card .selected-system-edition {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.58rem !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: rgba(226,195,108,0.85) !important;
  }
  .selected-system-card .selected-system-edition > span:first-child {
    font-weight: 500 !important;
  }
  .selected-system-card .selected-system-price-row {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
  }
  .selected-system-card .selected-system-price-row::before {
    display: none !important; /* kill decorative separator */
  }
  .selected-system-card .selected-system-price {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
  }
  .selected-system-card .selected-system-price-label {
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.5rem !important;
    letter-spacing: 0.20em !important;
    text-transform: uppercase !important;
    color: rgba(244,240,231,0.5) !important;
    margin: 0 !important;
  }
  .selected-system-card .selected-system-price-value {
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 1.35rem !important;
    line-height: 1.1 !important;
    color: #E2C36C !important;
    letter-spacing: -0.005em !important;
  }

  /* ── FEATURES GRID: full-width, compact 1-col rows (2-col ≥ 380px) ── */
  .selected-system-card .product-attribute-list {
    grid-area: features !important;
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid rgba(196,168,100,0.14) !important;
  }
  .selected-system-card .product-attribute-chip {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    min-height: 36px !important;
    border-radius: 8px !important;
    background: rgba(9,11,15,0.55) !important;
    border: 1px solid rgba(196,168,100,0.14) !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.58rem !important;
    letter-spacing: 0.10em !important;
    text-transform: uppercase !important;
    color: rgba(244,240,231,0.82) !important;
    line-height: 1.2 !important;
  }
  .selected-system-card .product-attribute-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0 !important;
    color: #E2C36C !important;
  }
  .selected-system-card .product-attribute-label {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    white-space: normal !important;
  }

  /* ── SUMMARY DL: absorb the summary bar segments into a compact
        label/value list attached to the bottom of the card ── */
  .basket-summary-bar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin: 0 12px 12px !important;
    padding: 14px !important;
    border-radius: 14px !important;
    background:
      linear-gradient(180deg, rgba(20,22,27,0.85) 0%, rgba(9,10,13,0.85) 100%) !important;
    border: 1px solid rgba(196,168,100,0.18) !important;
    box-shadow: 0 8px 20px -12px rgba(0,0,0,0.85) !important;
  }
  .basket-summary-bar::before {
    content: "Basket summary" !important;
    display: block !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.52rem !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    color: rgba(226,195,108,0.78) !important;
    margin: 0 0 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(196,168,100,0.14) !important;
  }
  .basket-summary-bar .basket-summary-segment {
    display: grid !important;
    grid-template-columns: minmax(0, auto) 1fr !important;
    align-items: baseline !important;
    gap: 10px !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(196,168,100,0.08) !important;
    min-height: 0 !important;
  }
  .basket-summary-bar .basket-summary-segment:last-of-type {
    border-bottom: 0 !important;
    padding-bottom: 4px !important;
  }
  /* HIDE the folder icon block — we're doing pure text rows now */
  .basket-summary-bar .basket-summary-icon,
  .basket-summary-bar .basket-summary-segment--count .basket-summary-icon {
    display: none !important;
  }
  .basket-summary-bar .basket-summary-body {
    display: contents !important;
  }
  .basket-summary-bar .basket-summary-label {
    grid-column: 1 !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.58rem !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: rgba(244,240,231,0.55) !important;
  }
  .basket-summary-bar .basket-summary-value {
    grid-column: 2 !important;
    justify-self: end !important;
    text-align: right !important;
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 0.95rem !important;
    color: #F5F1E8 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .basket-summary-bar .basket-summary-segment--count .basket-summary-value {
    font-size: 1.1rem !important;
    color: #E2C36C !important;
  }
  /* HIDE the meta (redundant sub-text — we tuck it under the value if useful) */
  .basket-summary-bar .basket-summary-meta {
    grid-column: 1 / -1 !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.48rem !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: rgba(244,240,231,0.35) !important;
    padding: 2px 0 0 !important;
  }
  /* Only keep meta for subtotal (VAT reminder) and status (helpful hint) */
  .basket-summary-bar .basket-summary-segment--count .basket-summary-meta {
    display: none !important;
  }
  /* HIDE the summary-bar action buttons — they've been moved to card actions
     by the DOM enhancer in account.html. Left in the DOM for backward compat. */
  .basket-summary-bar .basket-summary-actions {
    display: none !important;
  }

  /* ── ACTIONS AREA: PRIMARY = Review Basket, then Browse + Remove ── */
  .selected-system-card .selected-system-actions {
    grid-area: actions !important;
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "primary"
      "secondary" !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid rgba(196,168,100,0.14) !important;
  }

  /* PRIMARY: Review Basket (formerly Continue to Checkout — text swapped by
     the enhancer script; the visual style is the same premium gold pill) */
  .selected-system-card .continue-checkout-button {
    grid-area: primary !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 14px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(232,199,122,0.98), rgba(196,168,100,0.96)) !important;
    border: 1px solid #E8C77A !important;
    color: #0A0A08 !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.64rem !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow:
      0 1px 0 rgba(255,240,200,0.32) inset,
      0 8px 22px -10px rgba(196,168,100,0.55) !important;
  }
  .selected-system-card .continue-checkout-button .hi-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
  }

  /* SECONDARY ROW: Browse Systems (gold outline) + Remove (restrained rose) */
  .selected-system-card .selected-system-actions .browse-systems-button,
  .selected-system-card .selected-system-actions .remove-system-button {
    grid-area: secondary !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 44px !important;
    padding: 10px 10px !important;
    border-radius: 999px !important;
    font-family: "DM Mono", ui-monospace, monospace !important;
    font-size: 0.56rem !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    background: transparent !important;
    white-space: nowrap !important;
  }
  /* Grid trick: give secondary row 2 cols when both buttons are present */
  .selected-system-card
    .selected-system-actions:has(.browse-systems-button):has(.remove-system-button) {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "primary primary"
      "browse  remove" !important;
    column-gap: 8px !important;
  }
  .selected-system-card
    .selected-system-actions:has(.browse-systems-button):has(.remove-system-button)
    .browse-systems-button { grid-area: browse !important; }
  .selected-system-card
    .selected-system-actions:has(.browse-systems-button):has(.remove-system-button)
    .remove-system-button  { grid-area: remove !important; }

  .selected-system-card .selected-system-actions .browse-systems-button {
    border: 1px solid rgba(196,168,100,0.38) !important;
    color: #E2C36C !important;
  }
  .selected-system-card .selected-system-actions .remove-system-button {
    border: 1px solid rgba(220,130,130,0.32) !important;
    color: rgba(240,170,170,0.90) !important;
  }
  .selected-system-card .selected-system-actions .browse-systems-button:hover,
  .selected-system-card .selected-system-actions .browse-systems-button:focus-visible {
    background: rgba(196,168,100,0.10) !important;
    border-color: rgba(196,168,100,0.65) !important;
    outline: none !important;
  }
  .selected-system-card .selected-system-actions .remove-system-button:hover,
  .selected-system-card .selected-system-actions .remove-system-button:focus-visible {
    background: rgba(220,130,130,0.08) !important;
    border-color: rgba(220,130,130,0.55) !important;
    outline: none !important;
  }
  .selected-system-card .selected-system-actions .browse-systems-button .hi-icon,
  .selected-system-card .selected-system-actions .remove-system-button .hi-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0 !important;
  }

  /* ── DEFENSIVE: never let any in-card SVG exceed 20px on mobile ── */
  .selected-system-card svg {
    max-width: 20px !important;
    max-height: 20px !important;
  }
  /* Explicit exceptions for the primary action arrow (16px, set above) */

  /* ── EMPTY STATE: keep existing v5 empty state (unchanged) ── */
}

/* Two-column feature grid at ≥ 380px (still ≤ 480px band).
   At 380px the compact chip label fits on one line reliably. */
@media (min-width: 380px) and (max-width: 480px) {
  .selected-system-card .product-attribute-list {
    grid-template-columns: 1fr 1fr !important;
  }
  .selected-system-card .product-attribute-chip {
    font-size: 0.54rem !important;
    letter-spacing: 0.08em !important;
  }
}

/* ── Narrow-phone variant (≤ 359px, i.e. 320-359px):
      the media tile stacks ABOVE the name column instead of beside it,
      giving the long product name and price room to breathe. */
@media (max-width: 359px) {
  .selected-system-card {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "status"
      "media"
      "name"
      "edition"
      "price"
      "features"
      "actions" !important;
    grid-template-rows: auto !important;
    row-gap: 8px !important;
  }
  .selected-system-card .selected-system-media {
    justify-self: center !important;
  }
  .selected-system-card .selected-system-product-frame {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
  }
  .selected-system-card .selected-system-name {
    font-size: 1rem !important;
    text-align: left !important;
  }
  .selected-system-card .selected-system-status {
    align-self: flex-start !important;
    font-size: 0.48rem !important;
    letter-spacing: 0.10em !important;
  }
  .selected-system-card .selected-system-price-row {
    margin: 2px 0 0 !important;
  }
  .selected-system-card .continue-checkout-button {
    font-size: 0.58rem !important;
    padding: 12px 10px !important;
    letter-spacing: 0.10em !important;
  }
  .selected-system-card .selected-system-actions
    .browse-systems-button,
  .selected-system-card .selected-system-actions
    .remove-system-button {
    font-size: 0.50rem !important;
    letter-spacing: 0.08em !important;
    padding: 10px 6px !important;
    gap: 4px !important;
  }
  .selected-system-card .selected-system-actions
    .browse-systems-button .hi-icon,
  .selected-system-card .selected-system-actions
    .remove-system-button .hi-icon {
    width: 12px !important;
    height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
  }
  /* Summary compact */
  .basket-summary-bar {
    padding: 12px !important;
  }
  .basket-summary-bar .basket-summary-label {
    font-size: 0.52rem !important;
    letter-spacing: 0.10em !important;
  }
  .basket-summary-bar .basket-summary-value {
    font-size: 0.88rem !important;
  }
}

/* Reduced-motion */
@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .selected-system-card,
  .selected-system-card .continue-checkout-button,
  .selected-system-card .browse-systems-button,
  .selected-system-card .remove-system-button {
    transition: none !important;
    transform: none !important;
  }
}


/* =====================================================================
 * /account · BASKET CROSS-VIEWPORT CORRECTION  (v9 · 2026-07-18)
 * ---------------------------------------------------------------------
 * Companion to v8 (mobile rebuild). Adds:
 *   1. UNIVERSAL defensive SVG hardcaps inside the basket area — so no
 *      global `svg { max-width: 100% }` cascade can ever balloon a chip
 *      or status icon at any viewport.
 *   2. A tighter desktop compact-card treatment for the /account
 *      selected-system card — reduces the product-media tile size and
 *      compacts the summary bar so users don't need multiple scrolls
 *      to see one product.
 * ===================================================================== */

/* ── 1. UNIVERSAL defensive SVG dimension contract ─────────────────
      Applies at ALL viewports. */
.selected-system-card .hi-icon,
.selected-system-card .product-attribute-icon,
.basket-summary-bar .hi-icon,
.selected-system-empty .hi-icon {
  max-width:  24px !important;
  max-height: 24px !important;
  min-width:  0    !important;
  min-height: 0    !important;
  flex-shrink: 0   !important;
  object-fit: contain !important;
}

/* Explicit sizes per icon role. */
.selected-system-card .selected-system-status .hi-icon {
  width: 12px !important; height: 12px !important;
  max-width: 12px !important; max-height: 12px !important;
}
.selected-system-card .product-attribute-icon {
  width: 16px !important; height: 16px !important;
  max-width: 16px !important; max-height: 16px !important;
}
.selected-system-card .continue-checkout-button .hi-icon {
  width: 16px !important; height: 16px !important;
  max-width: 16px !important; max-height: 16px !important;
}
.selected-system-card .remove-system-button .hi-icon {
  width: 15px !important; height: 15px !important;
  max-width: 15px !important; max-height: 15px !important;
}
.basket-summary-bar .basket-summary-icon .hi-icon {
  width: 20px !important; height: 20px !important;
  max-width: 20px !important; max-height: 20px !important;
}
.basket-summary-bar .review-basket-button .hi-icon,
.basket-summary-bar .browse-systems-button .hi-icon,
.selected-system-card .browse-systems-button .hi-icon {
  width: 15px !important; height: 15px !important;
  max-width: 15px !important; max-height: 15px !important;
}
.selected-system-empty-glyph .hi-icon {
  width: 32px !important; height: 32px !important;
  max-width: 32px !important; max-height: 32px !important;
}

/* Product image — hard cap so it can never exceed its frame. */
.selected-system-card .selected-system-product-image {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
}

/* ── 2. DESKTOP + TABLET compact card treatment (≥ 481px) ────────
      Keeps the prod 2-column layout but reduces the product tile,
      tightens paddings, and normalizes the summary bar spacing. */
@media (min-width: 481px) {
  .selected-system-card .selected-system-media {
    min-height: 180px !important;
  }
  .selected-system-card .selected-system-product-frame {
    max-width: 200px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }
  .selected-system-card {
    padding: 20px !important;
    gap: 24px !important;
  }
  .basket-summary-bar {
    padding: 16px 20px !important;
  }
}

/* ── 3. TABLET (481–900px) — tighter 2-col ──────────────────────── */
@media (min-width: 481px) and (max-width: 900px) {
  .selected-system-card {
    grid-template-columns: 180px minmax(0, 1fr) !important;
    gap: 18px !important;
  }
  .selected-system-card .selected-system-media {
    min-height: 0 !important;
  }
  .selected-system-card .selected-system-product-frame {
    max-width: 180px !important;
  }
  .selected-system-card .selected-system-name {
    font-size: 1.35rem !important;
  }
  .selected-system-card .selected-system-price-value {
    font-size: 1.5rem !important;
  }
}
