/* =============================================================================
   Investment CMS platform -- site.css
   The complete design system for investmentcms.com (marketing, checkout,
   customer panel, admin panel). One file, no @import, no external fonts,
   no build step. Served as a static asset under a strict CSP.

   FAMILY RULE
   The product being sold (projects/legacy-cms/design/) themes itself with the
   token contract in theme-system.css: a fixed emerald brand ramp (--brand-900
   .. --brand-100), surface tokens (--color-BasicBg / SecondaryBg / CardBg /
   Vessel / Line / Input), three text weights (--color-PrimaryText /
   SecondaryText / TertiaryText), an accent pair (--ic-accent /
   --ic-accent-hover) and a filled-button pair (--ic-accent-solid /
   --ic-on-accent). This file reuses those exact names and hues so the
   marketing site and the deployed product read as one object.

   ONE DELIBERATE DEVIATION, documented at its token below:
   --color-TertiaryText is darkened by one step in light mode. The product's
   #6B7770 measures 4.47:1 on the warm-paper ground, which misses WCAG AA for
   body-size text.

   THEME SWITCHING
   The product switches on :root[data-theme]. A marketing site has no signed-in
   preference to read on the first paint, so the system preference is the
   primary switch here; [data-theme] still wins in both directions when a page
   chooses to offer a toggle.

   SECTIONS
     1  Reset and base
     2  Brand constants, scale, motion
     3  Theme tokens: light (:root), dark (media + [data-theme])
     4  Typography
     5  Accessibility primitives
     6  Layout primitives
     7  Site header, nav, mobile menu
     8  Hero
     9  Cards, features, specs, stats
    10  Pricing
    11  Lifecycle timeline
    12  FAQ (details/summary)
    13  Buttons
    14  Badges and status
    15  Forms
    16  Modal / dialog
    17  Toast and live region
    18  Empty state, skeleton, spinner
    19  Panel shell (sidebar + content)
    20  Data table
    21  Footer
    22  Utilities
    23  Print
   ============================================================================= */

/* =============================================================================
   1. RESET AND BASE
   ============================================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol { margin: 0; }

ul[class], ol[class] { list-style: none; padding: 0; }

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

table { border-collapse: collapse; }

/* Nothing may push the page sideways. Wide content scrolls inside its own
   container (see .table-wrap) rather than widening the document. */
body { overflow-x: hidden; }

/* =============================================================================
   2. BRAND CONSTANTS, SCALE, MOTION
   The brand ramp is the one thing that does not change per theme. Surfaces
   shift; the brand does not. Values are copied verbatim from the product's
   theme-system.css so the two sites cannot drift apart.
   ============================================================================= */

/* The whole ramp is published even where this file does not consume every
   step: it is the shared palette pages draw on, and it must match the product
   step for step. Do not prune it to whatever site.css happens to use today. */
:root {
  --brand-900: #0B3B2E;
  --brand-800: #0F4A39;
  --brand-700: #136A4E;
  --brand-600: #178A63;
  --brand-500: #1DA97A;
  --brand-400: #41C494;
  --brand-300: #7FD9B6;
  --brand-200: #B8ECD7;
  --brand-100: #E4F7EF;

  /* Money semantics, inherited from the product. */
  --gain: #16A34A;
  --loss: #DC2626;

  /* Fluid type scale. clamp() means headings scale continuously instead of
     jumping at breakpoints, which is what keeps 360px readable. */
  --fs-micro: clamp(10px, 0.68rem + 0.1vw, 11.5px);
  --fs-cap:   clamp(11px, 0.72rem + 0.12vw, 12.5px);
  --fs-body:  clamp(14px, 0.86rem + 0.16vw, 16px);
  --fs-lead:  clamp(16px, 0.95rem + 0.25vw, 19px);
  --fs-h4:    clamp(15px, 0.9rem + 0.2vw, 17px);
  --fs-h3:    clamp(17px, 0.98rem + 0.4vw, 21px);
  --fs-h2:    clamp(21px, 1.1rem + 0.9vw, 30px);
  --fs-h1:    clamp(28px, 1.4rem + 2.2vw, 50px);
  /* The single most-looked-at number on the page gets its own step, exactly as
     the balance figure does in the product. Here that number is the price. */
  --fs-figure: clamp(30px, 1.6rem + 3.2vw, 56px);

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --tap: 44px;                       /* minimum touch target */
  --measure: 68ch;                   /* readable line length */
  --container: 1160px;
  --panel-nav-w: 232px;
  --header-h: 60px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur-1: 0.15s;
  --dur-2: 0.24s;

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI',
               Inter, system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
               'Liberation Mono', monospace;
}

/* =============================================================================
   3. THEME TOKENS
   ============================================================================= */

/* 3.1 LIGHT -- warm paper. Same surfaces as the product's `light` theme. */
:root {
  --color-BasicBg: #FBFAF7;
  --color-SecondaryBg: #FFFFFF;
  --color-CardBg: #FFFFFF;
  --color-Vessel: #F2F0EA;
  --color-Line: #E4E0D7;
  --color-Input: #F6F4EF;
  --color-PrimaryText: #14201C;       /* 16.9:1 on BasicBg */
  --color-SecondaryText: #46544E;     /* 7.6:1  on BasicBg */
  --color-TertiaryText: #626D67;      /* 5.1:1 -- DEVIATION: product ships
                                         #6B7770, which is 4.47:1 and misses AA
                                         for body-size text. Darkened one step. */
  --color-DisableText: #9AA39D;       /* deliberately below AA: disabled must
                                         read as disabled (WCAG 1.4.3 exempts
                                         inactive controls). */
  --color-HoverBg: #F2F0EA;

  --ic-accent: var(--brand-600);          /* borders, rules, focus rings */
  --ic-accent-hover: var(--brand-700);
  --ic-accent-text: var(--brand-700);     /* 6.3:1 -- accent used AS TEXT */
  --ic-accent-solid: var(--brand-700);    /* filled button ground */
  --ic-on-accent: #FFFFFF;                /* 6.6:1 on --ic-accent-solid */
  --ic-accent-soft: #E4F7EF;              /* tint for chips and rails */

  --color-Buy: var(--gain);
  --color-Sell: var(--loss);

  /* Status pairs. Each foreground is measured against its own background. */
  --st-ok-bg: #DCF3E7;      --st-ok-fg: #0F5132;    /* 8.0:1 */
  --st-warn-bg: #FBF0D6;    --st-warn-fg: #7A5410;  /* 6.0:1 */
  --st-bad-bg: #FBE3E3;     --st-bad-fg: #8E1B1B;   /* 7.4:1 */
  --st-off-bg: #E9ECEF;     --st-off-fg: #3A4550;   /* 8.9:1 */
  --st-info-bg: #E2ECFB;    --st-info-fg: #1D4E89;  /* 6.5:1 */

  --glass-fill: rgba(255, 255, 255, 0.82);
  --glass-stroke: rgba(20, 32, 28, 0.10);
  --glass-stroke-2: rgba(20, 32, 28, 0.16);
  --glass-blur: blur(18px) saturate(150%);

  --emb-high: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --emb-low:  inset 0 -1px 0 rgba(20, 32, 28, 0.06);
  --emb-well: inset 0 2px 4px rgba(20, 32, 28, 0.07),
              inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  --elev-1: 0 1px 2px rgba(20, 32, 28, 0.05),
            0 6px 16px -10px rgba(20, 32, 28, 0.18);
  --elev-2: 0 2px 6px rgba(20, 32, 28, 0.07),
            0 20px 40px -18px rgba(20, 32, 28, 0.24);

  --hero-bg: linear-gradient(152deg, #12261F 0%, #0B3B2E 58%, #0F4A39 100%);
  --hero-ink: #EAF3EF;
  --hero-ink-dim: #B6CEC3;            /* 7.4:1 on the darkest hero stop */

  --skeleton-1: #EDEAE3;
  --skeleton-2: #F7F5F1;

  color-scheme: light;
}

/* 3.2 DARK -- refined neutral slate, the product's `dark` theme.
   Written twice on purpose: once for the system preference (yielding to an
   explicit light choice) and once for an explicit dark choice, so a toggle
   wins in both directions and no colour is ever defined only inside a query. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-BasicBg: #0F1419;
    --color-SecondaryBg: #131A21;
    --color-CardBg: #161C23;
    --color-Vessel: #1C242C;
    --color-Line: #26313A;
    --color-Input: #1A222A;
    --color-PrimaryText: #E9EEF2;
    --color-SecondaryText: #A8B4BD;
    --color-TertiaryText: #7C8A94;
    --color-DisableText: #56626B;
    --color-HoverBg: #1C242C;

    --ic-accent: var(--brand-400);
    --ic-accent-hover: var(--brand-300);
    --ic-accent-text: var(--brand-400);   /* 8.4:1 on BasicBg */
    --ic-accent-solid: var(--brand-400);
    --ic-on-accent: #06231A;              /* 7.6:1 on brand-400 */
    --ic-accent-soft: rgba(65, 196, 148, 0.13);

    --color-Buy: #34D399;
    --color-Sell: #F87171;

    --st-ok-bg: rgba(52, 211, 153, 0.14);   --st-ok-fg: #6EE7B7;
    --st-warn-bg: rgba(234, 179, 8, 0.15);  --st-warn-fg: #FBD24E;
    --st-bad-bg: rgba(248, 113, 113, 0.15); --st-bad-fg: #FCA5A5;
    --st-off-bg: rgba(148, 163, 184, 0.15); --st-off-fg: #CBD5E1;
    --st-info-bg: rgba(96, 165, 250, 0.15); --st-info-fg: #93C5FD;

    --glass-fill: rgba(19, 26, 33, 0.78);
    --glass-stroke: rgba(255, 255, 255, 0.10);
    --glass-stroke-2: rgba(255, 255, 255, 0.17);
    --glass-blur: blur(20px) saturate(140%);

    --emb-high: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --emb-low:  inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    --emb-well: inset 0 2px 5px rgba(0, 0, 0, 0.42),
                inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    --elev-1: 0 1px 2px rgba(0, 0, 0, 0.34), 0 10px 24px -14px rgba(0, 0, 0, 0.6);
    --elev-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 56px -20px rgba(0, 0, 0, 0.7);

    --hero-bg: linear-gradient(152deg, #16202A 0%, #0E1820 55%, #10231D 100%);
    --hero-ink: #E9EEF2;
    --hero-ink-dim: #A8B4BD;

    --skeleton-1: #1C242C;
    --skeleton-2: #26313A;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-BasicBg: #0F1419;
  --color-SecondaryBg: #131A21;
  --color-CardBg: #161C23;
  --color-Vessel: #1C242C;
  --color-Line: #26313A;
  --color-Input: #1A222A;
  --color-PrimaryText: #E9EEF2;
  --color-SecondaryText: #A8B4BD;
  --color-TertiaryText: #7C8A94;
  --color-DisableText: #56626B;
  --color-HoverBg: #1C242C;

  --ic-accent: var(--brand-400);
  --ic-accent-hover: var(--brand-300);
  --ic-accent-text: var(--brand-400);
  --ic-accent-solid: var(--brand-400);
  --ic-on-accent: #06231A;
  --ic-accent-soft: rgba(65, 196, 148, 0.13);

  --color-Buy: #34D399;
  --color-Sell: #F87171;

  --st-ok-bg: rgba(52, 211, 153, 0.14);   --st-ok-fg: #6EE7B7;
  --st-warn-bg: rgba(234, 179, 8, 0.15);  --st-warn-fg: #FBD24E;
  --st-bad-bg: rgba(248, 113, 113, 0.15); --st-bad-fg: #FCA5A5;
  --st-off-bg: rgba(148, 163, 184, 0.15); --st-off-fg: #CBD5E1;
  --st-info-bg: rgba(96, 165, 250, 0.15); --st-info-fg: #93C5FD;

  --glass-fill: rgba(19, 26, 33, 0.78);
  --glass-stroke: rgba(255, 255, 255, 0.10);
  --glass-stroke-2: rgba(255, 255, 255, 0.17);
  --glass-blur: blur(20px) saturate(140%);

  --emb-high: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --emb-low:  inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  --emb-well: inset 0 2px 5px rgba(0, 0, 0, 0.42),
              inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.34), 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --elev-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 56px -20px rgba(0, 0, 0, 0.7);

  --hero-bg: linear-gradient(152deg, #16202A 0%, #0E1820 55%, #10231D 100%);
  --hero-ink: #E9EEF2;
  --hero-ink-dim: #A8B4BD;

  --skeleton-1: #1C242C;
  --skeleton-2: #26313A;

  color-scheme: dark;
}

/* =============================================================================
   4. TYPOGRAPHY
   System stack only. The CSP forbids external fonts and there is no build step
   to inline one; personality comes from the scale and the numeric treatment.
   ============================================================================= */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-BasicBg);
  color: var(--color-PrimaryText);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 650;
  color: var(--color-PrimaryText);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { max-width: var(--measure); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--color-SecondaryText);
}

.eyebrow {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ic-accent-text);
}

.muted { color: var(--color-SecondaryText); }
.dim   { color: var(--color-TertiaryText); }

small, .small { font-size: var(--fs-cap); line-height: 1.5; }

a {
  color: var(--ic-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--ic-accent-hover); }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code:not(pre code) {
  background: var(--color-Vessel);
  border: 1px solid var(--color-Line);
  border-radius: 6px;
  padding: 0.1em 0.38em;
  word-break: break-word;
}

pre {
  background: var(--color-Vessel);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Money and any figure that refreshes must not jitter, and columns must align
   down the page. */
.num, .tnum, td.num, .stat-value, .price-figure {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-Line);
  margin: var(--sp-6) 0;
}

/* Prose lists inside content blocks keep their markers. */
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: var(--sp-2); max-width: var(--measure); }
.prose > * + * { margin-top: var(--sp-4); }

/* =============================================================================
   5. ACCESSIBILITY PRIMITIVES
   ============================================================================= */

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: 1000;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ic-accent-solid);
  color: var(--ic-on-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--sp-3); color: var(--ic-on-accent); }

/* Focus is never removed, only styled. Every interactive element inherits it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ic-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion. The spinner and skeleton are excluded and handled in
   section 18: a loading indicator that stops moving reports the wrong state,
   so those are slowed and softened rather than frozen. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *:not(.spinner):not(.skeleton),
  *:not(.spinner):not(.skeleton)::before,
  *:not(.spinner):not(.skeleton)::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   6. LAYOUT PRIMITIVES
   ============================================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.container-narrow { max-width: 760px; }
.container-form   { max-width: 480px; }

.section { padding-block: clamp(40px, 7vw, 88px); }
.section-tight { padding-block: clamp(28px, 4vw, 48px); }
.section-alt { background: var(--color-SecondaryBg); border-block: 1px solid var(--color-Line); }

.section-head { margin-bottom: var(--sp-6); }
.section-head > * + * { margin-top: var(--sp-3); }
.section-head p { color: var(--color-SecondaryText); font-size: var(--fs-lead); }

/* Intrinsic grid: columns reflow by available space, not by breakpoint, so it
   is correct at 360px without a media query. */
.grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.grid-gap-lg { gap: var(--sp-5); }

/* Vertical rhythm without margin collapsing surprises. */
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-5); }

/* Horizontal group that wraps instead of overflowing. */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.cluster-between { justify-content: space-between; }

/* Two-column split that collapses below 860px. */
.split {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1.05fr 0.95fr; }
  .split-even { grid-template-columns: 1fr 1fr; }
}

/* =============================================================================
   7. SITE HEADER, NAV, MOBILE MENU
   ============================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-Line);
}
/* Where blur is unsupported, chrome must not become unreadable transparency
   over scrolled text. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--color-SecondaryBg); }
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--color-PrimaryText);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--color-PrimaryText); }
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--hero-bg);
  display: grid;
  place-items: center;
  color: var(--brand-300);
  font-size: 13px;
  font-weight: 800;
}

.nav-toggle {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-sm);
  background: var(--color-CardBg);
  color: var(--color-PrimaryText);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--color-HoverBg); }

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-1) var(--ease);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: auto;
}
.site-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-3);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--color-SecondaryText);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--color-HoverBg); color: var(--color-PrimaryText); }
.nav-link[aria-current="page"] {
  color: var(--color-PrimaryText);
  font-weight: 650;
  background: var(--ic-accent-soft);
}

/* Mobile drawer. Below 900px the nav becomes a panel under the header.
   PROGRESSIVE ENHANCEMENT: the markup must NOT ship the `hidden` attribute.
   mountMobileNav() in ui.js applies it on mount and removes it again above
   900px, so a page whose JavaScript never runs still shows a usable stacked
   nav instead of an unopenable one. `hidden` is therefore owned entirely by
   ui.js, and the utility rule `[hidden]{display:none!important}` is what
   actually hides it. */
@media (max-width: 899px) {
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    padding: var(--sp-3) clamp(16px, 4vw, 32px) var(--sp-5);
    background: var(--color-SecondaryBg);
    border-bottom: 1px solid var(--color-Line);
    box-shadow: var(--elev-2);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-link { min-height: var(--tap); font-size: var(--fs-lead); }
  .site-nav-actions {
    margin: var(--sp-2) 0 0;
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav-actions .btn { width: 100%; }
  .site-header-inner { position: relative; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
}

/* =============================================================================
   8. HERO
   ============================================================================= */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding-block: clamp(48px, 9vw, 104px);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-stroke-2) 22%,
              var(--glass-stroke-2) 78%, transparent);
  pointer-events: none;
}
.hero h1 { color: var(--hero-ink); max-width: 18ch; }
.hero p { color: var(--hero-ink-dim); }
.hero .lead { color: var(--hero-ink-dim); max-width: 54ch; }
.hero .eyebrow { color: var(--brand-300); }
.hero a:not(.btn) { color: var(--brand-200); }
.hero-actions { margin-top: var(--sp-5); }

/* A hero-side surface (screenshot frame, price card, checkout summary). */
.hero-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-stroke-2);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  box-shadow: var(--emb-high), var(--elev-2);
}
.hero-panel h2, .hero-panel h3 { color: var(--hero-ink); }
.hero-panel p, .hero-panel li { color: var(--hero-ink-dim); }

/* =============================================================================
   9. CARDS, FEATURES, SPECS, STATS
   ============================================================================= */

.card {
  background: var(--color-CardBg);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--emb-high), var(--emb-low), var(--elev-1);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.card-head h2, .card-head h3 { margin: 0; }

.feature-card {
  background: var(--color-CardBg);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--emb-high), var(--emb-low), var(--elev-1);
  transition: box-shadow var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.feature-card:hover {
  box-shadow: var(--emb-high), var(--emb-low), var(--elev-2);
  border-color: var(--glass-stroke-2);
}
.feature-card h3 { margin-bottom: var(--sp-2); font-size: var(--fs-h3); }
.feature-card p { color: var(--color-SecondaryText); max-width: none; }
.feature-icon {
  width: 38px;
  height: 38px;
  margin-bottom: var(--sp-4);
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--ic-accent-soft);
  color: var(--ic-accent-text);
}
.feature-list {
  margin-top: var(--sp-3);
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-cap);
  color: var(--color-SecondaryText);
}
.feature-list li { position: relative; padding-left: 1.35em; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ic-accent);
}

/* Specification table: label/value pairs, honest and dense. Two columns on a
   phone would truncate values, so it stacks. */
.spec-table { width: 100%; font-size: var(--fs-body); }
.spec-table th,
.spec-table td {
  text-align: left;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-Line);
  vertical-align: top;
}
.spec-table th {
  font-weight: 600;
  color: var(--color-SecondaryText);
  width: 34%;
  padding-right: var(--sp-4);
}
.spec-table td { color: var(--color-PrimaryText); }
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }
@media (max-width: 559px) {
  .spec-table th, .spec-table td { display: block; width: auto; }
  .spec-table th { border-bottom: 0; padding-bottom: var(--sp-1); }
  .spec-table td { padding-top: 0; }
}

.stat {
  padding: var(--sp-4);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-md);
  background: var(--color-CardBg);
}
.stat-label {
  font-size: var(--fs-cap);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-TertiaryText);
}
.stat-value {
  margin-top: var(--sp-1);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.1;
}
.stat-note { font-size: var(--fs-cap); color: var(--color-SecondaryText); }

/* =============================================================================
   10. PRICING
   ============================================================================= */

.pricing-card {
  display: flex;
  flex-direction: column;
  background: var(--color-CardBg);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-5);
  box-shadow: var(--emb-high), var(--emb-low), var(--elev-1);
}
.pricing-card-feature {
  border-color: var(--ic-accent);
  box-shadow: var(--emb-high), var(--elev-2);
}
.pricing-kicker {
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ic-accent-text);
}
.price-figure {
  display: flex;
  align-items: baseline;
  gap: 0.2em;
  margin-top: var(--sp-2);
  font-size: var(--fs-figure);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.price-period {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--color-SecondaryText);
  letter-spacing: 0;
}
.price-sub {
  margin-top: var(--sp-2);
  color: var(--color-SecondaryText);
  font-size: var(--fs-cap);
}
.price-includes {
  margin: var(--sp-5) 0 var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}
.price-includes li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--sp-2);
  align-items: start;
  color: var(--color-SecondaryText);
}
.price-includes li::before {
  content: "";
  width: 15px;
  height: 15px;
  margin-top: 0.28em;
  border-radius: 50%;
  background: var(--ic-accent-soft);
  border: 1px solid var(--ic-accent);
}
.pricing-card .btn { margin-top: auto; }

/* =============================================================================
   11. LIFECYCLE TIMELINE
   Renders the billing states from ARCHITECTURE section 2 as an ordered list
   with a rail. Semantically a list; visually a timeline.
   ============================================================================= */

.timeline {
  position: relative;
  display: grid;
  gap: var(--sp-5);
  padding-left: var(--sp-6);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--color-Line);
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-6) + 4px);
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-CardBg);
  border: 2px solid var(--color-Line);
}
.timeline-item[data-state="active"]::before    { border-color: var(--color-Buy); }
.timeline-item[data-state="overdue"]::before   { border-color: var(--st-warn-fg); }
.timeline-item[data-state="suspended"]::before { border-color: var(--color-Sell); }
.timeline-item[data-state="cancelled"]::before { border-color: var(--color-TertiaryText); }
.timeline-item[data-state="deleted"]::before {
  border-color: var(--color-Sell);
  background: var(--color-Sell);
}
.timeline-when {
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-TertiaryText);
}
.timeline-item h3 { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-h4); }
.timeline-item p { color: var(--color-SecondaryText); margin: 0; }

/* =============================================================================
   12. FAQ (details / summary)
   No JavaScript. The disclosure widget is native, so it works before ui.js
   loads and keeps its keyboard semantics for free.
   ============================================================================= */

.faq { display: grid; gap: var(--sp-3); }

.faq-item {
  background: var(--color-CardBg);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-md);
  box-shadow: var(--emb-high);
}
.faq-item > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  min-height: var(--tap);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-md);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-TertiaryText);
  border-bottom: 2px solid var(--color-TertiaryText);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur-2) var(--ease);
}
.faq-item[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq-item > summary:hover { background: var(--color-HoverBg); }
.faq-answer {
  padding: 0 var(--sp-4) var(--sp-4);
  color: var(--color-SecondaryText);
}
.faq-answer > * + * { margin-top: var(--sp-3); }

/* =============================================================================
   13. BUTTONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--ic-accent-solid);
  border-color: var(--ic-accent-solid);
  color: var(--ic-on-accent);
  box-shadow: var(--emb-high), var(--elev-1);
}
.btn-primary:hover:not(:disabled) {
  background: var(--ic-accent-hover);
  border-color: var(--ic-accent-hover);
  color: var(--ic-on-accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-Line);
  color: var(--color-PrimaryText);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-HoverBg);
  border-color: var(--glass-stroke-2);
  color: var(--color-PrimaryText);
}

.btn-danger {
  background: transparent;
  border-color: var(--color-Sell);
  color: var(--color-Sell);
}
.btn-danger:hover:not(:disabled) {
  background: var(--st-bad-bg);
  color: var(--st-bad-fg);
  border-color: var(--color-Sell);
}
.btn-danger-solid {
  background: #B42323;
  border-color: #B42323;
  color: #FFFFFF;                       /* 6.1:1 */
}
.btn-danger-solid:hover:not(:disabled) { background: #9A1D1D; border-color: #9A1D1D; }

.btn-sm { min-height: 34px; padding: 0 var(--sp-3); font-size: var(--fs-cap); }
.btn-lg { min-height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-lead); }
.btn-block { display: flex; width: 100%; }

/* On the hero's dark ground the ghost outline needs the hero's ink, not the
   page's, or it disappears in light mode. */
.hero .btn-ghost {
  border-color: var(--glass-stroke-2);
  color: var(--hero-ink);
}
.hero .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--hero-ink);
}

/* Inline pending state driven by ui.js (button keeps its width, gains a ring). */
.btn[data-busy="true"] { pointer-events: none; opacity: 0.8; }
.btn[data-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: ic-spin 0.8s linear infinite;
}

/* =============================================================================
   14. BADGES AND STATUS
   The four lifecycle states plus the provisioning/neutral cases. The label
   text carries the meaning; colour is reinforcement, never the only signal.
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.22em 0.7em;
  border-radius: var(--r-pill);
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--st-off-bg);
  color: var(--st-off-fg);
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-plain::before { display: none; }

.badge-active,
.badge-paid,
.badge-done      { background: var(--st-ok-bg);   color: var(--st-ok-fg); }
.badge-overdue,
.badge-pending,
.badge-running   { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.badge-suspended,
.badge-failed    { background: var(--st-bad-bg);  color: var(--st-bad-fg); }
.badge-cancelled,
.badge-void,
.badge-expired   { background: var(--st-off-bg);  color: var(--st-off-fg); }
.badge-provisioning,
.badge-info      { background: var(--st-info-bg); color: var(--st-info-fg); }

/* Callout: a bordered notice used for honest limits and warnings. */
.notice {
  border: 1px solid var(--color-Line);
  border-left: 3px solid var(--ic-accent);
  border-radius: var(--r-md);
  background: var(--color-SecondaryBg);
  padding: var(--sp-4);
  color: var(--color-SecondaryText);
}
.notice > * + * { margin-top: var(--sp-2); }
.notice strong { color: var(--color-PrimaryText); }
.notice-warn { border-left-color: var(--st-warn-fg); }
.notice-bad  { border-left-color: var(--color-Sell); }

/* =============================================================================
   15. FORMS
   ============================================================================= */

.field { display: block; margin-bottom: var(--sp-4); }
.field-label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--color-SecondaryText);
}
.field-req { color: var(--color-Sell); margin-left: 0.2em; }

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 10px var(--sp-3);
  background: var(--color-Input);
  border: 1px solid var(--color-Line);
  border-radius: var(--r-sm);
  color: var(--color-PrimaryText);
  /* 16px minimum stops iOS zooming the page on focus. */
  font-size: max(16px, var(--fs-body));
  box-shadow: var(--emb-well);
  transition: border-color var(--dur-1) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--glass-stroke-2); }
.input::placeholder, .textarea::placeholder { color: var(--color-DisableText); }
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--sp-6);
  /* Chevron drawn with borders in ::after on the wrapper, not a background
     image: the CSP forbids external assets and data URIs bloat the file. */
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--color-TertiaryText);
  border-bottom: 2px solid var(--color-TertiaryText);
  transform: rotate(45deg);
  pointer-events: none;
}

.input:disabled, .select:disabled, .textarea:disabled {
  color: var(--color-DisableText);
  background: var(--color-Vessel);
  cursor: not-allowed;
}

.field-hint {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-cap);
  color: var(--color-TertiaryText);
}

/* Error state. aria-invalid drives the visuals so the accessible state and the
   painted state cannot disagree. */
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--color-Sell);
  box-shadow: var(--emb-well), 0 0 0 1px var(--color-Sell);
}
.field-error {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--st-bad-fg);
}
.field-error:empty { display: none; }

/* Success/availability state, used by the subdomain live check. */
.input[data-state="ok"] { border-color: var(--color-Buy); }
.field-ok {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--st-ok-fg);
}
.field-ok:empty { display: none; }

/* Input with a fixed suffix, e.g. <sub> . investmentcms.com */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-Line);
  border-radius: var(--r-sm);
  background: var(--color-Input);
  box-shadow: var(--emb-well);
  overflow: hidden;
}
.input-group:focus-within { border-color: var(--ic-accent); }
.input-group .input {
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  min-width: 0;
}
.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  background: var(--color-Vessel);
  border-left: 1px solid var(--color-Line);
  color: var(--color-SecondaryText);
  font-size: var(--fs-cap);
  white-space: nowrap;
}

/* Checkbox / radio rows keep a 44px hit area without shrinking the control. */
.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--sp-3);
  align-items: start;
  min-height: var(--tap);
  padding: var(--sp-2) 0;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ic-accent-solid); }
.check span { font-size: var(--fs-body); color: var(--color-SecondaryText); }

fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-5); min-width: 0; }
legend { padding: 0; font-size: var(--fs-h4); font-weight: 650; margin-bottom: var(--sp-3); }

/* Form-level error summary: focusable, so ui.js can move focus to it. */
.form-error {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--color-Sell);
  border-radius: var(--r-sm);
  background: var(--st-bad-bg);
  color: var(--st-bad-fg);
  font-weight: 600;
}
.form-error:empty { display: none; }

/* Multi-step progress used by checkout. */
.steps { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.step {
  flex: 1;
  padding-top: var(--sp-2);
  border-top: 3px solid var(--color-Line);
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--color-TertiaryText);
}
.step[aria-current="step"] { border-top-color: var(--ic-accent); color: var(--color-PrimaryText); }
.step[data-done="true"] { border-top-color: var(--ic-accent); color: var(--color-SecondaryText); }

/* =============================================================================
   16. MODAL / DIALOG
   Styled for a plain <div role="dialog"> driven by openModal() in ui.js, so
   the same markup works without <dialog> support.
   ============================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(9, 14, 12, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(100%, 560px);
  max-height: calc(100vh - 2 * var(--sp-5));
  overflow-y: auto;
  background: var(--color-CardBg);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--emb-high), var(--elev-2);
  padding: var(--sp-5);
}
.modal-sm { width: min(100%, 420px); }
.modal-lg { width: min(100%, 760px); }
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.modal-head h2 { margin: 0; font-size: var(--fs-h3); }
.modal-close {
  margin-left: auto;
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-Line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--color-SecondaryText);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--color-HoverBg); color: var(--color-PrimaryText); }
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-5);
}
@media (max-width: 479px) {
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

/* ui.js locks the background scroll while a modal is open. */
body.is-modal-open { overflow: hidden; }

/* =============================================================================
   17. TOAST AND LIVE REGION
   ============================================================================= */

.toast-stack {
  position: fixed;
  z-index: 600;
  right: var(--sp-4);
  bottom: var(--sp-4);
  left: var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  pointer-events: none;
}
@media (max-width: 479px) { .toast-stack { align-items: stretch; } }

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  max-width: min(100%, 420px);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--color-Line);
  border-left: 3px solid var(--color-TertiaryText);
  border-radius: var(--r-sm);
  background: var(--color-CardBg);
  color: var(--color-PrimaryText);
  box-shadow: var(--elev-2);
  font-size: var(--fs-body);
  animation: ic-toast-in var(--dur-2) var(--ease);
}
.toast-ok    { border-left-color: var(--color-Buy); }
.toast-error { border-left-color: var(--color-Sell); }
.toast-warn  { border-left-color: var(--st-warn-fg); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--color-TertiaryText);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
}
.toast-close:hover { color: var(--color-PrimaryText); background: var(--color-HoverBg); }
.toast[data-leaving="true"] { animation: ic-toast-out var(--dur-2) var(--ease) forwards; }

@keyframes ic-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ic-toast-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px); }
}

/* =============================================================================
   18. EMPTY STATE, SKELETON, SPINNER
   ============================================================================= */

.empty {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  border: 1px dashed var(--color-Line);
  border-radius: var(--r-lg);
  background: var(--color-SecondaryBg);
}
.empty h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.empty p { color: var(--color-SecondaryText); margin-inline: auto; max-width: 46ch; }
.empty .btn { margin-top: var(--sp-4); }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg,
              var(--skeleton-1) 25%, var(--skeleton-2) 37%, var(--skeleton-1) 63%);
  background-size: 400% 100%;
  animation: ic-shimmer 1.4s ease-in-out infinite;
}
.skeleton-line { height: 0.85em; margin-bottom: var(--sp-2); }
.skeleton-line:last-child { width: 60%; margin-bottom: 0; }
.skeleton-block { height: 120px; }

@keyframes ic-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-Line);
  border-top-color: var(--ic-accent);
  border-radius: 50%;
  animation: ic-spin 0.8s linear infinite;
}
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }

@keyframes ic-spin { to { transform: rotate(360deg); } }

/* A loading indicator that has stopped moving reports the wrong state, so
   these keep animating under reduced motion -- slower, and the skeleton drops
   its travelling highlight for a still tint. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .skeleton { background: var(--skeleton-1); animation: none; }
}

/* =============================================================================
   19. PANEL SHELL (sidebar + content)
   Used by /panel and /admin. Mobile first: the nav is a horizontal scroller
   above the content, and becomes a fixed column at 900px.
   ============================================================================= */

.panel-shell {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
  padding-block: var(--sp-5) var(--sp-8);
}

.panel-nav {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-Line);
}
.panel-nav-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  white-space: nowrap;
  color: var(--color-SecondaryText);
  text-decoration: none;
  font-weight: 500;
}
.panel-nav-item:hover { background: var(--color-HoverBg); color: var(--color-PrimaryText); }
.panel-nav-item[aria-current="page"] {
  background: var(--ic-accent-soft);
  color: var(--color-PrimaryText);
  font-weight: 650;
}
.panel-nav-group {
  padding: var(--sp-4) var(--sp-3) var(--sp-1);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-TertiaryText);
  display: none;
}

.panel-content { min-width: 0; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.panel-head h1 { font-size: var(--fs-h2); }
.panel-section + .panel-section { margin-top: var(--sp-5); }

@media (min-width: 900px) {
  .panel-shell { grid-template-columns: var(--panel-nav-w) minmax(0, 1fr); gap: var(--sp-6); }
  .panel-nav {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-4));
    flex-direction: column;
    overflow: visible;
    padding-bottom: 0;
    border-bottom: 0;
    border-right: 1px solid var(--color-Line);
    padding-right: var(--sp-3);
  }
  .panel-nav-group { display: block; }
}

/* Key/value rows inside a panel card. */
.kv { display: grid; gap: var(--sp-3); }
.kv-row {
  display: grid;
  gap: var(--sp-1) var(--sp-4);
  grid-template-columns: 1fr;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-Line);
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-key { font-size: var(--fs-cap); color: var(--color-TertiaryText); }
.kv-val { overflow-wrap: anywhere; }
@media (min-width: 560px) {
  .kv-row { grid-template-columns: 190px minmax(0, 1fr); align-items: baseline; }
  .kv-key { font-size: var(--fs-body); }
}

/* =============================================================================
   20. DATA TABLE
   Two responsive strategies. Default: the table scrolls inside its own frame,
   so financial columns stay legible and the page never scrolls sideways.
   Opt-in `.data-table-stack`: below 700px each row becomes a card using
   data-label on every cell.
   ============================================================================= */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--color-Line);
  border-radius: var(--r-md);
  background: var(--color-CardBg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body);
}
.data-table caption {
  caption-side: top;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-cap);
  color: var(--color-TertiaryText);
}
.data-table th,
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--color-Line);
  white-space: nowrap;
}
.data-table th {
  font-size: var(--fs-cap);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-TertiaryText);
  background: var(--color-SecondaryBg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--color-HoverBg); }
.data-table .num,
.data-table .col-num { text-align: right; }
.data-table .col-wrap { white-space: normal; min-width: 220px; }

@media (max-width: 699px) {
  /* The header row stays in the accessibility tree (so the header/cell
     association survives) but must not contribute layout width: without
     overflow:hidden its cells lay out at full size inside the 1px box and push
     the row's bounding box past the viewport. Measured at 360px. */
  .data-table-stack thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .data-table-stack thead tr,
  .data-table-stack thead th { max-width: 1px; overflow: hidden; }
  .data-table-stack tbody tr {
    display: block;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--color-Line);
  }
  .data-table-stack tbody tr:last-child { border-bottom: 0; }
  .data-table-stack td {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: var(--sp-3);
    padding: var(--sp-1) 0;
    border-bottom: 0;
    white-space: normal;
  }
  .data-table-stack td::before {
    content: attr(data-label);
    font-size: var(--fs-cap);
    color: var(--color-TertiaryText);
  }
  .data-table-stack td:empty { display: none; }
  .data-table-stack .num,
  .data-table-stack .col-num { text-align: left; }
  .table-wrap:has(.data-table-stack) { overflow-x: visible; }
}

/* =============================================================================
   21. FOOTER
   ============================================================================= */

.site-footer {
  margin-top: auto;
  padding-block: var(--sp-7) var(--sp-6);
  background: var(--color-SecondaryBg);
  border-top: 1px solid var(--color-Line);
  color: var(--color-SecondaryText);
  font-size: var(--fs-cap);
}
.footer-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  margin-bottom: var(--sp-6);
}
.footer-col h2 {
  font-size: var(--fs-cap);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-TertiaryText);
  margin-bottom: var(--sp-3);
  font-weight: 650;
}
.footer-col ul { display: grid; gap: var(--sp-2); }
.footer-col a {
  color: var(--color-SecondaryText);
  text-decoration: none;
  display: inline-block;
  padding: 3px 0;
}
.footer-col a:hover { color: var(--color-PrimaryText); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-Line);
  color: var(--color-TertiaryText);
}

/* Sticky footer without a wrapper element. */
body { display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* =============================================================================
   22. UTILITIES
   ============================================================================= */

.u-center      { text-align: center; }
.u-right       { text-align: right; }
.u-nowrap      { white-space: nowrap; }
.u-break       { overflow-wrap: anywhere; }
.u-measure     { max-width: var(--measure); }
.u-mx-auto     { margin-inline: auto; }
.u-mt-0        { margin-top: 0; }
.u-mt-2        { margin-top: var(--sp-2); }
.u-mt-3        { margin-top: var(--sp-3); }
.u-mt-4        { margin-top: var(--sp-4); }
.u-mt-5        { margin-top: var(--sp-5); }
.u-mt-6        { margin-top: var(--sp-6); }
.u-mb-0        { margin-bottom: 0; }
.u-mb-3        { margin-bottom: var(--sp-3); }
.u-mb-4        { margin-bottom: var(--sp-4); }
.u-mb-5        { margin-bottom: var(--sp-5); }
.u-gain        { color: var(--color-Buy); }
.u-loss        { color: var(--color-Sell); }
.u-accent      { color: var(--ic-accent-text); }
.u-flex-1      { flex: 1; min-width: 0; }
.u-full        { width: 100%; }
[hidden]       { display: none !important; }

@media (max-width: 559px) { .u-hide-sm { display: none !important; } }
@media (min-width: 900px) { .u-hide-lg { display: none !important; } }

/* =============================================================================
   23. PRINT
   An invoice or a site record should print as a document, not as a screenshot
   of a dark interface.
   ============================================================================= */

@media print {
  :root {
    --color-BasicBg: #FFFFFF;
    --color-SecondaryBg: #FFFFFF;
    --color-CardBg: #FFFFFF;
    --color-PrimaryText: #000000;
    --color-SecondaryText: #222222;
    --color-TertiaryText: #444444;
    --color-Line: #CCCCCC;
  }
  body { background: #FFFFFF; color: #000000; }
  .site-header,
  .site-nav,
  .nav-toggle,
  .site-footer,
  .toast-stack,
  .modal-backdrop,
  .skip-link,
  .panel-nav,
  .btn { display: none !important; }
  .hero { background: none; color: #000000; padding-block: var(--sp-4); }
  .hero h1, .hero p, .hero .lead { color: #000000; }
  .card, .feature-card, .pricing-card, .table-wrap, .modal {
    box-shadow: none;
    border: 1px solid #CCCCCC;
    break-inside: avoid;
  }
  .section { padding-block: var(--sp-4); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444444; }
  .data-table th { position: static; background: none; }
}
