/* Nocturne — the Stock Sync design system.
   Tokens and component classes lifted from the design file so the landing
   page, the app and the account pages share one look. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* v2 (2026-10): a neutral near-black ground with surfaces told apart by
     1px borders rather than grey fills, the way Supabase's dashboard reads.
     The purple accent is unchanged in role, lifted slightly in chroma. */
  --color-bg: #111114;
  --color-surface: #18181c;
  --color-surface-2: #1f1f24;
  --color-border: #2a2a31;
  --color-border-strong: #3a3a43;
  --color-text: #ededf0;
  --color-muted: #9b9ba6;
  --color-accent: #8f7cf8; /* review round 7 (Barron): the accent moves to
     the product's blurple — OKLCH hue 289.2, the hue of the app's own Pro
     accent (#9a8fe0, --om-accent-pro) — at the same lightness the steel
     accent held (L 0.660, so the documented ratios survive) and chroma
     in the product blurple's own range (its token sits at C 0.118; the
     accent takes 0.125, from the old steel's 0.030):
     the accent now reads as an accent rather than another neutral. */
  --color-accent-2: #a7a1db; /* the machine-derived stand-in follows: same
     hue, same L 0.734, chroma at the same 2:3 proportion it held */
  --color-divider: var(--color-border);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --color-accent-2-100: #f5f4ff;
  --color-accent-2-200: #e7e5fe;
  --color-accent-2-300: #d2cefd;
  --color-accent-2-400: #b5afe8;
  --color-accent-2-500: #9690c9;
  --color-accent-2-600: #7972a9;
  --color-accent-2-700: #5c5783;
  --color-accent-2-800: #423e5d;
  --color-accent-2-900: #2b293a;

  /* Deck section-divider ground — review round 3: saturation as presence.
     Dividers take a saturated deep indigo (hue 277, the neutral ramp's own
     family; C 0.094 — written when the accent held C 0.030, before the
     round-7 blurple raised it past the ground's) with a lighter bloom and
     a ghost tint of the same hue, while the slide grounds stay
     desaturated. Deck-scale fills only — not interface colors. */
  --color-section: #262a60;
  --color-section-glow: #353b80;
  --color-section-ghost: #4c5397;

  --font-heading: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  /* One radius scale: controls 6px, cards 12px, chips full. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 0 0 1px var(--color-border);
  --shadow-md: 0 0 0 1px var(--color-border), 0 8px 24px rgba(5,5,10,0.45);
  /* Status roles, on the same ramp as the accent */
  --color-ok: #7fd6a2;
  --color-warn: #e3b273;
  --color-bad: #e58c86;

  --shadow-lg: 0 0 0 1px var(--color-border-strong), 0 16px 48px rgba(5,5,10,0.6);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.lighten{mix-blend-mode:lighten;background-color:transparent}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 var(--space-2); text-wrap: balance;
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
/* Rules fade to transparent at both ends instead of stopping cleanly — a
   Nocturne signature. The ramp is 48px an end (one deck baseline unit),
   painted from the same divider token. Freestanding rules fade; box
   outlines, in-control separators, and short accent marks stay solid. */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-body); font-weight: 500;
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  min-height: 36px; padding: 8px 14px;
  background: var(--color-surface-2); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Filled, so the one action that matters on a screen reads as the action.
   The inset highlight gives the fill an edge on a dark ground. */
.btn-primary, a.btn-primary, .nav a.btn-primary {
  color: #fff; background: var(--color-accent-600); border-color: var(--color-accent-500);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 1px 2px rgb(0 0 0 / .4);
}
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent-600) 85%, #fff); border-color: var(--color-accent-400); }
.btn-primary:active:not(:disabled) { background: var(--color-accent-700); }
.btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-surface-2) 70%, var(--color-border-strong)); border-color: color-mix(in srgb, var(--color-border-strong) 60%, var(--color-text)); }
.btn-secondary:active:not(:disabled) { background: var(--color-surface); }
.btn-ghost { color: var(--color-muted); background: transparent; border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover:not(:disabled) { color: var(--color-text); background: var(--color-surface-2); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.input {
  width: 100%; min-height: 38px; padding: 8px 12px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #75757f; }
.input:hover { border-color: color-mix(in srgb, var(--color-border-strong) 55%, var(--color-text)); }
.input:focus, .input:focus-visible { border-color: var(--color-accent); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 25%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface);
  border: 1px solid var(--color-border);
}
/* the border now draws the edge, so the ring shadows only add depth */
.card.elev-sm { box-shadow: none; }
.card.elev-md { box-shadow: 0 8px 24px rgba(5,5,10,0.45); }
.card.elev-lg { box-shadow: 0 16px 48px rgba(5,5,10,0.6); border-color: var(--color-border-strong); }
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 14px; color: var(--color-muted); flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.tag-accent { background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent-300); border-color: color-mix(in srgb, var(--color-accent) 35%, transparent); }
.tag-accent-2 { background: color-mix(in srgb, var(--color-ok) 13%, transparent); color: var(--color-ok); border-color: color-mix(in srgb, var(--color-ok) 30%, transparent); }
.tag-neutral { background: var(--color-surface-2); color: var(--color-muted); border-color: var(--color-border); }
.tag-outline { border-color: color-mix(in srgb, var(--color-warn) 45%, transparent); color: var(--color-warn); background: color-mix(in srgb, var(--color-warn) 10%, transparent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }
.nav a.btn-primary:hover { color: var(--color-bg); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid transparent; /* keeps layout; the row paints the fading rule */
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid transparent;
}
/* Plan comparison — the ticks read best centred under their own heading, and
   the plan columns share the width evenly. Without this, `.table th`'s own
   left-align outranks `.num` and the headings sit adrift of their column. */
.table.compare { table-layout: fixed; }
/* Every cell wraps here. `.table td` keeps cells on one line, which on a phone
   made the plan columns run into each other; wrapping lets the whole matrix
   stay on screen instead of scrolling sideways. */
.table.compare th, .table.compare td { text-align: center; white-space: normal; }
.table.compare th:first-child, .table.compare td:first-child { text-align: left; }
.table.compare th:first-child { width: 40%; }
/* On a phone the feature names take less of the width, so "Unlimited" still
   fits in a plan column. */
@media (max-width: 640px) {
  .table.compare { font-size: 12.5px; }
  .table.compare th:first-child { width: 28%; }
}

/* Row rules as row-level strips so the end-fade spans the row, not each cell. */
.table thead tr {
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr {
  background: linear-gradient(to right,
    transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
    color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr:hover {
  /* the hover tint layers over the row rule, which keeps painting */
  background:
    linear-gradient(color-mix(in srgb, var(--color-text) 4%, transparent),
                    color-mix(in srgb, var(--color-text) 4%, transparent)) no-repeat 0 0 / 100% 100%,
    linear-gradient(to right,
      transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
      color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }



/* — app additions — built from the same tokens — */
[hidden] { display: none !important; }
/* Checkboxes borrow the radio's layout but keep a square mark, so they do
   not read as another radio in the same row. */
.check .dot { border-radius: var(--radius-sm); }
.check input:checked + .dot { box-shadow: none; position: relative; }
.check input:checked + .dot::after {
  content: ""; position: absolute; inset: 0;
  background: var(--color-bg);
  clip-path: polygon(13% 52%, 38% 76%, 87% 24%, 87% 40%, 38% 90%, 13% 66%);
}
.page { max-width: 1200px; margin: 0 auto; width: 100%; padding: 0 24px; }
.shell { min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(900px 420px at 80% -8%, color-mix(in srgb, var(--color-accent) 11%, transparent), transparent 70%), var(--color-bg); }
.topbar { position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent); backdrop-filter: blur(12px); }
.topbar .nav { max-width: 1200px; margin: 0 auto; width: 100%; padding: 14px 24px; flex-wrap: wrap; }
.topbar-rule { height: 1px; background: linear-gradient(to right, transparent,
  var(--color-divider) 48px, var(--color-divider) calc(100% - 48px), transparent); }
.mark { width: 20px; height: 20px; border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1.5px var(--color-accent); display: grid; place-items: center; flex: none; }
.mark span { width: 6px; height: 6px; border-radius: 2px; background: var(--color-accent); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--color-muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--color-accent-300); }
.note { padding: 10px 14px; border-radius: var(--radius-md); font-size: 13.5px; border: 1px solid; }
.note-good { border-color: var(--color-ok); color: var(--color-ok); background: color-mix(in srgb, var(--color-ok) 12%, transparent); }
.note-warn { border-color: var(--color-warn); color: var(--color-warn); background: color-mix(in srgb, var(--color-warn) 12%, transparent); }
.note-bad  { border-color: var(--color-bad);  color: var(--color-bad);  background: color-mix(in srgb, var(--color-bad) 12%, transparent); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px dashed var(--color-border-strong); background: var(--color-surface);
  border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease; }
.drop:hover, .drop.over { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface)); }
.drop-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 6px;
  border-radius: 10px; color: var(--color-accent-300);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent); }
.drop-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop input[type=file] { display: none; }
.chip { border: 1px solid var(--color-border); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 500; background: var(--color-surface); color: var(--color-muted);
  cursor: pointer; font-family: inherit; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.chip:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); color: var(--color-accent-300);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
.tablewrap { overflow-x: auto; }
.table td, .table th { white-space: nowrap; }
.table td.wrap { white-space: normal; }
/* A row with no product chosen is unticked, and unticking used to fade the
   whole row — including the cell holding the product picker, so the control
   you need in order to fix the row was the hardest thing on it to read. The
   "no match" tag and the empty checkbox say the row is not going anywhere;
   nothing needs to be faded to repeat it. */
.input.mini { width: 78px; text-align: right; }
.input.mult { width: 70px; text-align: right; }
select.input { min-width: 240px; }

/* -- searchable product picker ------------------------------------------- */
.pick-wrap { position: relative; min-width: 200px; }
.pick-input { width: 100%; box-sizing: border-box; }
.pick-list {
  position: fixed; z-index: 9999;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); padding: 4px;
  box-shadow: var(--shadow-lg);           /* 1px solid ring + deep shadow */
  max-height: 260px; overflow-y: auto; font-size: 13px;
}
.pick-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: pointer; border-radius: var(--radius-sm);
  line-height: 1.3;
}
.pick-opt:last-child { border-bottom: none; }
.pick-opt:hover, .pick-opt[aria-selected="true"] { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.pick-opt.skip-opt { color: var(--color-muted); font-style: italic; }
.pick-opt .pick-score {
  flex-shrink: 0; font-size: 10px; font-weight: 600; letter-spacing: .04em;
  color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  padding: 1px 5px; border-radius: 20px; white-space: nowrap;
}
.pick-sep {
  padding: 4px 10px 2px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text); background: var(--color-neutral-900);
  position: sticky; top: 0;
}

/* -- cost row on invoice review ------------------------------------------ */
.cost-row { display: flex; align-items: flex-end; gap: 12px 26px; flex-wrap: wrap; }
.cost-row .cost-currency {
  width: 96px; height: 38px; font: inherit; font-size: 14px; padding: 6px 28px 6px 10px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27%3E%3Cpath d=%27M3 4.5 6 7.5 9 4.5%27 fill=%27none%27 stroke=%27%239b9ba6%27 stroke-width=%271.5%27/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
  background-color: var(--color-bg); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); color: var(--color-text);
}
.cost-row .cost-currency:focus { border-color: var(--color-accent); outline: none; }

/* ══════════════════════════════════════════════════════════════════════════
   Marketing additions — brand lockup, customer logo marquee, reviews, footer.
   Same tokens as everything above; no JavaScript needed for any of it.
   ══════════════════════════════════════════════════════════════════════ */

/* — brand lockup — the wordmark SVG stands in for the mark + text pair.
   Height drives the size; the file is drawn light-on-dark already. */
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; margin-right: 8px; }
.brand img { height: 30px; width: auto; }
.brand--lg img { height: 38px; }
.brand--sm img { height: 24px; }

/* — logo marquee — one track, duplicated in the markup, translated by half
   its own width. Because the second half is an exact copy, the reset at 50%
   lands on an identical frame and the loop is seamless at any width.
   Hovering pauses it, and reduced motion stops it outright. */
.logo-strip {
  position: relative; overflow: hidden;
  /* the ends fade into the page rather than cutting off mid-logo */
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.logo-track {
  display: flex; align-items: center; gap: 54px; width: max-content;
  animation: logo-scroll 42s linear infinite;
}
.logo-strip:hover .logo-track, .logo-strip:focus-within .logo-track { animation-play-state: paused; }
@keyframes logo-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; }
  .logo-strip { mask-image: none; overflow-x: auto; }
}
/* Each customer mark has a light-ink twin (*-logo-light.svg) so it sits
   straight on the dark page — no plate behind it. Sized by height, so marks
   of different widths still read as one row. */
.logo-plate {
  flex: none; display: grid; place-items: center; padding: 0 10px;
  opacity: .85; transition: opacity .2s, transform .2s;
}
.logo-plate:hover { opacity: 1; transform: translateY(-2px); }
.logo-plate img { height: 56px; width: auto; max-width: 280px; }

/* — reviews — */
.quote { display: flex; flex-direction: column; gap: 14px; }
.quote blockquote { margin: 0; font-size: 15px; line-height: 1.65; color: var(--color-neutral-200); }
.quote-logo { align-self: flex-start; height: 40px; width: auto; max-width: 210px; opacity: .95; }
.quote-foot { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--color-accent-100);
  background: var(--color-accent-800); box-shadow: inset 0 0 0 1px var(--color-accent-600);
}
.stars { display: inline-flex; gap: 2px; color: var(--color-warn); font-size: 13px; letter-spacing: 1px; }

/* — stat band — */
.stat-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 1px; background: var(--color-border);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
}
.stat-band > div {
  background: var(--color-surface); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-band b { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* — footer — */
.site-footer { margin-top: auto; background: transparent; border-top: 1px solid var(--color-border); }
.footer-grid {
  display: grid; gap: 32px 40px; padding-block: 48px 32px;
  /* min(100%, …) keeps a column from ever being wider than the page — without
     it a 220px + 140px pair overflows a 342px phone. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(120px, 1fr)); }
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h3 {
  margin: 0 0 2px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--color-neutral-500);
}
.footer-col a { color: var(--color-neutral-300); text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bar {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  align-items: center; padding-block: 18px 26px; font-size: 13px; color: var(--color-neutral-500);
}
.footer-bar a { color: inherit; text-decoration: none; }
.footer-bar a:hover { color: var(--color-accent); }

/* — sign-up steps — */
.steps { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--color-neutral-500); }
.steps span { display: inline-flex; align-items: center; gap: 7px; }
.steps i {
  font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; box-shadow: inset 0 0 0 1px var(--color-neutral-700);
}
.steps .on { color: var(--color-text); }
.steps .on i { background: var(--color-accent); color: var(--color-bg); box-shadow: none; }
.steps .rule { flex: 1; height: 1px; background: var(--color-divider); min-width: 14px; }

/* — plan picker (sign-up) — */
.plan-pick { display: grid; gap: 8px; }
.plan-opt {
  display: flex; align-items: baseline; gap: 10px; cursor: pointer;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-divider);
}
.plan-opt:hover { box-shadow: inset 0 0 0 1px var(--color-neutral-600); }
.plan-opt input { accent-color: var(--color-accent); margin: 0; }
.plan-opt:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.plan-opt .price { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--color-neutral-300); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════════════════
   Signed-in layout — the navigation moves from a top bar to a left rail once
   there is an app to navigate. The marketing pages keep the top bar.
   ══════════════════════════════════════════════════════════════════════ */
.shell--app { flex-direction: row; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidenav {
  flex: none; width: 232px; align-self: stretch;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 16px;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
}
.sidenav .brand { padding: 6px 8px 0; margin-right: 0; }
.sidenav-links { display: flex; flex-direction: column; gap: 2px; }
.sidenav-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--color-neutral-300); text-decoration: none; font-size: 14px;
}
.sidenav-links a:hover { background: var(--color-surface); color: var(--color-text); }
.sidenav-links a[aria-current="page"] {
  background: var(--color-surface-2); color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.sidenav-links a[aria-current="page"] svg { color: var(--color-accent); }
.sidenav-links a { transition: background-color .15s ease, color .15s ease; font-weight: 500; }
.sidenav-links svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidenav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.sidenav-foot .btn-logout { justify-content: flex-start; gap: 10px; color: var(--color-muted); padding: 9px 12px; border: 0; margin: 0; background: transparent; }
.sidenav-foot .btn-logout:hover { color: var(--color-text); background: var(--color-surface); }
.sidenav-foot .btn-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* Phones and small tablets: a slim top bar (brand + log out) and the three
   sections as a bottom tab bar, where a thumb reaches them. The bar sits
   above the iPhone home indicator via the safe-area inset. */
@media (max-width: 880px) {
  .shell--app { flex-direction: column; }
  .sidenav {
    width: auto; height: auto; position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    /* Solid, not blurred: backdrop-filter would make this bar the containing
       block for the position:fixed tab bar inside it, pinning the tabs here. */
    background: color-mix(in srgb, var(--color-bg) 96%, #000);
    border-right: 0; border-bottom: 1px solid var(--color-divider); border-image: none;
  }
  .sidenav .brand { padding: 0; }
  .sidenav .brand img { height: 26px; }
  .sidenav-foot { margin: 0; }
  .sidenav-foot .btn-logout { min-height: 44px; padding: 0 10px; }
  .sidenav-links {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--color-divider);
  }
  .sidenav-links a {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 52px;
    padding: 4px; font-size: 11px; font-weight: 500; letter-spacing: .01em;
  }
  .sidenav-links a:hover { background: none; }
  .sidenav-links a[aria-current="page"] { background: none; box-shadow: none; color: var(--color-accent); }
  .sidenav-links svg { width: 22px; height: 22px; }
  /* room for the tab bar so the footer and the Apply button are never under it */
  .app-main { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .sidenav-foot .btn-logout span { display: none; }   /* icon only; aria-label carries the name */
}

/* A stat band with an odd number of tiles leaves a filled-looking gap when it
   wraps to two columns, so on a phone it becomes one column. */
@media (max-width: 640px) { .stat-band { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════════════════════
   Responsive — phone (≤ 640px) and tablet (641–880px).
   Everything above is mobile-first where the layout allows; these rules
   patch inline-style padding and elements that need a collapsed state.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Landing nav ────────────────────────────────────────────────────────
   Hide the middle links on small screens so the bar stays one line.
   Brand + Log in + Create account always show. */
@media (max-width: 720px) {
  .topbar .nav > a:not(.brand):not(.btn) { display: none; }
  .topbar .nav { gap: 4px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; flex-wrap: nowrap; }
  .topbar .brand img { height: 26px; }
  .topbar .btn { min-height: 40px; padding: 8px 14px; white-space: nowrap; }
  .topbar .btn-secondary { border-color: transparent; background: transparent; }
}

/* ── Section vertical rhythm ────────────────────────────────────────────
   Override the inline padding-block values for a tighter rhythm on phones.
   !important is intentional — these win over the inline style. */
@media (max-width: 640px) {
  #top      { padding-block: 52px 36px !important; }
  #how, #reviews, #pricing, #security, #faq { padding-block: 52px !important; }
  /* logo strip section targets by its aria attribute */
  [aria-labelledby="trusted-by"] { padding-block: 4px 44px !important; }
}

/* ── Hero trust badges ──────────────────────────────────────────────────
   Tighten the gap between the ✓ items so they fit on one line longer. */
@media (max-width: 520px) {
  #top .row.small.muted { gap: 14px; font-size: 12px; }
}

/* ── Hero demo card ─────────────────────────────────────────────────────
   The four-column invoice grid is tight at 360px. Collapse Qty + Stock
   columns to narrower widths and let text truncate. */
@media (max-width: 480px) {
  #top .card .row[style*="justify-content:space-between"] { font-size: 11px; }
  #top [style*="grid-template-columns:1.1fr 42px 1.2fr 74px"] {
    grid-template-columns: 1fr 38px 1fr 60px !important;
    font-size: 9px !important;
  }
  #top .demo-row { grid-template-columns: 1fr 38px 1fr 60px !important; font-size: 12px !important; }
}

/* ── Reviews section header ─────────────────────────────────────────────
   Stack the star rating under the heading on narrow screens. */
@media (max-width: 600px) {
  #reviews > .row:first-of-type { flex-direction: column; align-items: flex-start; }
}

/* ── Logo strip ─────────────────────────────────────────────────────────
   Slightly smaller logos on phones so more fit in the viewport. */
@media (max-width: 640px) {
  .logo-plate img { height: 42px; }
  .logo-track { gap: 36px; }
}

/* ── Pricing: tighten plan card padding on phones ───────────────────── */
@media (max-width: 480px) {
  #pricing .card { padding: 20px !important; }
  #pricing [style*="font-size:44px"] { font-size: 36px !important; }
}

/* ── Compare table on very small screens ────────────────────────────── */
@media (max-width: 400px) {
  .table.compare { font-size: 11px; }
  .table.compare td, .table.compare th { padding: 5px 4px; }
}

/* ── App: invoice meta row ──────────────────────────────────────────────
   The supplier / invoice / date / lines / filter row wraps to two lines
   on tablets, which is fine. On phones it gets an overflow-x scroll so
   all fields stay reachable in a single row. */
@media (max-width: 560px) {
  .meta-row { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px !important; }
  .meta-row > .field { grid-column: 1 / -1; margin: 0; }
  .meta-row .input { min-width: 0 !important; }
  .meta-row b { overflow-wrap: anywhere; }
}

/* ── App: invoice table ────────────────────────────────────────────── */
.qty-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.qty-cell .of { font-variant-numeric: tabular-nums; }
.td-sub { font-variant-numeric: tabular-nums; color: var(--color-muted); }
/* A line not in this delivery fades, but its inputs stay at full strength:
   typing a quantity is how it is brought back in. */
.invoice-table tr.skip :is(.td-name, .td-sub, .td-units, .td-now, .td-after, .td-cost) { color: var(--color-muted); }
.invoice-table tr.skip .td-conf .tag { opacity: .6; }

/* ── App: invoice table — tablet and phone: one card per line ──────────
   Every field stays reachable; nothing is hidden at narrow widths, because
   a hidden pack multiplier still changes the stock that gets written.
   Six columns: the money row splits 2/2/2, the stock row 2/2/1/1. */
@media (max-width: 1180px) {
  .invoice-wrap { overflow-x: visible; }
  .invoice-table { display: block; }
  .invoice-table thead { display: none; }
  .invoice-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .invoice-table tbody tr {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 14px; gap: 12px 10px;
    background: color-mix(in srgb, var(--color-surface) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
    border-radius: var(--radius-lg);
  }
  .invoice-table td { white-space: normal !important; text-align: left; padding: 0; border: 0; min-width: 0; }
  .invoice-table .td-conf  { grid-column: 1 / -1; grid-row: 1; }
  .invoice-table .td-name  { grid-column: 1 / -1; grid-row: 2; max-width: none !important; margin-top: -4px; }
  .invoice-table .td-name .line-name {
    font-size: 15px; line-height: 1.4;
    white-space: normal; overflow: visible; text-overflow: clip;
    overflow-wrap: anywhere;   /* long unbroken part codes break rather than overflow */
  }
  .invoice-table .td-pick  { grid-column: 1 / -1; grid-row: 3; }
  .invoice-table .td-pick .pick-wrap { min-width: 0; width: 100%; }
  .invoice-table .td-qty   { grid-column: 1 / 3; grid-row: 4; }
  .invoice-table .td-sub   { grid-column: 3 / 5; grid-row: 4; }
  .invoice-table .td-cost  { grid-column: 5 / 7; grid-row: 4; color: var(--color-accent); }
  .invoice-table .td-mult  { grid-column: 1 / 3; grid-row: 5; }
  .invoice-table .td-units { grid-column: 3 / 5; grid-row: 5; }
  .invoice-table .td-now   { grid-column: 5; grid-row: 5; color: var(--color-muted); }
  .invoice-table .td-after { grid-column: 6; grid-row: 5; }
  .invoice-table :is(.td-qty, .td-sub, .td-cost, .td-mult, .td-units, .td-now, .td-after) {
    display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; font-size: 15px;
  }
  .invoice-table :is(.td-qty, .td-sub, .td-cost, .td-mult, .td-units, .td-now, .td-after)::before {
    font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  }
  .invoice-table .td-qty::before   { content: "Arrived"; }
  .invoice-table .td-sub::before   { content: "Subtotal"; }
  .invoice-table .td-cost::before  { content: "Cost"; }
  .invoice-table .td-mult::before  { content: "Per unit ×"; }
  .invoice-table .td-units::before { content: "Units"; }
  .invoice-table .td-now::before   { content: "Now"; }
  .invoice-table .td-after::before { content: "After"; }
  /* the row 5 divider: stock figures are read, not typed */
  .invoice-table :is(.td-mult, .td-units, .td-now, .td-after) { padding-top: 12px; border-top: 1px solid var(--color-divider); }
  .invoice-table .input.mini, .invoice-table .input.mult { width: 100%; max-width: 88px; min-height: 44px; text-align: left; }
  .qty-cell { flex-wrap: wrap; }
}

/* ── App: action bar ────────────────────────────────────────────────────
   Stack the radios and buttons vertically on phones. */
@media (max-width: 640px) {
  .actions-row { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .actions-row .btn  { text-align: center; }
  .actions-row label { font-size: 14px; }
}

/* ── Account: connect row ───────────────────────────────────────────────
   On narrow screens the URL input + button overflow; stack them. */
@media (max-width: 520px) {
  #connect-row { flex-direction: column; }
  #connect-row .input { min-width: 0; width: 100%; }
  #connect, #save { width: 100%; justify-content: center; }
}

/* ── Login / signup: form padding ───────────────────────────────────────
   Reduce outer breathing room so the card doesn't feel cramped. */
@media (max-width: 480px) {
  main[style*="padding-block:72px"] { padding-block: 40px !important; }
}

/* ── Forms on touch screens ─────────────────────────────────────────────
   iOS Safari zooms the page into any field under 16px and does not zoom
   back out, which is what made the invoice screen look broken on iPhone. */
@media (max-width: 880px) {
  .input, select, .cost-row .cost-currency { font-size: 16px; }
  .input { min-height: 44px; }
}
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.site-footer > .topbar-rule { display: none; }   /* the footer's own border draws the line */

/* ══════════════════════════════════════════════════════════════════════════
   v3 "life" layer (2026-11). The same idea as the portfolio: slow colour
   glows behind everything, hairline gradient borders on surfaces, a
   violet → sky gradient for the one thing to press. Overrides only, so the
   components above keep their structure.
   ══════════════════════════════════════════════════════════════════════ */
:root {
  --color-bg: #0b0b10;
  --color-surface: #13131a;
  --color-surface-2: #1a1a23;
  --grad: linear-gradient(100deg, #b19bff 0%, #8f7cf8 40%, #38bdf8 100%);
  --grad-soft: linear-gradient(140deg, rgba(143, 124, 248, .45), rgba(150, 160, 200, .10) 38%,
               rgba(150, 160, 200, .08) 62%, rgba(56, 189, 248, .38));
  --glow: 0 10px 34px -12px rgba(143, 124, 248, .65);
}
body { background:
  radial-gradient(1100px 620px at 88% -10%, rgba(143, 124, 248, .16), transparent 70%),
  radial-gradient(900px 560px at -10% 22%, rgba(56, 189, 248, .07), transparent 70%),
  radial-gradient(1000px 700px at 50% 110%, rgba(127, 214, 162, .05), transparent 70%),
  var(--color-bg); background-attachment: fixed; }

/* Surfaces: a gradient hairline instead of a flat grey border. */
.card, .dialog, .tablewrap.framed { border: 1px solid transparent;
  background: linear-gradient(var(--color-surface), var(--color-surface)) padding-box, var(--grad-soft) border-box;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 30px 60px -40px rgba(0, 0, 0, .8); }
.card.elev-lg, .card.elev-md { box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 30px 70px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(143, 124, 248, .06); }

/* The primary action. */
.btn { transition: filter .15s, box-shadow .2s, background-color .15s, border-color .15s, transform .1s; }
.btn-primary, a.btn-primary, .nav a.btn-primary { background: var(--grad); border-color: transparent; color: #0b0b16;
  font-weight: 600; box-shadow: var(--glow); }
.btn-primary:hover:not(:disabled), .nav a.btn-primary:hover { background: var(--grad); filter: brightness(1.1);
  border-color: transparent; box-shadow: 0 12px 40px -10px rgba(56, 189, 248, .6); }
.btn-primary:active:not(:disabled) { background: var(--grad); transform: translateY(1px); }
.btn-primary:disabled { filter: saturate(.35); box-shadow: none; }
.btn-secondary { background: color-mix(in srgb, var(--color-surface-2) 80%, transparent); backdrop-filter: blur(6px); }

/* Type: headings get a soft vertical fade, eyebrows the brand gradient. */
h1 { background: linear-gradient(180deg, #ffffff 35%, #b9b4dc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow, .card-kicker { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block; font-weight: 600; }
.tag-accent { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }

/* Marketing top bar: glass, with the gradient rule under it. */
.topbar { background: color-mix(in srgb, var(--color-bg) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-rule { background: linear-gradient(90deg, transparent, rgba(143, 124, 248, .45) 30%, rgba(56, 189, 248, .4) 70%, transparent); }
/* Sections on the landing page are divided by a glowing line, not a grey rule. */
section.page + section.page { position: relative; }
section.page + section.page::before { content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(143, 124, 248, .3) 30%, rgba(56, 189, 248, .3) 70%, transparent); }
/* Landing hero: an aurora behind it. */
#top { position: relative; isolation: isolate; }
#top::after { content: ""; position: absolute; z-index: -1; inset: 0 0 0 25%; pointer-events: none; filter: blur(80px); opacity: .7;
  background: radial-gradient(40% 45% at 60% 40%, rgba(143, 124, 248, .35), transparent 70%),
              radial-gradient(35% 40% at 85% 70%, rgba(56, 189, 248, .25), transparent 70%);
  animation: ss-drift 22s ease-in-out infinite alternate; }
@keyframes ss-drift { to { transform: translate(-6%, 5%) scale(1.08); } }

/* Signed-in rail: glass, and the current page lit with the gradient. */
.sidenav { background: color-mix(in srgb, var(--color-bg) 65%, transparent); backdrop-filter: blur(12px);
  border-right: 0; border-image: linear-gradient(180deg, rgba(143, 124, 248, .35), rgba(150, 160, 200, .08) 40%, rgba(56, 189, 248, .2)) 1;
  border-right: 1px solid; }
.sidenav-links a[aria-current="page"] { position: relative;
  background: linear-gradient(90deg, rgba(143, 124, 248, .16), rgba(143, 124, 248, .03)); box-shadow: inset 0 0 0 1px rgba(143, 124, 248, .18); }
.sidenav-links a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px rgba(143, 124, 248, .8); }
@media (max-width: 880px) {
  .sidenav { backdrop-filter: none; border-image: none; border-right: 0; }
  .sidenav-links { grid-template-columns: repeat(4, 1fr); }
  .sidenav-links a[aria-current="page"] { background: none; box-shadow: none; }
  .sidenav-links a[aria-current="page"]::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 2px; border-radius: 0 0 2px 2px; }
}

/* Upload zone. */
.drop { border: 1.5px dashed rgba(143, 124, 248, .35); background:
  radial-gradient(60% 120% at 50% 0%, rgba(143, 124, 248, .10), transparent 70%), var(--color-surface);
  transition: border-color .2s, box-shadow .2s, background-color .2s; }
.drop:hover, .drop.over { border-color: rgba(56, 189, 248, .7); box-shadow: 0 0 0 4px rgba(143, 124, 248, .08), 0 20px 60px -30px rgba(143, 124, 248, .6); }
.drop-icon { background: var(--grad); color: #0b0b16; border: 0; box-shadow: var(--glow); border-radius: 12px; }

/* Tables. */
.table thead tr { background: color-mix(in srgb, var(--color-surface-2) 70%, transparent); }
.table tbody tr:hover { background: rgba(143, 124, 248, .06); }
.input:focus, .input:focus-visible { border-color: rgba(143, 124, 248, .7); box-shadow: 0 0 0 3px rgba(143, 124, 248, .18); }

/* Content rises in once on load. "backwards", not "both": a transform kept after the animation makes this element the containing block for position:fixed children, which threw the product picker off. */
@media (prefers-reduced-motion: no-preference) {
  main.page > *, section#top > * { animation: ss-rise .5s cubic-bezier(.2, .7, .2, 1) backwards; }
  main.page > :nth-child(2) { animation-delay: .06s; } main.page > :nth-child(3) { animation-delay: .12s; }
  main.page > :nth-child(4) { animation-delay: .18s; } main.page > :nth-child(n+5) { animation-delay: .24s; }
}
@keyframes ss-rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { #top::after { animation: none; } }

/* ── Reports ───────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; border-radius: var(--radius-lg); gap: 6px; }
.kpi span { font-size: 12px; color: var(--color-muted); letter-spacing: .02em; }
.kpi b { white-space: nowrap; min-width: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { color: var(--color-muted); font-size: 12.5px; }
.kpi.hot b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.report-tabs button { display: inline-flex; gap: 8px; align-items: center; min-height: 36px; padding: 0 14px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-muted);
  font: 500 13px var(--font-body); }
.report-tabs button:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.report-tabs button[aria-selected="true"] { color: var(--color-text); border-color: rgba(143, 124, 248, .6);
  background: rgba(143, 124, 248, .12); }
.report-tabs .n { font-variant-numeric: tabular-nums; color: var(--color-muted); font-size: 12px; }
.spark { display: block; width: 84px; height: 22px; }
.spark path { fill: none; stroke: #8f7cf8; stroke-width: 1.5; stroke-linejoin: round; }
.spark path.area { fill: rgba(143, 124, 248, .15); stroke: none; }
.cover-bar { display: inline-block; width: 64px; height: 5px; border-radius: 3px; background: var(--color-surface-2);
  vertical-align: middle; margin-right: 8px; overflow: hidden; }
.cover-bar i { display: block; height: 100%; border-radius: 3px; }
.report-table td.name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.report-table th[data-sort] { cursor: pointer; user-select: none; }
.report-table th[data-sort]:hover { color: var(--color-text); }
.report-table th[aria-sort] { color: var(--color-text); }
.skeleton { border-radius: var(--radius-lg); min-height: 92px; background: linear-gradient(90deg, var(--color-surface) 0%, var(--color-surface-2) 50%, var(--color-surface) 100%);
  background-size: 200% 100%; animation: ss-shimmer 1.3s linear infinite; }
@keyframes ss-shimmer { to { background-position: -200% 0; } }
.tag-bad { background: color-mix(in srgb, var(--color-bad) 13%, transparent); color: var(--color-bad); border-color: color-mix(in srgb, var(--color-bad) 35%, transparent); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px; margin-top: 18px; }
.flow .card { padding: 18px 20px; gap: 6px; border-radius: var(--radius-lg); }
.flow i { font: 600 12px/1 var(--font-body); font-style: normal; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(143, 124, 248, .15); color: var(--color-accent-300); margin-bottom: 4px; }
.flow b { font-weight: 600; font-size: 15px; }
.flow-link { text-decoration: none; color: var(--color-text); background:
  linear-gradient(140deg, rgba(143, 124, 248, .14), rgba(56, 189, 248, .06)) padding-box, var(--grad-soft) border-box; }
.flow-link:hover b { color: #fff; } .flow-link:hover { box-shadow: var(--glow); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
@media (max-width: 640px) { .kpi { padding: 14px 16px; } .kpi b { font-size: 21px; } }
/* Product picker: long names wrap instead of running out of the list; the current pick is marked. */
.pick-opt span:last-child { white-space: normal; overflow-wrap: anywhere; }
.pick-opt[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--color-accent); }
.pick-list { background: color-mix(in srgb, var(--color-surface-2) 96%, #000); border-color: rgba(143, 124, 248, .35);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(143, 124, 248, .08); }
/* Part deliveries: where each invoice line stands. */
.note-info { border-color: rgba(143, 124, 248, .45); color: var(--color-accent-200);
  background: linear-gradient(90deg, rgba(143, 124, 248, .14), rgba(56, 189, 248, .05)); }
.rcv { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-top: 4px; font-size: 11.5px; line-height: 1.3; white-space: nowrap; }
.rcv:empty { display: none; }
.rcv-done { color: var(--color-ok); }
.rcv-part { color: var(--color-warn); }
.rcv-new { color: var(--color-muted); }
.rcv-over { color: var(--color-bad); }
.invoice-table tr.over .qty { border-color: color-mix(in srgb, var(--color-bad) 70%, transparent); }
@media (max-width: 880px) { .rcv { align-items: flex-start; } }
/* Reports table on tablets and phones: the product name stays frozen on the
   left while the figures scroll; the sparkline and stock bar go, the name
   wraps, and cells tighten so a tablet shows the whole row. */
.report-table th:first-child, .report-table td:first-child { position: sticky; left: 0; z-index: 1;
  background: var(--color-surface); box-shadow: 1px 0 0 var(--color-border); }
.report-table thead th:first-child { background: color-mix(in srgb, var(--color-surface-2) 70%, var(--color-surface)); z-index: 2; }
.report-table tbody tr:hover td:first-child { background: color-mix(in srgb, #8f7cf8 6%, var(--color-surface)); }
@media (max-width: 1420px) {
  .report-table .col-week, .report-table .cover-bar { display: none; }
  .report-table td.name { white-space: normal; min-width: 150px; max-width: 190px; line-height: 1.3; }
  .report-table th, .report-table td { padding: 8px 7px; }
  .report-table th { letter-spacing: .04em; white-space: normal; vertical-align: bottom; line-height: 1.25; }
  .report-table td .td-sub { white-space: normal; max-width: 92px; }
  .report-table .tag { padding-inline: 7px; font-size: 11.5px; }
}
@media (max-width: 640px) {
  .report-table td.name { min-width: 128px; max-width: 128px; font-size: 13px; }
  .report-table td { font-size: 13px; }
}
/* KPI tiles always fill their rows: 5 across, 3 + 2 on tablets, 2 + 2 + 1 on phones. */
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1099px) {
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis > :nth-child(-n+3) { grid-column: span 2; }
  .kpis > :nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > * { grid-column: auto !important; }
  .kpis > :last-child { grid-column: span 2 !important; }
}
