/* ==========================================================================
   Autonomyware — shared styles for account / marketing sub-pages
   (pricing, login, signup, dashboard, settings, billing, legal, cookies)
   Matches the homepage mockup design language: off-white "paper" base,
   single teal accent, Inter type. Full light + dark theming via data-theme
   on <html> (see theme.js) and prefers-color-scheme for "system".
   ========================================================================== */

:root {
  /* ---- Light (default / off-white) ---- */
  --ink: #16181C;
  --ink-soft: #454A52;
  --muted: #7C818A;

  --paper: #E8EAE0;        /* page background */
  --paper-deep: #DFE2D5;   /* alternating band */
  --raised: #F2F4EC;       /* cards / panels */
  --raised-2: #FBFAF6;     /* inputs / elevated surfaces */
  --raised-hover: #EDEFE6;

  --line: rgba(22,24,28,0.12);
  --line-soft: rgba(22,24,28,0.07);
  --line-strong: rgba(22,24,28,0.20);

  --teal: #1A7A9A;
  --teal-deep: #0F5468;
  --teal-ink: #0C3B49;
  --teal-bright: #29A0C4;
  --teal-mist: #CFE2E4;
  --teal-wash: #E1EDEC;

  --clay: #DB5C34;
  --danger: #C0402A;
  --danger-wash: rgba(192,64,42,0.10);
  --ok: #2F8F46;
  --ok-wash: rgba(47,143,70,0.12);

  --radius: 20px;
  --radius-lg: 28px;
  --radius-sm: 12px;
  /* flat, Linear/Cursor style — minimal shadows; real elevation only on floating UI */
  --shadow-soft: 0 1px 2px rgba(22,24,28,0.05);
  --shadow-card: 0 1px 2px rgba(22,24,28,0.05);
  --shadow-pop: 0 18px 44px rgba(22,24,28,0.14);

  --maxw: 1280px;
  --nav-h: 68px;

  --page-glow: none;
}

/* ---- Dark theme — neutral charcoal (Cursor-like). Fully desaturated greys:
   NO tint, NO saturation. Teal + clay accents are identical to light mode.
   Surface ladder: #131314 page · #1A1A1B band · #202021 cards · #262628 raised. ---- */
:root[data-theme="dark"] {
  --ink: #ECECED;
  --ink-soft: #A6A7A9;
  --muted: #77787B;

  --paper: #131314;        /* page background */
  --paper-deep: #1A1A1B;   /* alternating band */
  --raised: #202021;       /* cards / panels */
  --raised-2: #262628;     /* inputs / elevated surfaces */
  --raised-hover: #2C2C2E;

  --line: rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.055);
  --line-strong: rgba(255,255,255,0.18);

  --teal: #1A7A9A;
  --teal-deep: #5FC2DC;    /* lighter teal for accent TEXT on charcoal (still teal) */
  --teal-ink: #BFE9F4;
  --teal-bright: #29A0C4;
  --teal-mist: rgba(41,160,196,0.30);
  --teal-wash: rgba(41,160,196,0.12);

  --clay: #DB5C34;
  --danger: #E5654A;
  --danger-wash: rgba(229,101,74,0.14);
  --ok: #4FB477;
  --ok-wash: rgba(79,180,119,0.14);

  --shadow-soft: none;
  --shadow-card: none;
  --shadow-pop: 0 18px 44px rgba(0,0,0,0.55);

  --page-glow: none;
}

/* ---- Dark theme (system, when not forced to light) — same neutral charcoal ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ECECED;
    --ink-soft: #A6A7A9;
    --muted: #77787B;

    --paper: #131314;
    --paper-deep: #1A1A1B;
    --raised: #202021;
    --raised-2: #262628;
    --raised-hover: #2C2C2E;

    --line: rgba(255,255,255,0.10);
    --line-soft: rgba(255,255,255,0.055);
    --line-strong: rgba(255,255,255,0.18);

    --teal: #1A7A9A;
    --teal-deep: #5FC2DC;
    --teal-ink: #BFE9F4;
    --teal-bright: #29A0C4;
    --teal-mist: rgba(41,160,196,0.30);
    --teal-wash: rgba(41,160,196,0.12);

    --clay: #DB5C34;
    --danger: #E5654A;
    --danger-wash: rgba(229,101,74,0.14);
    --ok: #4FB477;
    --ok-wash: rgba(79,180,119,0.14);

    --shadow-soft: none;
    --shadow-card: none;
    --shadow-pop: 0 18px 44px rgba(0,0,0,0.55);

    --page-glow: none;
  }
}

/* Compatibility tokens for shared components carried over from the old site
   (cookie-consent.js / cookie-consent.css). Mapped to the new design tokens so
   they adapt to light/dark automatically (the referenced vars switch by theme). */
:root {
  --accent: var(--teal);
  --border-strong: var(--line-strong);
  --border-strong-hover: var(--teal);
  --input-border: var(--line);
  --panel-border: var(--line);
  --surface-hover: var(--raised-hover);
  --overlay-scrim: rgba(6,10,14,0.55);
  --shadow-color: rgba(22,24,28,0.14);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-label: var(--ink);
  --text-muted: var(--muted);
  --copy-soft: var(--ink-soft);
  --cookie-banner-bg: var(--raised-2);
  --cookie-dialog-bg: var(--raised-2);
  --cookie-category-bg: var(--raised);
  --cookie-strong-bg: var(--raised);
  --cookie-strong-hover-bg: var(--raised-hover);
  --cookie-primary-bg: var(--teal);
  --cookie-primary-hover-bg: var(--teal-deep);
  --cookie-primary-text: #fff;
  --cookie-signal-bg: var(--teal-wash);
  --cookie-signal-border: var(--teal-mist);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
/* scrollbar-gutter keeps the vertical scrollbar space reserved on <html> (the
   root scroller). Horizontal bleed is contained here with overflow-x: clip
   rather than `overflow-x: hidden` on <body>: clip does not turn <body> into a
   separate scroll container, so the reserved gutter and the scrollbar stay on
   the same element and the full-width sticky nav/footer never shift on first
   paint. (overflow-x: hidden on body was the cause of the header "jump".) */
html { scroll-behavior: smooth; scrollbar-gutter: stable; overflow-x: clip; }
#demo { scroll-margin-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--page-glow);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
::selection { background: var(--teal-mist); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.shell { width: min(var(--maxw), calc(100% - 48px)); margin-inline: auto; }
.sr-only, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto;
  padding: 10px 16px; background: var(--teal); color: #fff; border-radius: 999px; z-index: 200;
}
main { flex: 1 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 1.5px solid transparent;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: none; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; width: 100%;
  font-size: 15px; font-weight: 600; background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.btn-secondary:hover { transform: translateY(-2px); opacity: .92; }
.is-featured .btn-secondary { background: var(--teal); border-color: var(--teal); color: #fff; }

/* small utility buttons used across dashboard */
.btn-subtle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--raised-2); color: var(--ink); border: 1px solid var(--line);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.btn-subtle:hover { border-color: var(--teal); color: var(--teal-deep); transform: translateY(-1px); }
.btn-save {
  min-height: 40px; padding: 0 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
}
.btn-save:hover { filter: brightness(1.06); }
.btn-cancel {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
}
.btn-cancel:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-danger { color: #fff !important; background: var(--danger) !important; border-color: var(--danger) !important; }
.btn-danger:hover { filter: brightness(1.05); }

/* ---------- Nav ---------- */
.nav-wrap {
  position: sticky; top: 0; z-index: 60; padding: 14px 0;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
:root[data-theme="dark"] .brand img { filter: invert(1) brightness(1.15); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: invert(1) brightness(1.15); } }
.brand-name { font-family: "Century Gothic", "URW Gothic", "Futura", sans-serif; font-weight: 700; font-size: 22.5px; letter-spacing: 0.015em; line-height: 1; }
.nav-links { display: flex; gap: 26px; margin-left: auto; color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav-links a { transition: color .16s ease; }
.nav-links a:hover, .nav-links a.is-active { color: var(--teal); }
/* account actions grouped + separated from the browse links by a hairline divider */
.nav-cta { display: flex; align-items: center; gap: 16px; margin-left: 0; padding-left: 22px; border-left: 1px solid var(--line); }
.nav-login { font-size: 15px; font-weight: 600; color: var(--ink); }
.nav-login:hover { color: var(--teal); }
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; margin-left: auto; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--ink); }

/* account dropdown */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
  border-radius: 999px; background: var(--raised); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; color: var(--ink);
  transition: border-color .16s ease, background .16s ease;
}
.acct-btn:hover { border-color: var(--teal); }
.acct-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--teal);
}
.acct-caret { width: 12px; height: 12px; opacity: .6; }
.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 240px;
  background: var(--raised-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-pop); padding: 8px; z-index: 80;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.acct.open .acct-menu { opacity: 1; visibility: visible; transform: none; }
.acct-menu-email { padding: 8px 12px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; word-break: break-all; }
.acct-menu a, .acct-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--ink); background: transparent; border: 0;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--raised-hover); color: var(--teal-deep); }
.acct-logout { color: var(--danger) !important; margin-top: 4px; border-top: 1px solid var(--line-soft) !important; border-radius: 0 0 10px 10px !important; }

/* ---------- Footer ---------- */
.site-footer { flex: 0 0 auto; padding: 54px 0 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line-soft); margin-top: 80px; }
.foot-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.foot-links a, .foot-link-btn {
  color: var(--ink-soft); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  background: transparent; border: 0; padding: 0; transition: color .16s ease;
}
.foot-links a:hover, .foot-link-btn:hover { color: var(--teal); }
/* LinkedIn — its own centred row, styled as a branded pill */
.foot-in { display: inline-flex; align-items: center; margin-right: 2px; opacity: .82; transition: opacity .2s ease, transform .2s ease; }
.foot-in img { width: 20px; height: 20px; display: block; }
.foot-in:hover { opacity: 1; transform: translateY(-1px); }
.foot-linkedin { display: none; width: max-content; margin: 26px auto 4px; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.foot-linkedin svg { width: 18px; height: 18px; }
.foot-linkedin:hover { color: #fff; background: #0A66C2; border-color: #0A66C2; transform: translateY(-2px); }
.foot-bottom { display: flex; justify-content: center; text-align: center; gap: 16px; padding-top: 22px; flex-wrap: wrap; }
.foot-bottom p { margin: 0; max-width: 720px; }

/* ---------- Page hero (marketing sub-pages) ---------- */
.page-hero { text-align: center; padding: 84px 0 40px; }
.section-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal-deep); }
.page-hero h1 { font-size: clamp(38px, 5.5vw, 62px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.03; margin-top: 14px; }
.page-hero .lede { max-width: 640px; margin: 20px auto 0; font-size: 18px; color: var(--ink-soft); }

/* ---------- Pricing ---------- */
.pricing-section { padding: 20px 0 40px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.pricing-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.pricing-card.is-featured { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.pricing-card-hero { position: relative; padding: 30px 26px 24px; overflow: hidden; }
.pricing-card-hero-mesh { position: absolute; inset: 0; z-index: 0; opacity: 1; }
.mesh-plan-starter { background:
  radial-gradient(130% 120% at 0% 0%, var(--teal-wash), transparent 60%),
  radial-gradient(90% 90% at 100% 6%, rgba(41,160,196,0.09), transparent 60%); }
.mesh-plan-featured { background:
  radial-gradient(135% 140% at 100% 0%, var(--teal-mist), transparent 64%),
  radial-gradient(100% 100% at 0% 100%, var(--teal-wash), transparent 62%); }
.mesh-plan-enterprise { background:
  radial-gradient(130% 120% at 0% 0%, rgba(219,92,52,0.15), transparent 60%),
  radial-gradient(90% 90% at 100% 6%, rgba(219,92,52,0.07), transparent 62%); }
/* faded blueprint grid, tinted with the card's own accent (teal / orange) —
   echoes the homepage textures. Teal + orange render identically in both themes. */
.pricing-card-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .7;
  background-image:
    linear-gradient(rgba(26,122,154,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,122,154,0.16) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(125% 110% at 0% 0%, #000 8%, transparent 72%);
  mask-image: radial-gradient(125% 110% at 0% 0%, #000 8%, transparent 72%);
}
.pricing-card.is-featured .pricing-card-hero::after {
  -webkit-mask-image: radial-gradient(125% 110% at 100% 0%, #000 8%, transparent 72%);
  mask-image: radial-gradient(125% 110% at 100% 0%, #000 8%, transparent 72%);
}
.pricing-card-hero:has(.mesh-plan-enterprise)::after {
  background-image:
    linear-gradient(rgba(219,92,52,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219,92,52,0.16) 1px, transparent 1px);
}
.pricing-card-head { position: relative; z-index: 1; }
.pricing-tier { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-deep); }
.pricing-card-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-top: 10px; }
.pricing-desc { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; min-height: calc(2 * 1.55em); }
.pricing-card-body { display: flex; flex-direction: column; gap: 18px; padding: 4px 26px 28px; flex: 1; }
.pricing-amount { display: flex; align-items: baseline; gap: 6px; }
.pricing-amount .value { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; }
.pricing-amount .suffix { font-size: 15px; color: var(--muted); font-weight: 500; }
.pricing-amount .suffix-placeholder { visibility: hidden; }
/* Checkout status line. Matches the .pricing-status class used in pricing.html
   (the old .pricing-card-status name is kept as an alias). Collapses fully when
   empty so the "What's included" divider stays aligned across all three cards. */
.pricing-status, .pricing-card-status { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 0; }
.pricing-status:empty, .pricing-card-status:empty { display: none; }
.pricing-card-includes { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.pricing-includes-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pricing-features { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 11px; }
.pricing-features > li { position: relative; padding-left: 26px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.pricing-features > li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%231A7A9A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* Nested capabilities under a feature (e.g. Forge -> Sculpting/PCBs/Mechanical) */
.pricing-subfeatures { list-style: none; margin: 9px 0 2px; padding: 0; display: grid; gap: 8px; }
.pricing-subfeatures li { position: relative; padding-left: 22px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.pricing-subfeatures li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%231A7A9A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 9px no-repeat;
}

/* Billing period toggle */
.pricing-billing { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 4px 0 34px; }
.billing-switch { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.billing-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--teal); box-shadow: 0 6px 16px rgba(26,122,154,0.26); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.billing-switch[data-active="yearly"] .billing-thumb { transform: translateX(100%); }
.billing-opt { position: relative; z-index: 1; flex: 0 0 auto; min-width: 118px; text-align: center; border: 0; background: transparent; cursor: pointer; padding: 9px 22px; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--ink-soft); border-radius: 999px; transition: color .2s ease; }
.billing-opt.is-active { color: #fff; }
.billing-opt:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .billing-thumb { transition: none; } }
.billing-hint { font-size: 13px; font-weight: 600; color: var(--teal-deep); }

/* "Save X%" badge in the price row (yearly only) */
.pricing-save { margin-left: auto; align-self: center; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--teal-deep); background: var(--teal-wash); border: 1px solid color-mix(in srgb, var(--teal) 32%, transparent); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pricing-save[hidden] { display: none; }

/* Featured "Most popular" badge (absolute so it never shifts card content) */
.pricing-badge { position: absolute; top: 18px; right: 20px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--teal); padding: 5px 11px; border-radius: 999px; box-shadow: 0 6px 16px rgba(26,122,154,0.28); }

/* Footnote */
.pricing-footnote { margin: 26px auto 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Contact / consulting inquiry ---------- */
/* Same panel language as the homepage newsletter CTA, but a calmer background
   (single low-opacity teal glow, no clay) so it reads as a secondary section. */
#contact { scroll-margin-top: calc(var(--nav-h) + 16px); }
.contact-section { padding: 20px 0 64px; }
.contact-panel {
  position: relative; overflow: hidden; text-align: center; margin: 0 auto; max-width: 760px;
  padding: 48px 40px; border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 130% at 6% 0%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 58%),
    var(--raised);
  border: 1px solid var(--line); box-shadow: var(--shadow-card); color: var(--ink);
}
.contact-panel > * { position: relative; }
.contact-panel h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 auto 10px; }
.contact-panel > p { max-width: 520px; margin: 0 auto 24px; color: var(--muted); font-size: 16px; }
.contact-form { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; text-align: left; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--raised-2); color: var(--ink); font: inherit; outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.contact-form textarea { resize: vertical; min-height: 108px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.contact-form .btn { width: 100%; }
.contact-fineprint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.contact-fineprint a { color: inherit; text-decoration: underline; }
/* Shared with the homepage newsletter widget (Turnstile holder + status line). */
.signup-turnstile { display: flex; justify-content: center; margin-top: 2px; }
.signup-turnstile:empty { display: none; }
.signup-status { margin: 4px 0 0; font-size: 14px; min-height: 1.2em; text-align: center; }
.signup-status.is-error { color: var(--clay); }
.signup-status.is-ok { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  .contact-row { grid-template-columns: 1fr; }
  .contact-panel { padding: 36px 22px; }
}

/* ---------- Auth (login / signup) ---------- */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 56px 24px 40px; }
.auth-shell { width: 100%; max-width: 440px; }
.auth-card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 34px 32px; }
.auth-card-header { text-align: center; margin-bottom: 26px; }
.auth-card-header h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card-header p { margin-top: 8px; color: var(--ink-soft); font-size: 15px; }
.auth-form { display: grid; gap: 16px; }
.auth-status { display: none; }
.auth-status.is-visible { display: block; padding: 11px 14px; border-radius: 12px; font-size: 14px; background: var(--danger-wash); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.auth-field { display: grid; gap: 7px; }
.auth-field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input {
  width: 100%; min-height: 48px; padding: 0 15px; border-radius: 12px;
  background: var(--raised-2); border: 1px solid var(--line); color: var(--ink); font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-input.has-toggle { padding-right: 64px; }
.auth-input::placeholder { color: var(--muted); }
.auth-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.auth-toggle { position: absolute; right: 8px; padding: 6px 10px; border-radius: 8px; background: transparent; border: 0; font-size: 13px; font-weight: 600; color: var(--teal-deep); }
.auth-toggle:hover { background: var(--raised-hover); }
.auth-field-error { font-size: 12.5px; color: var(--danger); min-height: 0; }
.auth-field-error:empty { display: none; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.auth-links a { color: var(--teal-deep); font-weight: 600; }
.auth-links a:hover { color: var(--teal); }
.auth-linklike {
  appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--teal-deep);
}
.auth-linklike:hover { color: var(--teal); }
.auth-hint { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.auth-consents { display: grid; gap: 12px; }
.auth-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13.5px; color: var(--ink-soft); }
.auth-consent input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--teal); }
.auth-consent a { color: var(--teal-deep); font-weight: 600; }
.auth-footer, .auth-alt { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.auth-footer a, .auth-alt a { color: var(--teal-deep); font-weight: 600; }

/* mockup shortcut — bypass the (non-functional) login to preview the signed-in pages */
.auth-bypass {
  margin-top: 16px; padding: 15px 16px; text-align: center; display: grid; gap: 9px;
  border: 1px dashed var(--line-strong); border-radius: 16px;
  background: color-mix(in srgb, var(--raised) 55%, transparent);
}
.auth-bypass-label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.auth-bypass a { color: var(--teal-deep); font-weight: 700; font-size: 14.5px; }
.auth-bypass a:hover { color: var(--teal); }

/* ---------- Dashboard ---------- */
.dash-shell { display: grid; grid-template-columns: 232px 1fr; gap: 34px; width: min(var(--maxw), calc(100% - 48px)); margin: 30px auto 0; align-items: start; }
.dash-sidebar { position: sticky; top: calc(var(--nav-h) + 20px); }
.dash-sidebar-heading { font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; }
.dash-sidebar-nav { display: grid; gap: 3px; }
.dash-sidebar-link { padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft); transition: background .14s ease, color .14s ease; }
.dash-sidebar-link:hover { background: var(--raised); color: var(--ink); }
.dash-sidebar-link[aria-current="page"] { background: var(--teal-wash); color: var(--teal-deep); font-weight: 600; }
.dash-main { min-width: 0; display: grid; gap: 22px; }
.dash-header h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.dash-header p { margin-top: 8px; color: var(--ink-soft); font-size: 15px; max-width: 560px; }
.dash-panel { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 24px 26px; }
.dash-panel-plain { background: var(--raised); }
.dash-panel-header { margin-bottom: 18px; }
.dash-panel-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.dash-panel-header p { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.dash-section { }

.dash-rows { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dash-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 14px 18px; background: var(--raised-2); }
.dash-row + .dash-row { border-top: 1px solid var(--line-soft); }
.dash-row-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.dash-row-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-row-control-end { justify-content: flex-end; }
.dash-row-value { font-size: 14.5px; color: var(--ink-soft); }
.dash-row-hint { font-size: 12.5px; color: var(--muted); }
.dash-input, .dash-select {
  min-height: 42px; padding: 0 13px; border-radius: 10px; width: 100%; max-width: 340px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 14.5px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.dash-select { max-width: 220px; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C818A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.dash-input:focus, .dash-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
/* Money input with a leading currency symbol (e.g. € / $), joined seamlessly to the field. */
.dash-input-money { display: flex; align-items: stretch; width: 100%; }
.dash-input-money .dash-input-affix { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--raised-2); color: var(--ink-soft); font-size: 14.5px; font-weight: 600; }
.dash-input-money .dash-input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.dash-link { color: var(--teal); font-weight: 600; text-decoration: none; }
.dash-link:hover { text-decoration: underline; }
.dash-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; font-size: 15px; }
.dash-avatar-lg { width: 48px; height: 48px; font-size: 18px; }

.dash-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.dash-form-actions-billing { justify-content: flex-start; }
.dash-save-status { font-size: 13px; color: var(--muted); margin-right: auto; }

/* toggle switch */
.dash-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.dash-setting-row:last-of-type { border-bottom: 0; }
.dash-setting-copy h3 { font-size: 15px; font-weight: 600; }
.dash-setting-copy p { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); max-width: 460px; }
.dash-toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.dash-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dash-toggle .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .18s ease; }
.dash-toggle .thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform .18s ease; }
.dash-toggle input:checked ~ .track { background: var(--teal); }
.dash-toggle input:checked ~ .thumb { transform: translateX(20px); }
.dash-toggle input:focus-visible ~ .track { box-shadow: 0 0 0 3px var(--teal-wash); }

/* apps / plan */
.dash-plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 18px; flex-wrap: wrap; }
.dash-plan-name { font-size: 16px; font-weight: 600; }
.dash-plan-head .dash-row-label { font-size: 15px; }
/* Tighten the gap under the billing "Current plan" heading so it matches the other
   panels (e.g. Usage → Included usage). .dash-plan is shared with the Apps page, so
   scope this to the billing plan panel only. */
.dash-panel[aria-labelledby="plan-heading"] .dash-plan { padding-top: 0; }
.dash-alert-box { padding: 14px 16px; border-radius: 12px; background: var(--teal-wash); border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent); margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* The [hidden] attribute must win over the display:flex above, or an empty alert box renders. */
.dash-alert-box[hidden] { display: none; }
.dash-alert-message { font-size: 14px; color: var(--teal-ink); }

/* usage / billing */
.dash-usage { display: grid; gap: 12px; }
.dash-usage-head { display: flex; align-items: baseline; justify-content: space-between; }
.dash-usage-value { font-size: 14.5px; font-weight: 600; }
.dash-usage-bar { position: relative; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dash-usage-bar-fill { position: absolute; inset: 0; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); }
.dash-usage-balance { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-balance-line { display: flex; align-items: center; gap: 10px; }
.dash-balance { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.dash-chip { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--raised-2); border: 1px solid var(--line); color: var(--ink-soft); }
.dash-pm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); margin-bottom: 20px; flex-wrap: wrap; }
.dash-pm-actions { display: flex; align-items: center; gap: 12px; }
.dash-pm-value { font-size: 14px; color: var(--ink-soft); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-field { display: grid; gap: 6px; }
.dash-field.span-2 { grid-column: 1 / -1; }
.dash-field label { font-size: 13.5px; font-weight: 600; }
.dash-field .dash-input, .dash-field .dash-select { max-width: none; }

/* table */
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.dash-table td { padding: 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.dash-empty { text-align: center; color: var(--muted); padding: 20px 0; }

/* sessions */
.dash-sessions-card { display: block; padding: 0; }
.dash-session-head, .dash-session-item { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: center; padding: 13px 18px; }
.dash-session-head { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--line); }
.dash-session-item { background: var(--raised-2); border-top: 1px solid var(--line-soft); font-size: 14px; }
.dash-session-device { font-weight: 600; color: var(--ink); }
.dash-session-current { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--teal-deep); text-transform: uppercase; letter-spacing: 0.06em; }
.dash-session-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* danger */
.dash-panel .btn-danger { margin-top: 4px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px;
  background: rgba(6,10,14,0.55); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 480px; background: var(--raised-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 28px;
  transform: translateY(10px); transition: transform .2s ease;
}
.modal-overlay.open .modal { transform: none; }
.modal-title { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.modal-body { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); }
.modal-body ul { padding-left: 20px; display: grid; gap: 6px; margin: 12px 0; }
.modal-body strong { color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.modal-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.modal-error { color: var(--danger); font-size: 13px; margin-top: 8px; }
.modal-close { position: absolute; }

/* cookie settings rows */
.cookie-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.cookie-row:last-of-type { border-bottom: 0; }
.cookie-row h3 { font-size: 15px; font-weight: 600; }
.cookie-row p { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.cookie-locked { font-size: 12px; font-weight: 700; color: var(--teal-deep); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; padding-top: 4px; }

/* ---------- Legal pages ---------- */
.legal { padding: 40px 0 20px; }
.legal-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 44px; align-items: start; }
.legal-toc { position: sticky; top: calc(var(--nav-h) + 24px); font-size: 13.5px; }
.legal-toc p { font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.legal-toc a { display: block; padding: 6px 0; color: var(--ink-soft); border-left: 2px solid transparent; padding-left: 12px; margin-left: -12px; }
.legal-toc a:hover { color: var(--teal-deep); border-color: var(--teal); }
.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 40px 0 12px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.legal-content p, .legal-content li { color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.legal-content p { margin: 10px 0; }
.legal-content ul, .legal-content ol { padding-left: 22px; margin: 10px 0; display: grid; gap: 6px; }
.legal-content a { color: var(--teal-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.legal-meta { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.legal-card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
  .dash-sidebar-nav { grid-auto-flow: column; overflow-x: auto; }
  .legal-wrap { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
  .nav-toggle { display: inline-flex; }
  /* Collapsed bar shows only brand + hamburger. The toggle expands a full-width
     panel containing the browse links AND the account actions (Log in / Sign up,
     or the account menu when signed in) so everything stays reachable on mobile. */
  .nav-links, .nav-cta { display: none; }
  .nav-wrap.nav-open { background: var(--paper); }
  .nav-wrap.nav-open .nav { flex-wrap: wrap; }
  .nav-wrap.nav-open .nav-links,
  .nav-wrap.nav-open .nav-cta {
    display: flex; flex-direction: column; flex-basis: 100%; width: 100%;
    align-items: stretch; gap: 4px; margin: 0;
  }
  .nav-wrap.nav-open .nav-links { order: 3; padding: 8px 0 0; }
  .nav-wrap.nav-open .nav-cta { order: 4; padding: 10px 0 2px; border-left: 0; border-top: 1px solid var(--line-soft); }
  .nav-wrap.nav-open .nav-links a,
  .nav-wrap.nav-open .nav-login { padding: 10px 2px; }
}
@media (max-width: 560px) {
  .dash-row { grid-template-columns: 1fr; gap: 8px; }
  .dash-setting-row { align-items: flex-start; }
  .foot-top { flex-direction: column; align-items: flex-start; gap: 18px; }
  .foot-bottom { flex-direction: column; }
}

/* reduce initial-load flash of unstyled nav */
[data-nav]:empty { min-height: var(--nav-h); }

/* ==========================================================================
   Live-stack integration (worker-injected nav/footer + session.js/header.js/
   auth.js/dashboard.js/library.js). Added when the mockup design became the
   live site so the new UI wires to the account backend.
   ========================================================================== */

/* Account menu is toggled by header.js via `.is-open` on [data-account-menu]. */
.acct-menu.is-open { opacity: 1; visibility: visible; transform: none; }

/* Prerelease "Soon" lock decoration (applyNavLock, production only). */
.nav-soon { opacity: .55; cursor: default; }
.nav-soon-badge { margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-deep); background: var(--teal-wash); padding: 2px 7px; border-radius: 999px; }

/* Nav auth-state gating. Pre-paint: the worker's AUTH_HINT_SCRIPT adds
   `aw-authed` to <html> from the readable aw_auth_hint cookie; session.js
   reconciles afterward. Guests see the login pill; authed users see the
   account menu. */
.acct { display: none; }
html.aw-authed .acct { display: block; }
html.aw-authed .nav-login,
html.aw-authed .nav-guest { display: none; }

/* Auth form status + field errors (auth.js toggles these classes). */
.auth-status.is-error {
  display: block; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  background: var(--danger-wash); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}
.auth-status.is-success {
  display: block; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  background: var(--ok-wash); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
}
.auth-input.input-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-wash); }
.auth-field-error.is-visible { display: block; }
.auth-consent .checkbox-error { color: var(--danger); }
/* The [hidden] attribute must beat the author display rules above (.auth-field and
   .auth-consents are display:grid, .auth-links is display:flex), or hidden auth
   blocks — the login password reveal, the signup "sent" state — still render. */
.auth-field[hidden],
.auth-consents[hidden],
.auth-links[hidden] { display: none; }

/* ---------- Dashboard extras (live dashboard.js output) ---------- */
.dash-save-status.is-visible { color: var(--ink-soft); }
.dash-password-error { color: var(--danger); }
.dash-password-error[hidden] { display: none; }
.dash-password-submit { align-self: center; }
.dash-setting-control { flex: 0 0 auto; }
.dash-reset-btn { white-space: nowrap; }
.dash-theme-select { max-width: 200px; }
.dash-session-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: center; padding: 13px 18px; background: var(--raised-2); border-top: 1px solid var(--line-soft); font-size: 14px; }
.dash-session-device { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dash-session-icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.dash-session-created { color: var(--ink-soft); }
.dash-session-revoke { min-height: 34px; padding: 0 14px; }
.dash-session-empty, .dash-session-loading, .dash-session-error { padding: 16px 18px; color: var(--muted); font-size: 14px; background: var(--raised-2); }
.dash-session-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--raised-2); border-top: 1px solid var(--line); }
.dash-session-range { font-size: 13px; color: var(--muted); }
.dash-session-pager { display: flex; align-items: center; gap: 10px; }
.dash-session-page { font-size: 13px; color: var(--ink-soft); }
.dash-pager-btn { min-height: 34px; padding: 0 12px; }

/* Delete-account modal (dashboard.js toggles the [hidden] attribute) */
.dash-modal-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: var(--overlay-scrim); backdrop-filter: blur(4px); }
.dash-modal-overlay[hidden] { display: none; }
.dash-modal { width: 100%; max-width: 480px; background: var(--raised-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 28px; }
.dash-modal-title { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.dash-modal-body { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); }
.dash-modal-body ul { padding-left: 20px; display: grid; gap: 6px; margin: 12px 0; }
.dash-modal-body strong { color: var(--ink); }
.dash-modal-form { margin-top: 16px; display: grid; gap: 10px; }
.dash-modal-form .dash-row-label { font-weight: 600; }
.dash-modal-error { color: var(--danger); font-size: 13px; }
.dash-modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.dash-modal-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ---------- Product Library (browse) — gallery ported from the marketing mock ---------- */
/* tokens the gallery needs (embedded drafting grid + frosted chips), defined for both themes */
:root { --grid-line: rgba(40,80,70,0.15); --chip-frost: rgba(242,244,236,0.82); }
:root[data-theme="dark"] { --grid-line: rgba(255,255,255,0.05); --chip-frost: rgba(32,32,33,0.85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grid-line: rgba(255,255,255,0.05); --chip-frost: rgba(32,32,33,0.85); } }

/* hero — mock proportions, live copy */
.lib-hero { padding: 54px 0 6px; }
.lib-hero .display { font-weight: 800; letter-spacing: -0.022em; line-height: 1.04; font-size: clamp(34px, 4.6vw, 60px); margin-top: 14px; }
.lib-lead { max-width: 720px; margin-top: 16px; color: var(--ink-soft); font-size: 19px; line-height: 1.55; }

/* toolbar + underlined category tabs (no pills; the active tab carries a teal underline) */
.lib-section { padding: 28px 0 44px; }
.lib-toolbar { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 36px; }
.lib-categories { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); }
.lib-cat-tab { position: relative; padding: 11px 18px 14px; border: 0; border-radius: 0; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); background: transparent; transition: color .16s ease; }
.lib-cat-tab:hover:not(.is-active) { color: var(--teal-deep); }
.lib-cat-tab.is-active { color: var(--ink); background: transparent; box-shadow: none; }
.lib-cat-tab.is-active::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; background: var(--teal); border-radius: 2px 2px 0 0; }
.lib-status { font-size: 13px; color: var(--muted); text-align: center; }
.lib-status:empty { display: none; }

/* gallery grid + boxless tiles (drafting-grid stage carries the tile; no live 3D) */
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lib-grid[data-state="loading"] { opacity: .6; }
.g-card { position: relative; display: flex; flex-direction: column; min-height: 300px; border: 0; background: transparent; box-shadow: none; border-radius: var(--radius-lg); transition: transform .26s cubic-bezier(.2,.7,.2,1); }
.g-card:hover { transform: translateY(-6px); }
.g-card .mini { position: relative; height: 236px; border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse 64% 58% at 50% 44%, var(--teal-wash), transparent 70%); }
.g-card .mini::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 20%, transparent 78%); mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 20%, transparent 78%); }
.g-poster { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.g-ph { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.g-ph span { font-size: 64px; font-weight: 800; color: var(--muted); opacity: .5; }
/* live auto-rotating GLB layered over the drafting-grid stage; transparent so the grid
   shows around the model. Decorative (pointer-events:none) so the tile stays a link;
   the poster/initial fades out once the model has loaded. */
.g-model { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; background-color: transparent; --poster-color: transparent; }
.mini.is-live .g-poster, .mini.is-live .g-ph { opacity: 0; transition: opacity .45s ease; }
.g-card .meta { padding: 15px 6px 2px; display: flex; flex-direction: column; gap: 4px; }
.g-card .meta h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.g-card .meta span { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* reveal on scroll */
.g-card.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.g-card.reveal.vis { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .g-card.reveal { opacity: 1; transform: none; } }

/* pager + states */
.lib-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 34px; }
.lib-page { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink); }
.lib-page:hover { border-color: var(--teal); color: var(--teal-deep); }
.lib-page.is-disabled { opacity: .4; pointer-events: none; }
.lib-page-status { font-size: 14px; color: var(--muted); }
.lib-empty, .lib-error { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }

/* detail */
.lib-detail-wrap { padding: 30px 0 20px; }
.lib-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--teal-deep); margin-bottom: 22px; }
.lib-back:hover { color: var(--teal); }
[data-lib-notfound], [data-lib-error] { display: none; }
.lib-detail-wrap[data-state="notfound"] [data-lib-notfound],
.lib-detail-wrap[data-state="error"] [data-lib-error] { display: block; text-align: center; padding: 40px 0; }
.lib-detail-wrap[data-state="notfound"] .lib-detail-grid,
.lib-detail-wrap[data-state="error"] .lib-detail-grid { display: none; }
.lib-detail-message h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin: 12px 0; }
.lib-detail-message p { color: var(--ink-soft); margin-bottom: 18px; }
.lib-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 600; background: var(--teal); color: #fff; border: 1.5px solid var(--teal); }
.lib-btn:hover { filter: brightness(1.06); color: #fff; }
.lib-detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.lib-detail-viewer, .lib-detail-stage { aspect-ratio: 1 / 1; background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center; position: sticky; top: calc(var(--nav-h) + 20px); }
.lib-model { width: 100%; height: 100%; --poster-color: transparent; }
.lib-detail-body h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; }
.lib-detail-body .lib-summary { margin-top: 12px; font-size: 18px; color: var(--ink-soft); }
.lib-detail-body .lib-description { margin-top: 16px; color: var(--ink-soft); line-height: 1.7; }
.lib-specs { display: grid; gap: 0; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lib-spec { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 12px 16px; background: var(--raised-2); }
.lib-spec + .lib-spec { border-top: 1px solid var(--line-soft); }
.lib-spec dt { font-weight: 600; color: var(--muted); margin: 0; }
.lib-spec dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 900px) { .lib-grid { grid-template-columns: 1fr 1fr; } .lib-detail-grid { grid-template-columns: 1fr; } .lib-detail-viewer, .lib-detail-stage { position: static; } }
@media (max-width: 620px) { .lib-grid { grid-template-columns: 1fr; } }
