/* ============================================================================
   BAYTON DESIGN LANGUAGE - STYLES
   The canonical self-contained stylesheet: font imports, tokens, and the
   component layer. This is the public CSS entrypoint for tagged releases.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@500;600;700;800&family=Open+Sans:wght@400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0");

/* TOKENS */
/* ---- tokens (inlined) ---- */
/* ============================================================================
   BAYTON DESIGN LANGUAGE - TOKENS
   Single source of truth for colour, type, space, radius, motion.

   Reconciled from:
     - gen.bayton.org hub  (warm dark, Raleway display, ghost numerals)
     - KAG/WAG/DAG/CAG Studio  (studio.css: semantic accents, status, fields)
     - bayton.org OG 11ty  (Open Sans body, brand accent palette, light mode)

   Themes are switched by `data-theme` on <html>:
     (none) | "dark"  -> warm dark            (canonical dark)
     "light-cool"     -> neutral light        (CANONICAL light - locked)
     "light-warm"     -> warm light           (reference only, kept for future)
   ========================================================================== */

:root,
[data-theme="dark"] {
  /* - neutrals: warm dark - */
  --canvas:    #131110;
  --canvas-2:  #1a1715;
  --surface:   #201c19;
  --surface-2: #2a2521;
  --line:      rgba(245, 239, 232, 0.10);
  --line-2:    rgba(245, 239, 232, 0.18);
  --ink:       #f5efe8;
  --ink-dim:   #aba49b;
  --ink-faint: #6f685f;

  /* - accent: bayton orange (constant across every theme) - */
  --accent:      #ff4500;
  --accent-2:    #ff6a33;
  --accent-lo:   #c0360a;
  --accent-soft: rgba(255, 69, 0, 0.13);
  --accent-line: rgba(255, 69, 0, 0.40);

  /* - bayton accent palette - ONE collapsed tier ---------------------------
     The real bayton.org + sysapps values, used for BOTH status and callouts /
     contrast (no separate "soft status" set). Semantics:
       info  -> --blue    success -> --green
       error -> --red     warn / alert -> --accent (orange, per 11ty callout-orange)
     --blood is the deep pressed/secondary orange. */
  --blue:  #0283bd;
  --green: #15B007;
  --red:   #c30000;
  --blood: #ce3800;
  /* status aliases so component CSS can read intent, not colour */
  --ok:   var(--green);
  --err:  var(--red);
  --warn: var(--accent);
  --info: var(--blue);

  /* signature ambient glow behind hero / panels */
  --glow: rgba(255, 69, 0, 0.11);

  /* - type - */
  --display: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ui: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  /* type scale (display-led, fluid) */
  --fs-display: clamp(2.6rem, 6vw, 4.2rem);
  --fs-h1: clamp(2rem, 4vw, 3rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.3rem);
  --fs-h3: 1.25rem;
  --fs-lede: clamp(1.05rem, 1.5vw, 1.2rem);
  --fs-body: 1.0625rem;   /* 17px */
  --fs-sm: 0.92rem;
  --fs-xs: 0.78rem;
  --fs-kicker: 0.72rem;

  /* - space scale - */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  /* - radius - */
  --r-xs: 5px;
  --r-sm: 9px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* - motion - */
  --t-fast: 150ms;
  --t-base: 240ms;
  --t-slow: 420ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* - layout - */
  --maxw: 1060px;        /* content container max width */
  --navh: 66px;
  --gutter: 1.6rem;      /* container side padding (desktop) */
  --gutter-sm: 1.1rem;   /* container side padding (phones, <= --bp-sm) */

  /* - breakpoints - THE responsive standard -------------------------------
     One scale for every project. @media can't read custom properties, so use
     the literal px in `@media (max-width: ...)` - these tokens are the reference
     (and usable in JS / container queries). Intents:
       sm  phones          - single column, compact gutters
       md  tablet portrait - tables collapse to cards, 2-col forms become 1-col
       lg  tablet landscape - 3-col grids become 2, sidebars stack
       xl  desktop                                                          */
  --bp-sm: 600px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  color-scheme: dark;
}

/* ---- LIGHT · WARM (REFERENCE ONLY - not canonical) ------------------------
   Kept documented for a future warm-light direction. The canonical light theme
   is light-cool below. Warm paper + warm near-black ink. */
[data-theme="light-warm"] {
  --canvas:    #f6f1ea;
  --canvas-2:  #efe8de;
  --surface:   #fffdf9;
  --surface-2: #ffffff;
  --line:      rgba(40, 30, 20, 0.12);
  --line-2:    rgba(40, 30, 20, 0.20);
  --ink:       #1f1a15;
  --ink-dim:   #6b6259;
  --ink-faint: #9c9389;

  --accent-soft: rgba(255, 69, 0, 0.10);
  --accent-line: rgba(255, 69, 0, 0.42);
  --glow: rgba(255, 69, 0, 0.08);

  color-scheme: light;
}

/* ---- LIGHT · COOL (CANONICAL light) - studio's existing neutral light ------ */
[data-theme="light-cool"] {
  --canvas:    #e9e9ea;
  --canvas-2:  #f1f1f2;
  --surface:   #fafafa;
  --surface-2: #ffffff;
  --line:      rgba(20, 20, 22, 0.11);
  --line-2:    rgba(20, 20, 22, 0.22);
  --ink:       #18181a;
  --ink-dim:   #5a5a5e;
  --ink-faint: #9a9a9e;

  --accent-soft: rgba(255, 69, 0, 0.10);
  --accent-line: rgba(255, 69, 0, 0.42);
  --glow: rgba(255, 69, 0, 0.07);

  color-scheme: light;
}

/* COMPONENTS */


.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(130% 100% at 84% -12%, var(--glow), transparent 60%),
    var(--canvas);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

/* Form controls do not inherit typography from the page by default - the UA
   stylesheet gives button/input/select/textarea their own font, which wins over
   inheritance. Inherit the UI font once here so every control matches the body
   without each component re-declaring font-family. (Family only, not the `font`
   shorthand, so component-level size/weight/line-height are untouched.) */
button, input, optgroup, select, textarea { font-family: inherit; }

a { color: var(--accent); text-decoration: none; }

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

/* ---------------------------------------------------------------- typography */
.display,
h1.display {
  font-family: var(--display); font-weight: 700;
  font-size: var(--fs-display); line-height: 1.02;
  letter-spacing: -0.015em; text-wrap: balance; margin: 0;
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.01em; line-height: 1.06; }
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 700; }

.lede { color: var(--ink-dim); font-size: var(--fs-lede); max-width: 46ch; text-wrap: pretty; }

/* kicker / eyebrow - mono, uppercase, orange */
.kicker {
  font-family: var(--mono); font-size: var(--fs-kicker); font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 1rem;
}
.kicker.muted { color: var(--ink-dim); letter-spacing: 0.22em; }

/* mono label / caption */
.label-mono {
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* ghost numeral - oversized, near-invisible display digit */
.ghost-num {
  font-family: var(--display); font-weight: 800; line-height: 1;
  color: var(--ink); opacity: 0.05; pointer-events: none; user-select: none;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ui); font-weight: 600; font-size: var(--fs-sm);
  padding: 0.8rem 1.4rem; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast), background var(--t-fast),
              border-color var(--t-fast), color var(--t-fast);
}
.btn:active { transform: scale(0.98); }
.btn .arr { transition: transform var(--t-fast); }
.btn:hover .arr { transform: translateX(3px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost { color: var(--ink-dim); border-color: var(--line); background: transparent; }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }

.btn-sm { padding: 0.55rem 0.95rem; font-size: var(--fs-xs); border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- form fields */
.field { margin-bottom: 1.7rem; }
.field-label {
  display: block; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim);
  margin-bottom: 0.55rem;
}
.field-label .opt { color: var(--ink-faint); text-transform: none; letter-spacing: 0; font-weight: 400; }

.text-input, .select-input {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0.7rem 0.95rem; font-family: var(--ui); font-size: 0.98rem; outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.text-input::placeholder { color: var(--ink-faint); }
.text-input:is([type="date"], [type="time"]) {
  min-height: 44px; line-height: 1.2; color-scheme: dark;
}
html:is([data-theme="light-cool"], [data-theme="light-warm"]) .text-input:is([type="date"], [type="time"]) {
  color-scheme: light;
}
.text-input:is([type="date"], [type="time"])::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 0.65;
}
.text-input:focus, .select-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.text-input.mono { font-family: var(--mono); font-size: 0.9rem; }

.range-field {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
}
.range-field-control { width: auto; min-width: 8rem; flex: 0 1 9rem; }
.range-field-sep { color: var(--ink-dim); font-size: var(--fs-sm); }
@media (max-width: 420px) {
  .range-field-control { flex-basis: 100%; }
  .range-field-sep { width: 100%; text-align: center; }
}

.select-input {
  -webkit-appearance: none; appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 0.95rem center;
}

/* segmented option cards */
.seg { display: grid; gap: 0.6rem; }
.seg.cols-2 { grid-template-columns: 1fr 1fr; }
.seg.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) { .seg.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .seg.cols-2, .seg.cols-3 { grid-template-columns: 1fr; } }
/* wrap variant - content-sized chips that flow; the multi-select layout.
   (.opt-card serves both: single-select = one .on; multi-select = .seg.wrap,
    several .on at once, each a <button aria-pressed>.) */
.seg.wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.seg.wrap .opt-card { min-width: 80px; }

.opt-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0.85rem 2.35rem 0.85rem 0.95rem; text-align: left; background: var(--surface); cursor: pointer;
  display: flex; flex-direction: column; gap: 0.15rem;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast), transform var(--t-fast);
}
.opt-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.opt-card .t { font-weight: 600; font-size: 0.92rem; }
.opt-card .s { font-size: 0.76rem; color: var(--ink-dim); }
.opt-card.on { border-color: var(--accent); background: var(--accent-soft); }
.opt-card .check {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); display: grid; place-items: center;
  opacity: 0; transform: scale(0.5); transition: all var(--t-fast) var(--ease-out);
}
.opt-card .check svg { width: 9px; height: 9px; }
.opt-card.on .check { opacity: 1; transform: scale(1); }

/* toggle switch */
.toggle-line {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; cursor: pointer; user-select: none;
}
.toggle-line .lab { font-weight: 600; font-size: 0.92rem; }
.toggle-line .sub { font-size: 0.78rem; color: var(--ink-dim); font-weight: 400; margin-top: 1px; }
.tw {
  width: 50px; height: 28px; flex-shrink: 0; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-2); position: relative;
  transition: background var(--t-base) var(--ease), border-color var(--t-base);
}
.tw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ink-dim);
  transition: transform var(--t-base) var(--ease-out), background var(--t-base);
}
.toggle-line.on .tw { background: var(--accent); border-color: var(--accent); }
.toggle-line.on .tw::after { transform: translateX(22px); background: #fff; }

/* pill segmented switch (mode-switch) */
.mode-switch {
  --mode-switch-radius: var(--r-pill);
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--mode-switch-radius); padding: 3px; gap: 2px;
}
.mode-switch button {
  font-family: var(--ui); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.4rem 0.9rem; border: 0; background: transparent;
  border-radius: max(0px, calc(var(--mode-switch-radius) - 3px));
  color: var(--ink-dim); cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.mode-switch button.on { background: var(--ink); color: var(--canvas); }
.mode-switch button:not(.on):hover { color: var(--ink); }

/* colour swatch control */
.swatch-row { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; }
.swatch {
  width: 38px; height: 38px; border-radius: var(--r-md); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; padding: 0;
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--ink); transform: scale(1.08); }

/* ---------------------------------------------------------------- cards */
.card {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 2.1rem;
  transition: border-color var(--t-base), transform var(--t-base);
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }

/* numbered step / flow card */
.flow-step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.3rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem 1.7rem; transition: border-color var(--t-base), transform var(--t-base);
}
.flow-step:hover { border-color: var(--line-2); transform: translateY(-2px); }
.flow-n {
  font-family: var(--display); font-weight: 800; font-size: 2.3rem; line-height: 0.9;
  color: var(--accent); opacity: 0.92; min-width: 2.2ch;
}
.flow-step h3 { margin: 0.15rem 0 0.4rem; font-size: 1.15rem; }
.flow-step p { margin: 0; color: var(--ink-dim); font-size: 0.97rem; }

/* Q&A row with hairline dividers */
.qa { padding: 1.55rem 0; border-bottom: 1px solid var(--line); }
.qa h3 { margin: 0 0 0.5rem; font-size: 1.18rem; color: var(--ink); }
.qa p { margin: 0; color: var(--ink-dim); font-size: 0.97rem; }

/* accent-glow CTA panel */
.cta-panel {
  padding: 1.6rem 1.7rem; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 58%), var(--surface);
}
.cta-panel h3 { margin: 0 0 0.4rem; color: var(--ink); }
.cta-panel p { margin: 0; color: var(--ink-dim); }

/* ---------------------------------------------------------------- callouts */
/* The bayton.org callout, reproduced faithfully: signature asymmetric radius,
   thick coloured left border, a Material Symbols icon and an underline bar on
   the heading. Two heading sizes (.callout-heading / .callout-heading-small).
   Colour set by variant via --c. */
.callout {
  --c: var(--accent);
  padding: 1.25rem 1.4rem; margin: 1.25rem 0;
  border-radius: var(--r-lg);                 /* uniform - was asymmetric 20/10/10/50 */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--c);            /* the retained signature: coloured left rule */
}
.callout > :last-child { margin-bottom: 0; }
.callout p:not([class]) { margin: 0 0 0.6rem; color: var(--ink-dim); font-size: 0.95rem; }

/* Inline / compact variant - icon + message + action on a single centred row
   (e.g. a stale-load error banner). Overrides the base block padding/margin. */
.callout-inline {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); margin: 0;
}

.callout-heading,
.callout-heading-small {
  display: block; width: fit-content;
  font-family: var(--display); font-weight: 600; color: var(--c); margin: 0 0 0.7rem;
}
.callout-heading { font-size: 24px; }              /* primary */
.callout-heading-small { font-size: 19px; }        /* secondary */
.callout-heading .material-symbols-outlined,
.callout-heading-small .material-symbols-outlined {
  font-size: 1.05em; vertical-align: -0.12em; margin-right: 0.3rem;
}
/* the underline bar BENEATH the heading text (as wide as the text) */
.callout-heading::after,
.callout-heading-small::after {
  content: ''; display: block; height: 4px;
  background: var(--c); border-radius: 5px; margin-top: 0.6rem;
}
.callout-heading-small::after { height: 2px; margin-top: 0.35rem; }

.callout.info,  .callout.callout-blue   { --c: var(--blue); }
.callout.success, .callout.callout-green { --c: var(--green); }
.callout.danger, .callout.callout-red    { --c: var(--red); }
.callout.warn,  .callout.callout-orange  { --c: var(--accent); }

/* compact dark pill callout (callout-small) */
.callout-small {
  border: 0; border-radius: var(--r-sm); padding: 0.4rem 0.2rem; margin: 1rem 0 0;
  background: var(--ink); color: var(--canvas);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.callout-small p { margin: 0; padding: 0.3rem 0.7rem; color: var(--canvas); }
.callout-small .material-symbols-outlined { font-size: 1.1em; padding-left: 0.5rem; }

/* ---------------------------------------------------------------- nav chips */
.chip {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); background: transparent; border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 0.5rem 0.8rem; cursor: pointer; white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.chip .chip-n { color: var(--ink-faint); font-weight: 600; }
.chip:hover { color: var(--ink); background: var(--surface); }
.chip.is-current { color: var(--ink); background: var(--surface); border-color: var(--line-2); }
.chip.is-current .chip-n { color: var(--accent); }

/* (removed: .badge - superseded by the merged .tag / .pill label family) */

.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent);
  animation: livepulse 2.4s var(--ease) infinite;
}
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* stat line */
.stat { color: var(--ink-faint); font-size: 0.95rem; font-family: var(--mono); letter-spacing: 0.02em; }
.stat strong { color: var(--accent); font-weight: 700; font-size: 1.15rem; padding-right: 0.15em; font-family: var(--display); }

/* section band header - big, bold, spacious */
.band-head { margin: 0 0 1.7rem; }
.band-head h2 { margin: 0.55rem 0 0; font-size: var(--fs-h2); text-wrap: balance; }
.band-head p.band-sub { margin: 0.7rem 0 0; color: var(--ink-dim); max-width: 58ch; }

/* ===========================================================================
   B + C COMPONENTS - harvested from sysapps (data) and 11ty (editorial),
   restyled into the Studio language (surface fills, hairline borders, accent
   focus, mono kickers, the radius + motion scales).
   =========================================================================== */

/* ---------------------------------------------------------------- buttons (extra) */
.btn-text {
  background: transparent; border: 0; color: var(--ink-dim);
  padding: 0.6rem 0.4rem; font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
}
.btn-text:hover { color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink-dim); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn .material-symbols-outlined { font-size: 20px; }
.add-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%;
  padding: 0.7rem 1rem; font-family: var(--ui); font-weight: 600; font-size: var(--fs-sm);
  color: var(--ink-dim); background: transparent; cursor: pointer;
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.add-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.x-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent;
  color: var(--ink-faint); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.x-btn:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }

/* ---------------------------------------------------------------- modal footer */
.modal-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: var(--sp-2);
}
.modal-footer.start { justify-content: flex-start; }
.modal-footer.between { justify-content: space-between; }

/* ---------------------------------------------------------------- menu + vertical nav */
.menu {
  display: grid; gap: 2px; min-width: min(220px, 100%);
  padding: var(--sp-1); border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  overflow: hidden;
}
.menu-item, .nav-item {
  width: 100%; border: 0; background: transparent; color: var(--ink-dim); cursor: pointer;
  display: flex; align-items: center; gap: var(--sp-2); text-align: left;
  font-family: var(--ui); font-size: 0.84rem; font-weight: 600; line-height: 1.2;
  transition: color var(--t-fast), background var(--t-fast);
}
.menu-item { padding: 0.55rem 0.65rem; border-radius: var(--r-sm); }
.menu-item .material-symbols-outlined, .nav-item .material-symbols-outlined {
  flex: none; font-size: 18px;
}
.menu-item:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface); color: var(--ink);
}
.menu-item.is-active { background: var(--accent-soft); color: var(--accent); }
.menu-item.is-danger { color: var(--err); }
.menu-item.is-danger:hover:not(:disabled):not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err);
}
.menu-divider { height: 1px; margin: var(--sp-1) 0; background: var(--line); }

.nav-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-item { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); }
.nav-item:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface); color: var(--ink);
}
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- fields (extra) */
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 600px) { .field-row-2 { grid-template-columns: 1fr; } }
.err-hint { color: var(--err); font-size: var(--fs-xs); margin: 0.4rem 0 0; }
.hint { color: var(--ink-faint); font-size: var(--fs-xs); margin: 0.4rem 0 0; }
.hint-info, .hint-ok, .hint-warn, .hint-err {
  display: flex; align-items: flex-start; gap: var(--sp-2); width: 100%; box-sizing: border-box;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  color: var(--ink-dim);
}
.hint-info { background: color-mix(in srgb, var(--info) 10%, transparent); }
.hint-ok { background: color-mix(in srgb, var(--ok) 11%, transparent); }
.hint-warn { background: var(--accent-soft); }
.hint-err { background: color-mix(in srgb, var(--err) 10%, transparent); }
.hint-info .material-symbols-outlined,
.hint-ok .material-symbols-outlined,
.hint-warn .material-symbols-outlined,
.hint-err .material-symbols-outlined {
  flex: none; font-size: 20px; line-height: 1.1;
}
.hint-info .material-symbols-outlined { color: var(--info); }
.hint-ok .material-symbols-outlined { color: var(--ok); }
.hint-warn .material-symbols-outlined { color: var(--accent); }
.hint-err .material-symbols-outlined { color: var(--err); }
.pw-wrap { position: relative; }
.pw-wrap .text-input { padding-right: 3rem; }
.pw-eye {
  position: absolute; top: 50%; right: 0.5rem; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--ink-faint); cursor: pointer; padding: 0.3rem;
}
.pw-eye:hover { color: var(--ink); }
.drop {
  display: grid; place-items: center; gap: 0.4rem; text-align: center;
  padding: 1.6rem; border: 1px dashed var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink-dim); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.drop:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.drop .material-symbols-outlined { font-size: 28px; color: var(--ink-faint); }

/* ---------------------------------------------------------------- tags & pills */
/* One system: .tag = squared chip, .pill = fully-rounded. Status via modifiers
   that read the single accent palette. (Supersedes the earlier .badge.) */
.tag, .pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.3rem 0.6rem; white-space: nowrap; line-height: 1;
  border: 1px solid var(--line-2); color: var(--ink-dim); background: var(--surface);
}
.tag { border-radius: var(--r-sm); }
.pill { border-radius: var(--r-pill); letter-spacing: 0.06em; }
/* status / intent variants (work on both .tag and .pill) */
.tag.accent, .pill.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.info,  .pill.info  { color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 40%, transparent);  background: color-mix(in srgb, var(--blue) 12%, transparent); }
.tag.ok,    .pill.ok    { color: var(--green); border-color: color-mix(in srgb, var(--green) 42%, transparent); background: color-mix(in srgb, var(--green) 13%, transparent); }
.tag.warn,  .pill.warn  { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.err,   .pill.err   { color: var(--red);   border-color: color-mix(in srgb, var(--red) 42%, transparent);   background: color-mix(in srgb, var(--red) 12%, transparent); }
/* Android version / API-level pill - tabular numerals so digits line up.
   (The bayton.org/sysapps version pill.) */
.pill.api, .pill.version {
  color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
}
/* android glyph baked into the version pill (matches bayton.org) */
.pill.version::before {
  content: "android"; font-family: "Material Symbols Outlined";
  font-feature-settings: "liga"; -webkit-font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 1.15em; line-height: 1; margin-right: 0.1em;
}
/* dark blue for legibility - covers default-dark (no data-theme) and explicit dark,
   excludes the two light themes */
html:not([data-theme="light-cool"]):not([data-theme="light-warm"]) .pill.api,
html:not([data-theme="light-cool"]):not([data-theme="light-warm"]) .pill.version {
  color: #5fb6dd;
  background: color-mix(in srgb, #5fb6dd 13%, transparent);
  border-color: color-mix(in srgb, #5fb6dd 30%, transparent);
}

/* removable filter chip */
.chip-removable {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 600;
  padding: 0.3rem 0.35rem 0.3rem 0.7rem; border-radius: var(--r-pill);
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
/* crisp, optically-centred - drawn in CSS (no glyph metrics to fight) */
.chip-removable .x {
  position: relative; flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 0; cursor: pointer; font-size: 0; padding: 0;
}
.chip-removable .x::before, .chip-removable .x::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 8px; height: 1.5px;
  background: #fff; border-radius: 1px;
}
.chip-removable .x::before { transform: translate(-50%, -50%) rotate(45deg); }
.chip-removable .x::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* universal icon alignment: any Material Symbol sitting inline in a flex
   control (button, pill, tag, chip) centres on the text cap-height. */
.btn .material-symbols-outlined,
.tag .material-symbols-outlined,
.pill .material-symbols-outlined,
.chip .material-symbols-outlined { font-size: 1.1em; line-height: 1; }

/* shared keyboard-focus ring for interactive controls */
.btn:focus-visible, .btn-text:focus-visible, .icon-btn:focus-visible, .add-btn:focus-visible,
.x-btn:focus-visible, .chip:focus-visible, .chip-removable .x:focus-visible, .swatch:focus-visible,
.opt-card:focus-visible, .toggle-line:focus-visible, .mode-switch button:focus-visible,
.tabs a:focus-visible, .pager a:focus-visible, .copy-btn:focus-visible, .search-submit:focus-visible,
.menu-item:focus-visible, .nav-item:focus-visible {
  outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: var(--r-sm);
}

/* ---------------------------------------------------------------- status / message blocks */
/* Compact inline states - distinct from prose callouts. */
.msg {
  display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start;
  padding: 0.85rem 1rem; border-radius: var(--r-md); font-size: var(--fs-sm);
  border: 1px solid var(--c, var(--line-2)); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--surface));
  color: var(--ink-dim);
}
.msg .material-symbols-outlined { color: var(--c, var(--accent)); font-size: 20px; }
.msg strong { color: var(--ink); font-weight: 700; }
.msg.info { --c: var(--blue); }
.msg.ok   { --c: var(--green); }
.msg.warn { --c: var(--accent); }
.msg.err  { --c: var(--red); }
/* empty state */
.empty-state {
  display: grid; place-items: center; gap: 0.6rem; text-align: center;
  padding: 2.5rem 1.5rem; border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  color: var(--ink-dim); background: var(--surface);
}
.empty-state .material-symbols-outlined { font-size: 40px; color: var(--ink-faint); }
.empty-state h3 { margin: 0; color: var(--ink); }

/* ---------------------------------------------------------------- data table */
.table-wrap {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  overflow-x: auto;
}
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data.traditional { min-width: 760px; }
table.data thead th {
  position: sticky; top: 0; background: var(--surface-2); z-index: 1;
  text-align: left; padding: 0.7rem 0.95rem; font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
table.data tbody td { padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--canvas-2); }
table.data td .secondary { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; }
table.data td a { color: var(--ink); border-bottom: 1px solid transparent; }
table.data td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* sortable header */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
.sort-ind { color: var(--ink-faint); font-size: 0.8em; margin-left: 0.3rem; }
.sort-ind.on { color: var(--accent); }
/* mobile: collapse rows to labelled cards */
@media (max-width: 768px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border: 1px solid var(--line); border-radius: var(--r-md); margin: 0.6rem; }
  table.data td { border: 0; display: grid; grid-template-columns: 40% 1fr; gap: 0.5rem; }
  table.data td::before { content: attr(data-label); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
  table.data.traditional { display: table; width: max-content; min-width: 100%; }
  table.data.traditional thead { display: table-header-group; }
  table.data.traditional tbody { display: table-row-group; }
  table.data.traditional tr { display: table-row; border: 0; border-radius: 0; margin: 0; width: auto; }
  table.data.traditional th,
  table.data.traditional td { display: table-cell; width: auto; }
  table.data.traditional td { border-bottom: 1px solid var(--line); }
  table.data.traditional tbody tr:last-child td { border-bottom: 0; }
  table.data.traditional td::before { content: none; }
}

/* ---------------------------------------------------------------- tiles & meters */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.tile {
  position: relative; overflow: hidden; padding: 1.3rem 1.3rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.tile.flag { border-color: var(--accent-line); }
.tile .tile-val { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1; color: var(--ink); }
.tile .tile-val.is-text { font-size: 1.2rem; }
.tile .tile-label { display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.6rem; }
.tile .tile-sub { display: block; font-size: 0.8rem; color: var(--ink-faint); margin-top: 0.2rem; }

/* labelled progress / coverage meter */
.meter-row { display: grid; grid-template-columns: 130px 1fr 56px; gap: 0.9rem; align-items: center; padding: 0.45rem 0; }
.meter-row .meter-name { font-size: var(--fs-sm); color: var(--ink-dim); }
.meter { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.meter > .fill { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent-lo), var(--accent)); }
.meter-row .meter-count { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint); text-align: right; }

/* ---------------------------------------------------------------- filter bar */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center;
  padding: 0.8rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
}
.filters .select-input, .filters .text-input { width: auto; flex: 0 1 180px; }
.filters .grow { flex: 1 1 200px; }
.filters .filters-end { margin-left: auto; }
.result-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem 1rem;
  color: var(--ink-dim); font-size: var(--fs-sm); padding: 0.6rem 0.1rem;
}
.chip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.chip-bar .chips-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.chip-clear { color: var(--ink-faint); font-size: 0.8rem; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.chip-clear:hover { color: var(--ink); }

/* ---------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 0.3rem; max-width: 100%; overflow-x: auto;
  border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.tabs a {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.5rem; padding: 0.7rem 0.95rem;
  color: var(--ink-dim); border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 600; font-size: var(--fs-sm); transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { font-family: var(--mono); font-size: 0.66rem; padding: 0.1rem 0.4rem; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-faint); }
.tabs a.is-active .tab-count { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 420px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tabs a { flex: 1 1 auto; justify-content: center; }
}

/* ---------------------------------------------------------------- pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pager a, .pager span:not(.material-symbols-outlined) {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 0.6rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-dim); font-size: var(--fs-sm); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.pager a:hover { color: var(--ink); border-color: var(--line-2); }
.pager a.is-current { color: #fff; background: var(--accent); border-color: var(--accent); cursor: default; }
.pager .info { border: 0; color: var(--ink-faint); cursor: default; }

/* ---------------------------------------------------------------- search pill */
.search-box {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem 0.55rem 1rem;
  border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
/* Flat variant: de-bordered fill for standalone use on a page canvas, where the
   default bordered pill can read as a box-in-a-box. The border stays for layout
   but goes transparent (no size shift vs the default); focus shows just the accent
   ring. Use as class="search-box search-box-flat". */
.search-box-flat { border-color: transparent; }
.search-box-flat:focus-within { border-color: transparent; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box-alt {
  min-height: 54px; padding: 0.65rem 1.05rem;
  border-width: 1px; border-radius: var(--r-sm);
  background: var(--surface); gap: 0.75rem;
}
.search-box-alt:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .material-symbols-outlined { color: var(--ink-faint); font-size: 22px; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-family: var(--ui); font-size: 1rem; outline: none; }
.search-box input::placeholder { color: var(--ink-faint); }
.search-box .kbd {
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint);
  padding: 0.15rem 0.45rem; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface-2);
}
.search-box:focus-within .kbd { display: none; }
.search-box .search-submit {
  flex: none; border: 0; cursor: pointer; padding: 0.5rem 1.1rem; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-family: var(--ui); font-weight: 600; font-size: var(--fs-sm);
}
.search-box .search-submit:hover { background: var(--accent-2); }
/* suggestion chips under a search */
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.8rem; }
.suggestions .label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.suggestions a {
  font-family: var(--mono); font-size: 0.74rem; color: var(--ink-dim);
  padding: 0.3rem 0.7rem; border: 1px solid var(--line-2); border-radius: var(--r-pill);
}
.suggestions a:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
/* live results popup */
.results-popup {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35); overflow: hidden;
}
.results-popup a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.results-popup a:last-child { border-bottom: 0; }
.results-popup a:hover { background: var(--canvas-2); }
.results-popup .r-name { color: var(--ink); font-weight: 600; }
.results-popup .r-name, .results-popup .r-pkg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-popup .r-pkg { display: block; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-faint); margin-top: 2px; }

/* combobox / typeahead */
.combobox { position: relative; }
.combobox-list {
  position: absolute; left: 0; right: 0; margin-top: 0.4rem; z-index: 5;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface-2);
  box-shadow: 0 14px 40px rgba(0,0,0,0.32); max-height: 240px; overflow-y: auto;
}
.combobox-option { padding: 0.6rem 0.9rem; cursor: pointer; font-size: var(--fs-sm); }
.combobox-option:hover, .combobox-option.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- tooltip */
.tip { position: relative; border-bottom: 1px dotted var(--ink-faint); cursor: help; }
.tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  white-space: nowrap; padding: 0.4rem 0.6rem; border-radius: var(--r-sm); font-size: 0.78rem;
  background: var(--ink); color: var(--canvas); opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast); z-index: 10;
}
.tip:hover::after { opacity: 1; }

/* ---------------------------------------------------------------- avatar stack */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; margin-left: -8px; transition: transform var(--t-fast);
}
.avatar:first-child { margin-left: 0; }
.avatar:hover { transform: translateY(-3px); }
.avatar.accent { background: var(--accent); color: #fff; }
.avatar.blue { background: var(--blue); color: #fff; }
.avatar.green { background: var(--green); color: #fff; }

/* ---------------------------------------------------------------- copy + code */
.code-block { position: relative; }
.code-block pre {
  margin: 0; padding: 1rem 3rem 1rem 1rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.85rem; color: var(--ink); overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 0.6rem; right: 0.6rem; display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono); font-size: 0.7rem; padding: 0.3rem 0.55rem; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-dim);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.copy-btn.copied { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.copy-btn .material-symbols-outlined { font-size: 14px; }

/* Disabled affordance for every button-like control. Keep this after variant
   hover rules so disabled controls do not animate, recolour, or imply action. */
:is(.btn, .btn-text, .icon-btn, .add-btn, .x-btn, .copy-btn, .search-submit, .mode-switch button, .menu-item, .nav-item):is(:disabled, [disabled], [aria-disabled="true"]) {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn:is(:disabled, [disabled], [aria-disabled="true"]):hover .arr { transform: none; }
.btn-primary:is(:disabled, [disabled], [aria-disabled="true"]),
.search-box .search-submit:is(:disabled, [disabled], [aria-disabled="true"]) {
  background: var(--accent); color: #fff; border-color: transparent;
}
.btn-ghost:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); border-color: var(--line); background: transparent;
}
.btn-text:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); background: transparent;
}
.icon-btn:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); border-color: var(--line); background: var(--surface);
}
.add-btn:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); border-color: var(--line-2); background: transparent;
}
.x-btn:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-faint); border-color: var(--line); background: transparent;
}
.copy-btn:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); border-color: var(--line-2); background: var(--surface-2);
}
.menu-item:is(:disabled, [disabled], [aria-disabled="true"]),
.nav-item:is(:disabled, [disabled], [aria-disabled="true"]) {
  color: var(--ink-dim); background: transparent;
}

/* ---------------------------------------------------------------- record / detail header */
.record-head {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  padding: 1.6rem 1.8rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.record-head::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.record-head .record-id { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; color: var(--ink); word-break: break-all; }
.record-head .record-label { color: var(--ink-dim); font-size: var(--fs-sm); margin-top: 0.2rem; }
.record-head .actions { display: flex; gap: 0.5rem; }

/* ---------------------------------------------------------------- pricing table */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 768px) { .pricing { grid-template-columns: 1fr; } }
.price-card {
  position: relative; display: flex; flex-direction: column; text-align: center;
  padding: 2rem 1.6rem; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface);
}
.price-card.popular { border-color: var(--accent-line); }
.price-card.popular::before {
  content: 'Most popular'; position: absolute; top: -0.7rem; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: var(--accent); padding: 0.25rem 0.7rem; border-radius: var(--r-pill);
}
.price-card h3 { margin: 0 0 0.6rem; font-size: 1.3rem; }
.price-card .price { font-family: var(--display); font-weight: 800; font-size: 2.6rem; color: var(--ink); line-height: 1; }
.price-card .price small { font-family: var(--ui); font-size: 0.9rem; font-weight: 400; color: var(--ink-faint); }
.price-card ul { list-style: none; margin: 1.4rem 0; padding: 0; text-align: left; display: grid; gap: 0.6rem; }
.price-card li { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: center; color: var(--ink-dim); font-size: var(--fs-sm); }
.price-card li .material-symbols-outlined { color: var(--green); font-size: 18px; line-height: 1; }
.price-card .btn { margin-top: auto; justify-content: center; }

/* ---------------------------------------------------------------- logo strip */
.logo-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1.5rem 2rem;
  align-items: center; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.logo-strip .logo-item {
  height: 34px; display: grid; place-items: center; color: var(--ink-dim); opacity: 0.7;
  font-family: var(--display); font-weight: 700; font-size: 0.95rem; transition: opacity var(--t-fast), color var(--t-fast);
}
.logo-strip .logo-item:hover { opacity: 1; color: var(--ink); }

/* ---------------------------------------------------------------- pull-quote */
.pullquote {
  position: relative; overflow: hidden; margin: 1.6rem 0;
  padding: 1.5rem 2rem 1.4rem 3.6rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem); line-height: 1.32; color: var(--ink); text-wrap: balance;
}
.pullquote::before {   /* big accent opening quote */
  content: '\201C'; position: absolute; left: 0.8rem; top: 0.3rem;
  font-family: var(--display); font-weight: 800; font-size: 4.5rem; line-height: 1; color: var(--accent);
}
.pullquote::after {    /* oversized ghost closing quote, echoing the ghost numerals */
  content: '\201D'; position: absolute; right: 0.4rem; bottom: -3.2rem;
  font-family: var(--display); font-weight: 800; font-size: 10rem; line-height: 1;
  color: var(--ink); opacity: 0.04; pointer-events: none; user-select: none;
}
.pullquote cite { position: relative; z-index: 1; display: block; margin-top: 1rem; font-family: var(--ui); font-weight: 600; font-size: 0.9rem; font-style: normal; color: var(--accent); }

/* ---------------------------------------------------------------- breadcrumbs */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--ink-faint); }
.breadcrumbs a { color: var(--ink-dim); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--ink-faint); }
.breadcrumbs .current { color: var(--ink); }

/* ---------------------------------------------------------------- section header (merged band/section/page) */
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.section-head .kicker { margin: 0 0 0.5rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0.5rem 0 0; color: var(--ink-dim); max-width: 58ch; }
.section-head .section-link { color: var(--accent); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }

/* ---------------------------------------------------------------- service / shortcut tiles */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.service-tile {
  display: grid; gap: 0.6rem; padding: 1.3rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); text-align: left; transition: border-color var(--t-base), transform var(--t-base);
}
.service-tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.service-tile .material-symbols-outlined { font-size: 26px; color: var(--accent); }
.service-tile .t { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.service-tile .s { font-size: var(--fs-sm); color: var(--ink-dim); }

/* ---------------------------------------------------------------- hero (marketing) */
.hero {
  position: relative; padding: 3.5rem 0 4rem;
}
.hero .ghost-num { position: absolute; left: -1.5vw; top: -8vh; font-size: 36vh; z-index: 0; }
.hero-inner { position: relative; z-index: 1; max-width: 46ch; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.015em; margin: 1rem 0 1.2rem; text-wrap: balance; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }

/* ---------------------------------------------------------------- diff viewer */
/* Line-by-line change view (from DeltaWatch). Added/removed row tints are
   mixed from the palette so they hold in every theme. */
.diff {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); font-family: var(--mono); font-size: 0.85rem;
}
.diff-head {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.9rem;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.diff-dots { display: flex; gap: 0.4rem; flex: none; }
.diff-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.diff-dots i:nth-child(1) { background: #ff5f57; }
.diff-dots i:nth-child(2) { background: #febc2e; }
.diff-dots i:nth-child(3) { background: #28c840; }
.diff-cap { font-size: 0.72rem; color: var(--ink-faint); }
.diff-body { overflow-x: auto; }
.diff-line { display: flex; line-height: 1.7; }
.diff-line .ln { width: 3ch; flex: none; text-align: right; padding-right: 0.8rem; color: var(--ink-faint); user-select: none; }
.diff-line .pf { width: 2ch; flex: none; text-align: center; user-select: none; color: var(--ink-faint); }
.diff-line .tx { flex: 1; padding-right: 1rem; white-space: pre; color: var(--ink-dim); }
.diff-line.added   { background: color-mix(in srgb, var(--green) 15%, var(--surface)); }
.diff-line.added .pf, .diff-line.added .tx   { color: color-mix(in srgb, var(--green) 55%, var(--ink)); }
.diff-line.removed { background: color-mix(in srgb, var(--red) 15%, var(--surface)); }
.diff-line.removed .pf, .diff-line.removed .tx { color: color-mix(in srgb, var(--red) 55%, var(--ink)); }

/* ---------------------------------------------------------------- status / health card */
.status-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 1.6rem 1.8rem; }
.status-head { display: flex; align-items: center; gap: 0.7rem; }
.status-head h3 { margin: 0; font-size: 1.3rem; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.status-dot.ok       { background: var(--green); }
.status-dot.degraded { background: var(--accent); }   /* orange - stays on the one-tier palette */
.status-dot.down     { background: var(--red); }
.status-dot.unknown  { background: var(--ink-faint); animation: statuspulse 1.6s var(--ease) infinite; }
@keyframes statuspulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; margin: 1.4rem 0; }
@media (max-width: 600px) { .status-grid { grid-template-columns: 1fr; } }
.status-grid dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 0; }
.status-grid dd { margin: 0.25rem 0 0; color: var(--ink); }
.status-grid dd.mono { font-family: var(--mono); }
.status-err {
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red); border-radius: var(--r-md); padding: 0.7rem 0.9rem;
  font-family: var(--mono); font-size: 0.85rem;
}
.status-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: var(--sp-1); color: var(--ink-faint); font-size: var(--fs-sm); }

/* ===========================================================================
   MOBILE - Jetpack Compose + Material 3, themed with the bayton palette.
   These are web approximations of the native components for documentation;
   the real source of truth is each app's ui/theme/Theme.kt. Type is Material
   default (Roboto/system) today.  Scheme values are the actual app values.
   =========================================================================== */
.m3 {
  --m3-primary: #FF4500; --m3-on-primary: #ffffff;
  --m3-secondary: #15B007; --m3-tertiary: #0077b3;
  --m3-secondary-container: #0077b3; --m3-on-secondary-container: #ffffff;
  --m3-error: #C30000; --m3-error-container: #FFDEDE; --m3-on-error-container: #270000;
  --m3-surface: #F7F7F7; --m3-on-surface: #333333;
  --m3-surface-container: #ffffff; --m3-on-surface-variant: #5a5a5e;
  --m3-outline: rgba(0,0,0,0.16);
  font-family: Roboto, "Open Sans", system-ui, sans-serif;
}
.m3.dark {
  --m3-secondary-container: #00284d;
  --m3-error-container: #270000; --m3-on-error-container: #FFDEDE;
  --m3-surface: #141218; --m3-on-surface: #ffffff;
  --m3-surface-container: #252525; --m3-on-surface-variant: #c9c5d0;
  --m3-outline: rgba(255,255,255,0.18);
}

/* phone frame */
.phone { width: min(300px, 100%); border-radius: 38px; background: #0a0a0a; padding: 9px; box-shadow: 0 24px 50px -20px rgba(0,0,0,0.5); flex: none; }
.phone-screen { position: relative; border-radius: 30px; overflow: hidden; height: 580px; display: flex; flex-direction: column; background: var(--m3-surface); color: var(--m3-on-surface); }
.m3-statusbar { display: flex; justify-content: space-between; padding: 0.5rem 1.1rem 0.2rem; font-size: 0.68rem; font-weight: 600; color: var(--m3-on-surface); }

/* top app bar - circular app logo + title (+ optional android metadata line) + actions */
.m3-appbar { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.9rem; color: var(--m3-on-surface); }
.m3-applogo { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid var(--m3-primary); color: var(--m3-on-surface); }
.m3-applogo .material-symbols-outlined { font-size: 15px; }
.m3-appbar .title { font-size: 1.1rem; font-weight: 500; flex: 1; line-height: 1.15; min-width: 0; }
.m3-appbar .title .meta { display: flex; align-items: center; gap: 0.25rem; font-size: 0.64rem; font-weight: 400; color: var(--m3-on-surface-variant); margin-top: 1px; }
.m3-appbar .title .meta .material-symbols-outlined { font-size: 12px; color: var(--m3-secondary); }
.m3-appbar > .material-symbols-outlined { font-size: 20px; color: var(--m3-on-surface); flex: none; }

.m3-body { flex: 1; overflow: hidden; padding: 0.3rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.m3-label { font-size: 0.92rem; font-weight: 600; margin: 0.25rem 0 -0.1rem; }

/* welcome card (secondaryContainer / blue) */
.m3-welcome { background: var(--m3-secondary-container); color: var(--m3-on-secondary-container); border-radius: 16px; padding: 1rem 1.05rem; }
.m3-welcome .wh { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; }
.m3-welcome .wb { font-size: 0.78rem; line-height: 1.45; }
.m3-welcome .wn { font-size: 0.7rem; line-height: 1.4; opacity: 0.72; margin-top: 0.5rem; }

/* quick-action tiles */
.m3-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.m3-tile { background: var(--m3-surface-container); border-radius: 12px; padding: 0.7rem 0.3rem; display: grid; place-items: center; gap: 0.4rem; }
.m3-tile .material-symbols-outlined { font-size: 21px; color: var(--m3-on-surface); }
.m3-tile .tl { font-size: 0.7rem; }

/* contact / settings list */
.m3-list { background: var(--m3-surface-container); border-radius: 14px; overflow: hidden; }
.m3-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.65rem 1rem; font-size: 0.82rem; }
.m3-row + .m3-row { border-top: 1px solid var(--m3-outline); }
.m3-row .material-symbols-outlined { font-size: 18px; color: var(--m3-on-surface); flex: none; }

/* Material outlined text field (focused) */
.m3-field { position: relative; border: 2px solid var(--m3-primary); border-radius: 8px; padding: 0.7rem 0.8rem; font-size: 0.84rem; color: var(--m3-on-surface); }
.m3-field .lbl { position: absolute; top: -0.52rem; left: 0.6rem; background: var(--m3-surface); padding: 0 0.3rem; font-size: 0.68rem; color: var(--m3-primary); }
.m3-field .caret { color: var(--m3-primary); font-weight: 300; }

/* app result card (Package Search) */
.m3-app { background: var(--m3-surface-container); border-radius: 14px; padding: 0.85rem 0.95rem; }
.m3-app-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.m3-app-ic { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--m3-surface); border: 1px solid var(--m3-outline); }
.m3-app-ic .material-symbols-outlined { font-size: 17px; color: var(--m3-secondary); }
.m3-app .an { font-size: 0.92rem; font-weight: 500; }
.m3-app .ap { font-family: var(--mono); font-size: 0.7rem; color: var(--m3-on-surface-variant); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m3-app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.8rem; margin-top: 0.7rem; font-size: 0.7rem; }
.m3-app-grid .k { color: var(--m3-on-surface-variant); }
.m3-app-grid .v { color: var(--m3-on-surface); }
.m3-app-chips { display: flex; gap: 1rem; margin-top: 0.7rem; font-size: 0.72rem; font-weight: 600; }
.m3-app-chips span { display: inline-flex; align-items: center; gap: 0.25rem; }
.m3-app-chips .material-symbols-outlined { font-size: 14px; }
.m3-chip-ok { color: var(--m3-secondary); }
.m3-chip-sys { color: var(--m3-primary); }

/* featured action card with toggle */
.m3-feature { display: flex; gap: 0.8rem; align-items: flex-start; background: var(--m3-surface-container); border-radius: 14px; padding: 0.9rem 1rem; }
.m3-feature .fic .material-symbols-outlined { font-size: 21px; color: var(--m3-on-surface); }
.m3-feature .ft { flex: 1; min-width: 0; }
.m3-feature .ft .t { font-weight: 500; font-size: 0.9rem; }
.m3-feature .ft .d { font-size: 0.72rem; color: var(--m3-on-surface-variant); margin-top: 0.25rem; line-height: 1.4; }

/* M3 switch */
.m3-switch { width: 48px; height: 28px; border-radius: 999px; background: var(--m3-surface); border: 2px solid var(--m3-outline); position: relative; flex: none; align-self: center; }
.m3-switch::after { content: ''; position: absolute; top: 50%; left: 7px; transform: translateY(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--m3-on-surface-variant); transition: all 0.2s; }
.m3-switch.on { background: var(--m3-primary); border-color: var(--m3-primary); }
.m3-switch.on::after { left: 24px; width: 20px; height: 20px; background: #fff; }

/* M3 colour-role swatch */
.m3-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; }
.m3-role { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.m3-role .pair { display: flex; height: 48px; }
.m3-role .pair span { flex: 1; }
.m3-role .meta { padding: 0.5rem 0.7rem; }
.m3-role .rn { font-family: var(--mono); font-size: 0.72rem; color: var(--ink); }
.m3-role .rv { font-family: var(--mono); font-size: 0.62rem; color: var(--ink-faint); margin-top: 2px; }

/* ---------------------------------------------------------------- comparison (us vs them) */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 768px) { .compare { grid-template-columns: 1fr; } }
.compare-col { border: 1px solid var(--line); border-radius: var(--r-xl); padding: 2rem; background: var(--surface); }
.compare-col.highlight { background: linear-gradient(160deg, var(--accent-soft), var(--surface-2)); border-color: var(--accent-line); }
.compare-col h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; margin: 0; }
.compare-col .ch { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.compare-col ul { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-direction: column; gap: 0.9rem; }
.compare-col li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.97rem; color: var(--ink-dim); }
.compare-col.highlight li { color: var(--ink); }
.compare-col li .material-symbols-outlined { flex: none; font-size: 19px; margin-top: 1px; }
.compare-col li .no { color: var(--ink-faint); }
.compare-col li .yes { color: var(--accent); }

/* ---------------------------------------------------------------- bento grid */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.bento-tile {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.6rem; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.bento-tile:hover { transform: translateY(-3px); border-color: var(--line-2); }
.bento-tile.span-2 { grid-column: span 2; }
.bento-tile.span-2x2 { grid-column: span 2; grid-row: span 2; }
.bento-tile.span-full { grid-column: 1 / -1; }
.bento-tile.highlight { background: linear-gradient(160deg, var(--accent-soft), var(--surface-2)); border-color: var(--accent-line); }
.bento-tile .ic { width: 42px; height: 42px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 1.1rem; }
.bento-tile .ic .material-symbols-outlined { font-size: 22px; }
.bento-tile h3 { font-size: 1.15rem; margin: 0; }
.bento-tile.span-2x2 h3, .bento-tile.span-full h3 { font-size: 1.4rem; }
.bento-tile p { color: var(--ink-dim); margin: 0.6rem 0 0; font-size: 0.95rem; }
@media (max-width: 768px) { .bento { grid-template-columns: 1fr 1fr; } .bento-tile.span-2x2 { grid-row: auto; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .bento-tile.span-2, .bento-tile.span-2x2, .bento-tile.span-full { grid-column: auto; } }

/* ---------------------------------------------------------------- success state (branded confirmation) */
.success-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; max-width: 480px; margin: 0 auto; }
.success-check { position: relative; width: 108px; height: 108px; display: grid; place-items: center; margin-bottom: 0.5rem; }
.success-check::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--accent-line); border-top-color: var(--accent);
  animation: success-spin 6s infinite ease-in-out;
}
.success-check .material-symbols-outlined { font-size: 56px; color: var(--accent); }
.success-spiral { width: 108px; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 0.5rem; }
.success-spiral svg { width: 100%; height: 100%; display: block; }
.success-spiral .spiral-ink { fill: var(--ink); }
.success-spiral .spiral-accent { fill: var(--accent); }
.success-spiral .spiral-spin {
  animation: success-spin 6s infinite ease-in-out;
  transform-box: fill-box;
  transform-origin: center;
}
.success-state h3 { font-size: 1.6rem; margin: 0; }
.success-state p { color: var(--ink-dim); font-size: 1.02rem; max-width: 38ch; margin: 0.3rem 0 0; }
@keyframes success-spin { 0% { transform: rotate(0); } 20% { transform: rotate(180deg); } 40%, 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .success-check::before, .success-spiral .spiral-spin { animation: none; } }

/* ---------------------------------------------------------------- brand motifs */
:root {
  --brand-mark: url("assets/logos/swirl-solid.svg");
  --brand-arc: url("assets/logos/swirl-arc.svg");
  --brand-tail: url("assets/logos/swirl-tail.svg");
  --brand-combo: url("assets/logos/combo-tile.svg");
  --brand-peak: url("assets/logos/peak-ink.svg");
  --brand-wordmark-ink: url("assets/logos/wordmark-ink.svg");
  --brand-wordmark-accent: url("assets/logos/wordmark-accent.svg");
}

.brand-motif-surface {
  position: relative; min-height: 230px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--canvas-2);
}
.brand-motif-surface.center { display: grid; place-items: center; text-align: center; }

.brand-wordmark {
  position: relative; display: block; width: var(--brand-wordmark-width, 174px);
  aspect-ratio: 2872 / 462; flex: none;
}
.brand-wordmark::before,
.brand-wordmark::after {
  content: ""; position: absolute; inset: 0;
}
.brand-wordmark::before {
  background: var(--brand-wordmark-ink-color, var(--ink));
  -webkit-mask: var(--brand-wordmark-ink) left / contain no-repeat;
  mask: var(--brand-wordmark-ink) left / contain no-repeat;
}
.brand-wordmark::after {
  background: var(--brand-wordmark-accent-color, var(--accent));
  -webkit-mask: var(--brand-wordmark-accent) left / contain no-repeat;
  mask: var(--brand-wordmark-accent) left / contain no-repeat;
}

.brand-mark-lockup {
  position: relative; display: block;
  width: var(--brand-mark-size, 64px); height: var(--brand-mark-size, 64px);
}
.brand-mark-lockup::before,
.brand-mark-lockup::after {
  content: ""; position: absolute; inset: 0;
}
.brand-mark-lockup::before {
  background: var(--brand-mark-arc, var(--accent));
  -webkit-mask: var(--brand-arc) center / contain no-repeat;
  mask: var(--brand-arc) center / contain no-repeat;
}
.brand-mark-lockup::after {
  background: var(--brand-mark-tail, var(--ink));
  -webkit-mask: var(--brand-tail) center / contain no-repeat;
  mask: var(--brand-tail) center / contain no-repeat;
}

.brand-field,
.brand-field::before,
.brand-field::after {
  position: absolute; inset: 0;
}
.brand-field {
  --brand-field-size: 76px;
  --brand-field-ink: var(--ink);
  --brand-field-opacity: 0.05;
  --brand-field-angle: 0deg;
  --brand-field-repeat: repeat;
  --brand-field-x: 0;
  --brand-field-y: 0;
  --brand-field-bleed: -35%;
  pointer-events: none;
}
.brand-field::before {
  content: ""; inset: var(--brand-field-bleed);
  background: var(--brand-field-ink); opacity: var(--brand-field-opacity);
  transform: rotate(var(--brand-field-angle)); transform-origin: center;
  -webkit-mask: var(--brand-field-mark, var(--brand-mark)) var(--brand-field-x) var(--brand-field-y) / var(--brand-field-size) var(--brand-field-repeat);
  mask: var(--brand-field-mark, var(--brand-mark)) var(--brand-field-x) var(--brand-field-y) / var(--brand-field-size) var(--brand-field-repeat);
}
.brand-field.offset::after {
  content: ""; inset: var(--brand-field-bleed);
  background: var(--brand-field-ink); opacity: calc(var(--brand-field-opacity) * 0.7);
  transform: rotate(var(--brand-field-angle)); transform-origin: center;
  -webkit-mask: var(--brand-field-mark, var(--brand-mark)) var(--brand-field-offset-x, 38px) var(--brand-field-offset-y, 38px) / var(--brand-field-size) var(--brand-field-repeat);
  mask: var(--brand-field-mark, var(--brand-mark)) var(--brand-field-offset-x, 38px) var(--brand-field-offset-y, 38px) / var(--brand-field-size) var(--brand-field-repeat);
}
.brand-field.horizontal { --brand-field-angle: 0deg; }
.brand-field.vertical { --brand-field-angle: 90deg; --brand-field-bleed: -35%; }
.brand-field.diagonal { --brand-field-angle: -20deg; --brand-field-bleed: -35%; }
.brand-field.angle-up { --brand-field-angle: 20deg; --brand-field-bleed: -35%; }
.brand-field.sm { --brand-field-size: 52px; }
.brand-field.lg { --brand-field-size: 112px; }
.brand-field.accent { --brand-field-ink: var(--accent); --brand-field-opacity: 0.12; }
.brand-field.info { --brand-field-ink: var(--info); --brand-field-opacity: 0.11; }
.brand-field.faint { --brand-field-opacity: 0.035; }
.brand-field.fade {
  --brand-field-ink: var(--accent); --brand-field-opacity: 0.14; --brand-field-size: 62px;
  -webkit-mask: radial-gradient(120% 120% at 18% 12%, #000, transparent 68%);
  mask: radial-gradient(120% 120% at 18% 12%, #000, transparent 68%);
}
.brand-field.split::before {
  background: var(--accent); opacity: 0.16;
  -webkit-mask: var(--brand-arc) 0 -24px / 86px repeat;
  mask: var(--brand-arc) 0 -24px / 86px repeat;
}
.brand-field.split::after {
  content: ""; background: var(--ink); opacity: 0.07;
  -webkit-mask: var(--brand-tail) 0 24px / 86px repeat;
  mask: var(--brand-tail) 0 24px / 86px repeat;
}
.brand-field.peak { --brand-field-mark: var(--brand-peak); --brand-field-ink: var(--accent); --brand-field-opacity: 0.14; --brand-field-size: 64px; }
.brand-field.combo { --brand-field-mark: var(--brand-combo); --brand-field-opacity: 0.08; --brand-field-size: 108px; }
.brand-field.density {
  --brand-field-mark: var(--brand-combo);
  --brand-field-ink: var(--accent);
  --brand-field-opacity: 0.14;
  --brand-field-size: 108px;
  -webkit-mask: radial-gradient(120% 120% at var(--brand-field-fade-x, 18%) var(--brand-field-fade-y, 12%), #000, transparent 68%);
  mask: radial-gradient(120% 120% at var(--brand-field-fade-x, 18%) var(--brand-field-fade-y, 12%), #000, transparent 68%);
}

.brand-ambient {
  background:
    radial-gradient(90% 80% at var(--brand-ambient-x, 100%) var(--brand-ambient-y, 0%), var(--glow), transparent 60%),
    var(--surface);
}
.brand-ambient.dual {
  background:
    radial-gradient(60% 60% at 12% 20%, var(--glow), transparent 55%),
    radial-gradient(60% 60% at 92% 96%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 55%),
    var(--surface);
}
.brand-ambient.spotlight {
  background:
    radial-gradient(70% 120% at 50% -20%, var(--glow), transparent 60%),
    var(--surface);
}
.brand-ambient.mesh {
  background:
    radial-gradient(40% 50% at 20% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(45% 55% at 78% 42%, color-mix(in srgb, var(--info) 10%, transparent), transparent 60%),
    radial-gradient(50% 60% at 55% 92%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 62%),
    var(--surface);
}

.brand-watermark::before {
  content: ""; position: absolute; inset: var(--brand-watermark-bleed, -25%);
  background: var(--brand-watermark-ink, var(--ink));
  opacity: var(--brand-watermark-opacity, 0.045);
  transform: rotate(var(--brand-watermark-angle, -20deg)); transform-origin: center;
  -webkit-mask: var(--brand-watermark-mark, var(--brand-mark)) 0 0 / var(--brand-watermark-size, 120px) repeat;
  mask: var(--brand-watermark-mark, var(--brand-mark)) 0 0 / var(--brand-watermark-size, 120px) repeat;
}

.brand-letterhead {
  position: relative; padding: var(--sp-6); background: var(--surface-2);
}
.brand-letterhead::before,
.brand-letterhead::after {
  content: ""; position: absolute; right: -90px; bottom: -90px; width: 360px; height: 360px;
}
.brand-letterhead::before {
  background: var(--accent); opacity: 0.12;
  -webkit-mask: var(--brand-arc) center / contain no-repeat;
  mask: var(--brand-arc) center / contain no-repeat;
}
.brand-letterhead::after {
  background: var(--ink); opacity: 0.06;
  -webkit-mask: var(--brand-tail) center / contain no-repeat;
  mask: var(--brand-tail) center / contain no-repeat;
}
.brand-letterhead-content { position: relative; max-width: 320px; }
.brand-letterhead-title {
  margin-top: var(--sp-7); color: var(--ink); font-family: var(--display);
  font-size: var(--fs-h3); font-weight: 700; line-height: 1.1;
}
.brand-letterhead-copy { margin-top: var(--sp-2); color: var(--ink-dim); font-size: var(--fs-sm); }

.brand-share-card {
  position: relative; width: 100%; max-width: 720px; aspect-ratio: 1200 / 630;
  margin-inline: auto; overflow: hidden; border: 1px solid var(--line-2);
  border-radius: var(--r-lg); background: var(--canvas);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.35);
}
.brand-share-card::before {
  content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0.05;
  -webkit-mask:
    var(--brand-mark) 0 0 / 68px repeat,
    radial-gradient(120% 130% at 100% 100%, #000, transparent 60%);
  -webkit-mask-composite: source-in;
  mask:
    var(--brand-mark) 0 0 / 68px repeat,
    radial-gradient(120% 130% at 100% 100%, #000, transparent 60%);
  mask-composite: intersect;
}
.brand-share-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 100% at 92% 8%, var(--glow), transparent 55%);
}
.brand-share-inner {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  justify-content: space-between; padding: 8% 8% 7%;
}
.brand-share-inner .brand-wordmark { width: 34%; min-width: 150px; }
.brand-share-label {
  color: var(--accent-2); font-size: clamp(9px, 1.8vw, 12px);
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
.brand-share-title {
  margin-top: 2%; color: var(--ink); font-family: var(--display);
  font-size: clamp(24px, 6vw, 44px); font-weight: 800; line-height: 1.02;
}
.brand-share-url { margin-top: 3%; color: var(--ink-dim); font-size: clamp(11px, 2vw, 15px); }

.brand-app-icon {
  --brand-icon-size: 104px; --brand-mark-size: calc(var(--brand-icon-size) * 0.6);
  width: var(--brand-icon-size); height: var(--brand-icon-size);
  display: grid; place-items: center; overflow: hidden; border-radius: var(--r-xl);
}
.brand-app-icon.accent {
  --brand-mark-arc: #f5efe8; --brand-mark-tail: #131110;
  background: linear-gradient(160deg, var(--accent-2), var(--accent) 60%, var(--accent-lo));
  box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.brand-app-icon.dark {
  --brand-mark-arc: var(--accent); --brand-mark-tail: #f5efe8;
  border: 1px solid var(--line-2);
  background: radial-gradient(120% 120% at 30% 20%, #201c19, #131110);
}
.brand-app-icon.light {
  --brand-mark-arc: var(--accent); --brand-mark-tail: #18181a;
  border: 1px solid var(--line-2); background: #fafafa;
}

/* ---------------------------------------------------------------- branded loading */
.brand-loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1 1 100%; width: 100%; min-width: 0;
  gap: var(--sp-3); text-align: center; color: var(--ink); padding: var(--sp-6) 0;
}
.brand-loader p { margin: 0; color: var(--ink-dim); font-size: var(--fs-sm); }
.brand-spinner {
  display: block; flex: none; width: 48px; height: 48px; color: var(--ink);
  animation: brand-spin 1.8s linear infinite; transform-origin: center;
}
.brand-spinner.sm { width: 32px; height: 32px; }
.brand-spinner.lg { width: 72px; height: 72px; }
.brand-spinner .brand-spinner-accent { fill: var(--accent); }
.brand-spinner .brand-spinner-ink { fill: currentColor; }

.brand-loader-mark {
  position: relative; display: block;
  width: var(--brand-loader-size, 56px); height: var(--brand-loader-size, 56px);
  margin-inline: auto;
}
.brand-loader-mark::before,
.brand-loader-mark::after {
  content: ""; position: absolute; inset: 0;
}
.brand-loader-mark::before {
  background: var(--brand-loader-arc, var(--accent));
  -webkit-mask: var(--brand-arc) center / contain no-repeat;
  mask: var(--brand-arc) center / contain no-repeat;
}
.brand-loader-mark::after {
  background: var(--brand-loader-tail, var(--ink));
  -webkit-mask: var(--brand-tail) center / contain no-repeat;
  mask: var(--brand-tail) center / contain no-repeat;
}
.brand-loader-mark.spin { animation: brand-spin 1.4s linear infinite; }
.brand-loader-rail {
  position: relative; width: min(100%, var(--brand-loader-rail-width, 360px));
  height: 44px; margin-inline: auto;
}
.brand-loader-rail::after {
  content: ""; position: absolute; left: 0; right: 0; top: 40px; height: 2px;
  border-radius: var(--r-pill); background: var(--line);
}
.brand-loader-rail.no-line::after { display: none; }
.brand-loader-rail .brand-loader-mark {
  --brand-loader-size: 40px;
  position: absolute; left: 0; top: 0;
  animation: brand-roll 1.8s ease-in-out infinite alternate;
}
.brand-loader-skeleton {
  position: relative; min-height: 230px; padding: var(--sp-5);
}
.brand-loader-skeleton::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  background: var(--ink); opacity: 0.04;
  -webkit-mask: var(--brand-mark) center / contain no-repeat;
  mask: var(--brand-mark) center / contain no-repeat;
}
.brand-skeleton-lines {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-3);
}
.brand-skeleton-lines span {
  height: 14px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--line), var(--line-2), var(--line));
  background-size: 200% 100%; animation: brand-shimmer 1.4s linear infinite;
}
.brand-skeleton-lines span:nth-child(1) { width: 60%; }
.brand-skeleton-lines span:nth-child(2) { width: 90%; }
.brand-skeleton-lines span:nth-child(3) { width: 75%; }
.brand-skeleton-lines span:nth-child(4) { width: 40%; }

@keyframes brand-spin { to { transform: rotate(360deg); } }
@keyframes brand-roll {
  from { left: 0; transform: rotate(0deg); }
  to { left: calc(100% - var(--brand-loader-size, 40px)); transform: rotate(360deg); }
}
@keyframes brand-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-spinner, .brand-loader-mark.spin, .brand-loader-rail .brand-loader-mark,
  .brand-skeleton-lines span {
    animation: none;
  }
}

/* ===========================================================================
   RESPONSIVE - THE standard. Breakpoints: sm 600 · md 768 · lg 1024 · xl 1280.
   Most components already reflow (fluid clamp() type; tables - cards at md;
   forms/segments - 1-col at sm). These are the shared layout primitives so no
   project hand-rolls them again.
   =========================================================================== */

/* container: centred, capped at --maxw, gutter tightens on phones */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
@media (max-width: 600px) { .container { padding-inline: var(--gutter-sm); } }

/* auto-stacking grid - NO breakpoints needed: columns wrap once they can't hold
   --col-min (default 260px). The default for card/tile grids that should reflow. */
.cols { display: grid; gap: 1.4rem; align-content: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col-min, 260px)), 1fr)); }
.cols.tight { --col-min: 200px; gap: 1rem; }
.cols.wide  { --col-min: 320px; }

/* explicit two-up that collapses to one column at md (use when auto-fit won't do) */
.row-md { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
@media (max-width: 768px) { .row-md { grid-template-columns: 1fr; } }

/* responsive visibility */
@media (max-width: 600px) { .hide-sm { display: none !important; } }
.show-sm { display: none; }
@media (max-width: 600px) { .show-sm { display: revert !important; } }

/* touch ergonomics: tappable controls reach the 44px minimum on coarse pointers */
@media (pointer: coarse) {
  .btn, .btn-sm, .icon-btn, .x-btn, .chip, .pager a, .tabs a, .mode-switch button,
  .chip-removable .x, .menu-item, .nav-item {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card:hover, .flow-step:hover, .opt-card:hover { transform: none; }
}
