/* ========================================================================
   WHW Design System · Core · v1.3.0
   ------------------------------------------------------------------------
   Theme-agnostic components. Requires a theme file loaded before or after:
     <link rel="stylesheet" href="whw-ds.css">
     <link rel="stylesheet" href="theme-whw.css">  ← or theme-ollama, theme-touch

   Switch theme at runtime:
     <body data-theme="ollama" data-mode="dark">

   Naming convention (BEM + CUBE CSS):
     l-*      Layout / composition
     c-*      Component
     u-*      Utility
     is-*, has-*  JS state
     js-*     JS hook (no styles)
   ======================================================================== */

/* -- VERSION ----------------------------------------------------------- */
:root {
  --whw-ds-version: 1.3.0;
  --whw-ds-released: 2026-06-12;
}

/* -- RESET ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

/* Color-scheme — override per-theme defaults so light-dark() resolves
   against data-mode and not the user's system preference. Higher
   specificity (body[]) ensures these win over any [data-theme="..."]
   block that also sets color-scheme. */
body[data-mode="light"] { color-scheme: light; }
body[data-mode="dark"]  { color-scheme: dark;  }

html, body { min-height: 100vh; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
button { font: inherit; color: inherit; cursor: pointer; background: transparent; border: 0; }
a { color: inherit; }
ul, ol { list-style: none; }

/* -- LAYOUT COMPOSITIONS ---------------------------------------------- */
.l-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.l-grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--grid-image);
  background-size: var(--grid-size);
  opacity: var(--grid-opacity);
}

.l-app-3col {
  display: grid;
  grid-template-columns: var(--col-left) 1fr var(--col-right);
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  flex: 1 1 auto; min-height: 0;
}
@media (max-width: 1280px) {
  .l-app-3col { grid-template-columns: var(--col-left-md) 1fr var(--col-right-md); }
}
@media (max-width: 1000px) {
  .l-app-3col { grid-template-columns: 1fr; }
}

.l-app-2col {
  display: grid;
  grid-template-columns: var(--col-left) 1fr;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  flex: 1 1 auto; min-height: 0;
}

/* -- HEADER (c-header) ------------------------------------------------- */
.c-header {
  padding: var(--header-pad);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: var(--header-border);
  background: var(--bg-card);
}
.c-logo-group { display: flex; align-items: center; gap: 1rem; }
.c-logo-mark {
  width: 30px; height: 30px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-family: var(--font-sans); font-weight: 700;
  font-size: 14px; letter-spacing: -0.5px;
  border-radius: var(--radius-sm);
}
.c-logo {
  font-family: var(--font-sans); font-weight: 700;
  font-size: 1.4rem; letter-spacing: -1px;
  color: var(--text);
}
.c-logo-tag {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.c-nav { display: flex; align-items: center; gap: 1.25rem; }
.c-nav__link {
  color: var(--text-dim); text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  transition: color .2s;
}
.c-nav__link:hover,
.c-nav__link.is-active { color: var(--accent); }
.c-header__controls { display: flex; align-items: center; gap: 0.5rem; }

.c-theme-toggle {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--bg-input); color: var(--text);
  border-radius: var(--radius-sm);
}
.c-theme-toggle:hover { background: var(--line-soft); }
.c-theme-toggle svg { width: 16px; height: 16px; }


/* -- PANEL (c-panel) --------------------------------------------------- */
.c-panel {
  background: var(--bg-card);
  border: var(--panel-border);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  min-height: 0;
}
.c-panel--subtle { background: var(--bg-subtle); border-color: var(--line); }
.c-panel--sticky { position: sticky; top: var(--space-md); align-self: flex-start; max-height: calc(100vh - 2rem); }

.c-panel__head {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.c-panel__head h3 {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
}
.c-panel__body { overflow: auto; flex: 1 1 auto; padding: 1rem; }

/* -- CARD (c-card) ----------------------------------------------------- */
.c-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  position: relative;
  transition: border-left-color .2s, box-shadow .2s;
}
.c-card.is-active {
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}
.c-card[data-id]::before {
  content: attr(data-id);
  position: absolute; top: -0.40rem; left: 0.75rem;
  /* No background — label sits over whatever's behind (page bg / demo bg
     / panel bg / card-head strip) and inherits visually. The "interrupted
     border" effect is sacrificed in favor of context-portable rendering. */
  /* Float entirely above card top edge — no border-crossing. Transparent
     bg so label inherits whatever's behind (page bg / demo bg / panel
     bg). Works across all themes including technical's hard borders. */
  background: var(--bg-subtle); padding: 0 0.4rem;
  font-family: var(--font-body); font-size: 0.55rem; font-weight: 700;
  border-radius: var(--radius-md);
  letter-spacing: 2px; color: var(--text-dim);
}
.c-card.is-active[data-id]::before { color: var(--accent); }

.c-card__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
  background: var(--bg-subtle);
  margin: -1.1rem -1.25rem 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}
.c-card__title { display: flex; align-items: center; gap: 0.7rem; }
.c-card__ico {
  width: 32px; height: 32px;
  background: var(--bg-input);
  display: grid; place-items: center;
  font-family: var(--font-body); font-weight: 700; font-size: 0.9rem;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.c-card.is-active .c-card__ico { background: var(--accent-soft); color: var(--accent); }
.c-card__title h2 {
  font-family: var(--font-sans); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -0.5px;
  color: var(--text);
}
.c-card__sub { font-family: var(--font-body); font-size: 0.68rem; color: var(--text-dim); margin-top: 2px; }
.c-card__summary { margin-top: 4px; font-family: var(--font-body); font-size: 0.7rem; color: var(--accent); }
.c-card__summary:empty { display: none; }
.c-card__meta { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }

/* Fullscreen state — opt-in, requires JS toggle */
.c-card.is-fullscreen {
  position: fixed; inset: 1.5rem;
  z-index: 100;
  padding: 2rem 2.5rem;
  overflow: auto;
  background: var(--bg-card);
  border: var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: ds-pop-in .2s ease;
}
@keyframes ds-pop-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }

.c-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  display: none;
}
.c-backdrop.is-on { display: block; animation: ds-fade-in .18s ease; }
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* -- LABEL TYPOGRAPHY (shared eyebrow / caps treatment) ---------------- */
/* One source for the tracked uppercase body-label used across buttons,
   badges, segmented + tab controls, lane kinds and inline summaries.
   Each component below keeps only its own font-size / colour. */
.c-btn,
.c-badge,
.c-seg button,
.c-tabs button,
.c-lane__kind,
.c-advanced summary {
  font-family: var(--font-body); font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
}

/* -- BUTTON (c-btn) ---------------------------------------------------- */
.c-btn {
  height: 32px; padding: 0 12px;
  color: var(--text); text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.68rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: all .12s;
}
.c-btn:hover { background: var(--bg-input); box-shadow: inset 0 0 0 1px var(--line-strong); }
.c-btn:active { transform: translateY(1px); }
.c-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.c-btn--primary { background: var(--accent); color: var(--accent-ink, #fff); box-shadow: inset 0 0 0 1px var(--accent); }
.c-btn--primary:hover { background: var(--accent-hover); box-shadow: inset 0 0 0 1px var(--accent-hover); }
.c-btn--ghost { box-shadow: none; color: var(--text-dim); }
.c-btn--ghost:hover { background: var(--bg-input); color: var(--text); box-shadow: none; }
.c-btn--icon { width: 32px; padding: 0; justify-content: center; }
.c-btn--icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-btn--danger { color: var(--danger); }
.c-btn--danger:hover { background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
.c-btn--lg { height: 48px; padding: 0 20px; font-size: 0.78rem; }
/* --armed: the one place orange is allowed ON a button — an armed / irreversible
   action (commit · e-stop · run-active). The most-orange thing on screen; the
   --armed-blink companion pulses while the action is active. Promoted from the
   device kit (was hw-armed). Deliberate exception to "orange is never an action". */
.c-btn--armed { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.c-btn--armed:hover:not(:disabled) { background: var(--accent-hover); }
.c-btn--armed.is-disabled, .c-btn--armed:disabled { opacity: 1; }   /* keep full orange even when demo-disabled */
.c-btn--armed-blink { animation: c-btn-armed-bl .62s steps(1) infinite; }   /* active = pulls the eye */
@keyframes c-btn-armed-bl { 50% { opacity: .42; } }

/* -- BADGE (c-badge) --------------------------------------------------- */
.c-badge {
  font-size: 0.58rem;
  padding: 3px 7px;
  color: var(--text-dim); background: var(--bg-input);
  border-radius: var(--radius-sm);
}
.c-badge--ok     { background: var(--success-soft); color: var(--success); }
.c-badge--warn   { background: var(--warning-soft); color: var(--warning); }
.c-badge--danger { background: var(--danger-soft);  color: var(--danger); }
.c-badge--info   { background: var(--info-soft);    color: var(--info); }
.c-badge--count  { background: var(--text); color: var(--bg); }
.c-badge--accent { background: var(--accent); color: var(--accent-ink, #fff); }

/* -- LED (c-led) — round status indicator ------------------------------ */
/* Promoted from the device kit (was hw-led). A small round indicator with
   TWO colour languages on one shape:
     · single-colour OFF/DIM/ON + blink (the operator/device language) — base
       + --dim/--on/--blink* ; device elements use only these.
     · semantic ok/warn/danger/info (app status) — --ok/--warn/--danger/--info,
       optional --pulse ring. Replaces the old bespoke c-srv__status dot.
   Round = physical part (house rule). */
.c-led          { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none;
                  background: color-mix(in srgb, var(--accent) 12%, transparent); }                  /* OFF */
.c-led--dim,
.c-led--idle    { background: color-mix(in srgb, var(--accent) 42%, transparent); box-shadow: none; }  /* DIM */
.c-led--on,
.c-led--active  { background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent); }  /* ON */
/* blink RATE = urgency (cap ~4, faster blurs) — shared hw-blink keyframe (also hw-cells). */
.c-led--blink   { animation: hw-blink 1.1s steps(1) infinite; }   /* info / „brzy"     */
.c-led--blink-2 { animation: hw-blink .55s steps(1) infinite; }   /* warning           */
.c-led--blink-3 { animation: hw-blink .28s steps(1) infinite; }   /* error             */
.c-led--blink-4 { animation: hw-blink .12s steps(1) infinite; }   /* panic             */
.c-led--unknown { background: color-mix(in srgb, var(--accent) 42%, transparent); animation: hw-blink 1.4s steps(1) infinite; }  /* stale/no-readback */
.c-led--sm      { width: 4px; height: 4px; }                       /* tiny — above a key */
/* semantic variants (app status) — colour via currentColor so --pulse matches */
.c-led--ok      { color: var(--success); }
.c-led--warn    { color: var(--warning); }
.c-led--danger  { color: var(--danger); }
.c-led--info    { color: var(--info); }
.c-led--neutral { color: var(--neutral); }
.c-led--ok, .c-led--warn, .c-led--danger, .c-led--info, .c-led--neutral { background: currentColor; }
.c-led--ok, .c-led--danger { box-shadow: 0 0 6px color-mix(in srgb, currentColor 55%, transparent); }
.c-led--pulse   { animation: c-led-pulse 2.2s ease-in-out infinite; }
@keyframes hw-blink   { 50% { opacity: .12; } }
@keyframes c-led-pulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
                         50%      { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 10%, transparent); } }

/* -- CELLS (c-cells) — addressable LED cell-bar substrate -------------- */
/* Promoted from the device kit (was hw-cells). A flex row of OFF/DIM/ON LED
   cells — the substrate under the device bars (statebar/trim/key-strip). The
   legacy element-scoped names below are grouped in so device markup + painters
   keep working until those elements promote; new code uses .c-cells/.c-cells__cell.
   Blink reuses the c-led hw-blink keyframe. */
.c-cells,
.c-statebar__track,
.c-trim__track,
.hw-key__strip            { display: flex; gap: 2px; width: 100%; height: 9px; }
.c-cells--thin,
.hw-key__strip            { height: 4px; }   /* thin — a strip above a key */
.c-cells__cell,
.c-statebar__cell,
.c-trim__cell,
.hw-key__strip > i        { flex: 1 1 0; background: color-mix(in srgb, var(--accent) 7%, transparent); transition: background .18s, opacity .18s; }   /* OFF */
.c-cells__cell.is-dim,
.c-statebar__cell.is-dim,
.c-trim__cell.is-dim,
.hw-key__strip > i.is-dim  { background: color-mix(in srgb, var(--accent) 38%, transparent); }                                                          /* DIM */
.c-cells__cell.is-on,
.c-statebar__cell.is-on,
.c-trim__cell.is-on,
.hw-key__strip > i.is-on   { background: var(--accent); box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }                        /* ON  */
/* blink overlay — rate = urgency (shared hw-blink keyframe, see c-led). */
.c-cells__cell.is-blink,   .c-statebar__cell.is-blink   { animation: hw-blink 1.1s steps(1) infinite; }   /* info     */
.c-cells__cell.is-blink-2, .c-statebar__cell.is-blink-2 { animation: hw-blink .55s steps(1) infinite; }   /* warning  */
.c-cells__cell.is-blink-3, .c-statebar__cell.is-blink-3 { animation: hw-blink .28s steps(1) infinite; }   /* error    */
.c-cells__cell.is-blink-4, .c-statebar__cell.is-blink-4 { animation: hw-blink .12s steps(1) infinite; }   /* panic    */

/* -- STATEBAR (c-statebar) — authority / countdown bar-graph ----------- */
/* Promoted from the device kit. A hardware-true LED bar-graph: a c-cells track
   whose cells an app-side painter (paintSeg) lights from data-state + --frac.
   OFF=off · DIM=auto · ON=running (full=manual, draining=timed) · blink=problem
   (rate=urgency) · DIM-blink=stale/no-readback (fail-safe). c-statebar only sets
   the segment count; the cells are the shared c-cells substrate. */
.c-statebar { --seg-count: 10; }

/* -- TRIM (c-trim) — centred deviation control ------------------------- */
/* Promoted from the device kit. − / + keys around a c-cells track lit from the
   centre outward: side = sign, count = magnitude (e.g. a setpoint offset).
   The centre tick marks "normal". An app-side painter lights cells from centre. */
.c-trim { display: flex; align-items: center; gap: .5rem; }
.c-trim .c-btn { min-width: 2.1rem; }
.c-trim__bar { flex: 1; position: relative; }
.c-trim__bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); transform: translateX(-50%); pointer-events: none; }
.c-trim__val { font-family: var(--font-mono); font-size: .72rem; color: var(--text); min-width: 3ch; text-align: center; }

/* -- LABEL (c-label) — small device/field caption --------------------- */
/* Promoted from the device kit (was hw-label). Small, dim, lowercase caption.
   Legacy assembly names (hw-preset__label, hw-boost__lbl) grouped in. */
.c-label,
.hw-preset__label,
.hw-boost__lbl { font-size: .58rem; color: var(--text-dim); text-transform: lowercase; }

/* -- DISPLAY (c-display) — device screen head ------------------------- */
/* Promoted from the device kit. Dark "screen": big mono value (accent) + label
   + status LEDs; can hold a c-chart trend. Predefined animations by class:
   is-boot · __val.is-flash · is-alert · --idle. */
.c-display { background: var(--code-bg); border: 1px solid var(--line); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.c-display__top { display: flex; justify-content: space-between; align-items: center; font-size: .62rem; color: var(--text-dim); text-transform: lowercase; }
.c-display__stat { display: flex; align-items: center; gap: 5px; }
.c-display__val { font-family: var(--font-mono); font-weight: 700; font-size: 2.4rem; line-height: 1; letter-spacing: -.02em; color: var(--accent); }
.c-display__unit { font-size: 1.2rem; }
.c-display__sub { font-size: .62rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
@keyframes hw-disp-boot   { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes hw-disp-flash  { 0% { opacity: .12; } 100% { opacity: 1; } }
@keyframes hw-disp-alert  { 50% { background: color-mix(in srgb, var(--accent) 20%, var(--code-bg)); } }
@keyframes hw-disp-breathe{ 50% { opacity: .55; } }
.c-display.is-boot      { animation: hw-disp-boot .6s ease; }
.c-display__val.is-flash { animation: hw-disp-flash .4s ease; }
.c-display.is-alert     { animation: hw-disp-alert .6s steps(1) infinite; }
.c-display--idle .c-display__val { animation: hw-disp-breathe 3s ease-in-out infinite; }
/* fault layout — why (cause) / what (action), the "read" layer of an alert. */
.c-display__why { display: flex; flex-direction: column; gap: .4rem; margin-top: .45rem; }
.c-display__why-line { display: flex; gap: .5rem; font-size: .72rem; line-height: 1.4; }
.c-display__why-k { color: var(--text-dim); min-width: 4ch; text-transform: lowercase; font-size: .62rem; flex: none; }
.c-display__why-v { color: var(--text); }
.c-display__why-v code { color: var(--accent); }
.c-display__act { display: flex; gap: .5rem; margin-top: .55rem; }

/* -- CHART (c-chart) — mini trend sparkline --------------------------- */
/* Promoted from the device kit. A row of bars over time; last bar = ON (current),
   older bars dim. Bar heights set inline. Fits inside c-display. */
.c-chart { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.c-chart i { flex: 1 1 0; background: color-mix(in srgb, var(--accent) 32%, transparent); transition: height .3s; }
.c-chart i:last-child { background: var(--accent); box-shadow: 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }

/* -- GAUGE (c-gauge) — ring readout + setting-change ripple ----------- */
/* Promoted from the device kit. A ring showing a value's share of its range,
   mono value centred. Round = physical part. Ring sweeps via @property --p.
   c-ripple is the designed LED wipe confirming a change (pair with __val.is-flash). */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.c-gauge { position: relative; width: 96px; height: 96px; }
.c-gauge__ring { width: 100%; height: 100%; border-radius: 50%; --p: 50;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--accent) 10%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  transition: --p .6s ease; }
.c-gauge__val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--accent); }
.c-gauge__val small { display: block; text-align: center; font-size: .5rem; color: var(--text-dim); font-weight: 400; text-transform: lowercase; margin-top: 2px; }
.c-gauge__val.is-flash { animation: hw-disp-flash .4s ease; }   /* reuses the c-display flash */
.c-ripple { display: flex; gap: 4px; }
.c-ripple i { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.c-ripple.is-go i { animation: hw-rip .5s ease; }
.c-ripple.is-go i:nth-child(2){ animation-delay: .05s; } .c-ripple.is-go i:nth-child(3){ animation-delay: .1s; }
.c-ripple.is-go i:nth-child(4){ animation-delay: .15s; } .c-ripple.is-go i:nth-child(5){ animation-delay: .2s; }
.c-ripple.is-go i:nth-child(6){ animation-delay: .25s; } .c-ripple.is-go i:nth-child(7){ animation-delay: .3s; }
.c-ripple.is-go i:nth-child(8){ animation-delay: .35s; }
@keyframes hw-rip { 40% { background: var(--accent); box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 60%, transparent); } }

/* -- KNOB (c-knob) — drag-to-set dial --------------------------------- */
/* Promoted from the device kit. Single-colour: value + pointer accent (ON),
   ticks dim with an is-on variant (lit up to value). Round dial = physical part.
   Drag-to-set is app-side. */
.c-knob { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; user-select: none; }
.c-knob__dial { width: 132px; height: 132px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--line);
  box-shadow: inset 0 0 0 6px var(--bg-subtle); position: relative; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.c-knob__dial::after { content: attr(data-value); font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--accent); }
.c-knob__pointer { position: absolute; inset: 0; transition: transform .08s linear; }
.c-knob__pointer::before { content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 14px; margin-left: -1.5px;
  background: var(--accent); border-radius: 2px; box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.c-knob__label { font-size: 0.62rem; color: var(--text-dim); text-transform: lowercase; }
.c-knob__label b { color: var(--text); font-weight: 500; }
.c-knob__ticks { position: absolute; inset: -10px; pointer-events: none; }
.c-knob__ticks i { position: absolute; top: 0; left: 50%; width: 1px; height: 5px; background: color-mix(in srgb, var(--accent) 18%, transparent); transform-origin: 50% 76px; }
.c-knob__ticks i.is-on { background: var(--accent); }

/* -- SEV (c-sev) — severity badge ------------------------------------- */
/* Promoted from the device kit. Names a blink-rate severity; one colour, weight
   via border/fill (info → panic). Pairs with the c-led/c-statebar blink ladder. */
.c-sev { display: inline-block; font-family: var(--font-mono); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; padding: .12rem .4rem; border: 1px solid var(--line-strong); color: var(--text-dim); }
.c-sev--info  { color: var(--text-dim); border-color: var(--line-strong); }
.c-sev--warn  { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.c-sev--error { color: var(--accent); border-color: var(--accent); }
.c-sev--panic { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* -- FORM (c-field, c-input, c-select, c-textarea, c-switch) ---------- */
.c-field { display: flex; flex-direction: column; gap: 0.3rem; }
.c-field__label {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.62rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
}
.c-input, .c-select, .c-textarea {
  height: var(--input-height);
  padding: 0 10px;
  background: var(--bg-input);
  border: 0; outline: none;
  color: var(--text); font: inherit;
  font-family: var(--font-body); font-size: 0.78rem;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-sm);
  transition: box-shadow .15s;
}
.c-input:focus, .c-select:focus, .c-textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.c-textarea { height: auto; min-height: 80px; padding: 8px 10px; }
.c-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 28px;
}

.c-switch { display: flex; align-items: center; gap: 0.6rem; }
.c-switch input {
  appearance: none;
  width: 34px; height: 18px;
  background: var(--line);
  position: relative; cursor: pointer;
  border-radius: 999px;
  transition: background .15s;
}
.c-switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; background: var(--bg-card);
  border-radius: 50%;
  transition: left .15s;
}
.c-switch input:checked { background: var(--accent); }
.c-switch input:checked::after { left: 18px; }
.c-switch label { font-family: var(--font-body); font-size: 0.7rem; color: var(--text); cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* -- MULTI-SELECT (c-multi, c-opt, c-check) --------------------------- */
.c-multi {
  display: grid; gap: 0.4rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.c-opt {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center;
  padding: 0.55rem 0.7rem;
  background: var(--bg-input);
  box-shadow: inset 0 0 0 1px transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
  transition: all .12s;
}
.c-opt:hover { box-shadow: inset 0 0 0 1px var(--line); }
.c-opt.is-sel {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.c-check {
  width: 16px; height: 16px;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1.5px var(--line);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
}
.c-opt.is-sel .c-check,
.c-card__maximize.is-sel .c-check { background: var(--accent); box-shadow: none; }
.c-opt.is-sel .c-check::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid var(--accent-ink, #fff);
  border-bottom: 2px solid var(--accent-ink, #fff);
  transform: rotate(-45deg) translate(1px, -2px);
}

.c-opt__name { font-family: var(--font-sans); font-weight: 600; font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.c-opt__meta { font-family: var(--font-body); font-size: 0.62rem; color: var(--text-dim); margin-top: 2px; }
.c-opt__bytes { font-family: var(--font-body); font-size: 0.58rem; color: var(--text-dim); letter-spacing: 1px; }
.c-opt__glyph {
  font-family: var(--font-body); font-weight: 700; font-size: 0.6rem;
  padding: 1px 5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

/* -- TABS (c-seg, c-tabs) --------------------------------------------- */
.c-seg { display: inline-flex; background: var(--bg-input); padding: 2px; border-radius: var(--radius-sm); }
.c-seg button {
  padding: 5px 10px;
  color: var(--text-dim);
  font-size: 0.65rem;
  border-radius: var(--radius-sm);
}
.c-seg button.is-on { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

.c-tabs {
  display: flex; gap: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.c-tabs button {
  padding: 0.65rem 0.85rem;
  color: var(--text-dim);
  font-size: 0.66rem;
  position: relative; white-space: nowrap;
}
.c-tabs button.is-on { color: var(--accent); }
.c-tabs button.is-on::after {
  content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: -1px;
  height: 2px; background: var(--accent);
}
.c-tabpanel { display: none; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.c-tabpanel.is-on { display: flex; }

/* -- TREE (c-tree) ---------------------------------------------------- */
.c-tree { padding: 0.35rem 0.35rem 1rem; font-family: var(--font-body); }
.c-tree ul { padding-left: 0.9rem; position: relative; }
.c-tree ul::before {
  content: ""; position: absolute; left: 0.25rem; top: 0; bottom: 0;
  border-left: 1px dashed var(--line);
}
.c-tree li { position: relative; }
.c-tree__row {
  display: grid; grid-template-columns: 14px auto 1fr auto; gap: 0.35rem;
  align-items: center;
  padding: 0.22rem 0.4rem;
  cursor: pointer; user-select: none;
  font-size: 0.72rem; color: var(--text);
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.c-tree__row:hover { background: var(--bg-input); }
.c-tree__row.is-sel {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.c-tree__toggle {
  width: 14px; height: 14px; display: grid; place-items: center;
  color: var(--text-dim); font-size: 0.7rem; line-height: 1;
  transition: transform .15s;
}
.c-tree li.is-open > .c-tree__row .c-tree__toggle { transform: rotate(90deg); }
.c-tree li:not(.is-open) > ul { display: none; }
.c-tree li.no-kids > .c-tree__row .c-tree__toggle { visibility: hidden; }
/* .c-tree__glyph — pure CSS dot, neutral node marker.
   Opt-in type modifiers (.c-class / .c-prop / .c-rel) recolor the dot
   for typed trees (e.g. ontology class vs property). Any text content
   inside the span is hidden via font-size: 0. */
.c-tree__glyph {
  width: 14px; height: 14px;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 0;
}
.c-tree__glyph::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.c-tree__row.is-sel .c-tree__glyph { color: var(--accent); }
.c-tree__row.is-sel .c-tree__glyph::before { opacity: 1; }
.c-tree__glyph.c-class { color: var(--brand); }
.c-tree__glyph.c-prop  { color: var(--success); }
.c-tree__glyph.c-rel   { color: var(--info); }
.c-tree__count {
  font-size: 0.54rem; color: var(--text-dim);
  padding: 1px 5px; background: var(--bg-input);
  border-radius: var(--radius-sm);
}
.c-tree__label { font-family: var(--font-sans); font-weight: 600; line-height: 1.2; }

/* -- TABLE (c-table) -------------------------------------------------- */
.c-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-family: var(--font-body); font-size: 0.72rem;
}
.c-table thead th {
  text-align: left; padding: 0.6rem 0.75rem;
  background: var(--bg-subtle);
  font-size: 0.58rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text);
  border-bottom: 2px solid var(--line);
}
.c-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px dashed var(--line-soft);
  vertical-align: top;
}
.c-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-subtle) 50%, transparent); }
.c-table tbody tr:hover { background: var(--bg-input); }
.c-table code {
  font-family: var(--font-mono); font-size: 0.7rem;
  background: var(--bg-input); padding: 1px 5px;
  border-radius: var(--radius-sm);
}
.c-table .t-name { font-family: var(--font-sans); font-weight: 600; color: var(--text); font-size: 0.8rem; }

/* -- CHAT (c-chat, c-msg, c-composer) --------------------------------- */
.c-chat { display: flex; flex-direction: column; min-height: 0; }

.c-messages {
  padding: 0.75rem; overflow: auto; flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.c-msg { font-size: 0.78rem; line-height: 1.55; max-width: 94%; font-family: var(--font-body); }
.c-msg__who {
  font-size: 0.55rem; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px;
}
.c-msg--ai .c-msg__body {
  background: var(--bg-card); border-left: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}
.c-msg--me { align-self: flex-end; }
.c-msg--me .c-msg__body {
  background: var(--accent); color: var(--accent-ink, #fff);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}
.c-msg code {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  padding: 1px 5px; font-size: 0.7rem;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
}
.c-msg--me code { background: rgba(255,255,255,0.2); color: var(--accent-ink, #fff); }

.c-suggest { padding: 0 0.75rem 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.c-suggest button {
  padding: 5px 9px; background: var(--bg-card); color: var(--text-dim);
  font-family: var(--font-body); font-size: 0.6rem;
  border-radius: var(--radius-sm);
}
.c-suggest button:hover { color: var(--accent); }

.c-composer {
  border-top: 1px solid var(--line); padding: 0.5rem;
  display: flex; gap: 0.4rem; align-items: flex-end;
}
.c-composer textarea {
  flex: 1; min-height: 36px; max-height: 140px; resize: none;
  padding: 0.5rem 0.6rem;
  background: var(--bg-card); border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.75rem;
  outline: none;
}
.c-composer textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.c-composer .c-btn { height: 36px; }

/* -- CONTEXT (c-ctx) -------------------------------------------------- */
.c-ctx { padding: 0.6rem 0.75rem 1rem; overflow: auto; flex: 1 1 auto; }
.c-ctx__section { margin-bottom: 0.9rem; }
.c-ctx__section h5 {
  font-family: var(--font-body); font-size: 0.56rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed var(--line);
}
.c-ctx__item {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 0.55rem; align-items: center;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-family: var(--font-body);
}
.c-ctx__item b { font-family: var(--font-sans); font-weight: 700; font-size: 0.76rem; color: var(--text); display: block; line-height: 1.2; }
.c-ctx__item small { display: block; color: var(--text-dim); font-size: 0.6rem; letter-spacing: 0.5px; margin-top: 1px; }
.c-ctx__icon {
  width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--bg-input); color: var(--text-dim);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 700; font-size: 0.6rem;
}
.c-ctx__item.ok     .c-ctx__icon { background: var(--success-soft); color: var(--success); }
.c-ctx__item.warn   .c-ctx__icon { background: var(--warning-soft); color: var(--warning); }
.c-ctx__item.danger .c-ctx__icon { background: var(--danger-soft);  color: var(--danger); }
.c-ctx__item.info   .c-ctx__icon { background: var(--info-soft);    color: var(--info); }
.c-ctx__item.accent .c-ctx__icon { background: var(--accent-soft);  color: var(--accent); }
.c-ctx__val {
  font-family: var(--font-body); font-size: 0.6rem; color: var(--text-dim);
  letter-spacing: 0.5px;
  padding: 2px 6px; background: var(--bg-input);
  border-radius: var(--radius-sm);
}

/* -- COMMANDS (c-cmds) ------------------------------------------------ */
.c-cmds { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.c-cmds__search { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.c-cmds__search input {
  width: 100%; height: 32px; padding: 0 10px;
  background: var(--bg-card); border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-sm);
  color: var(--text); outline: none;
  font-family: var(--font-body); font-size: 0.75rem;
}
.c-cmds__search input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.c-cmds__list { overflow: auto; flex: 1 1 auto; padding: 0.35rem 0.4rem 0.75rem; }
.c-cmds__group h5 {
  font-family: var(--font-body); font-size: 0.56rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim);
  margin: 0.6rem 0.4rem 0.3rem;
}
.c-cmd {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem;
  align-items: center; width: 100%;
  padding: 0.45rem 0.55rem;
  color: var(--text);
  text-align: left;
  border-radius: var(--radius-sm);
}
.c-cmd:hover { background: var(--accent-soft); }
.c-cmd__slash { font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; color: var(--accent); }
.c-cmd__desc { font-family: var(--font-body); font-size: 0.66rem; color: var(--text-dim); }
.c-cmd__kbd {
  font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-dim);
  padding: 2px 6px; background: var(--bg-input);
  border-radius: var(--radius-sm);
  letter-spacing: 1px; white-space: nowrap;
}

/* -- BREADCRUMB (u-breadcrumb) ---------------------------------------- */
.u-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.55rem 1rem;
  font-family: var(--font-body); font-size: 0.65rem;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.u-breadcrumb a, .u-breadcrumb button {
  color: var(--text-dim); text-decoration: none;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  padding: 0;
}
.u-breadcrumb a:hover, .u-breadcrumb button:hover { color: var(--accent); }
.u-breadcrumb b { color: var(--text); font-weight: 700; }
.u-breadcrumb .sep { color: var(--line-strong); }

/* -- YAML / CODE PREVIEW (c-yaml) ------------------------------------- */
.c-yaml {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.6;
  overflow: auto;
  min-height: 120px;
  white-space: pre;
}
.c-yaml .k { color: var(--accent); }
.c-yaml .s { color: var(--success); }
.c-yaml .n { color: var(--info); }
.c-yaml .c { color: var(--text-dim); }

/* -- FOOTER (c-footer) ------------------------------------------------ */
.c-footer {
  padding: 0.6rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-body); font-size: 0.62rem;
  color: var(--text-dim);
}
.c-footer__links { display: flex; align-items: center; gap: 1rem; }
.c-footer a { color: var(--text-dim); text-decoration: none; }
.c-footer a:hover { color: var(--accent); }
.c-footer__version { color: var(--accent); }

/* -- ACTION BAR (c-actionbar) — sticky wizard-style footer ------------ */
.c-actionbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--line-strong);
  padding: 0.75rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem;
  z-index: 20;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}
.c-actionbar__bar { width: 120px; height: 4px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.c-actionbar__bar-fill { height: 100%; background: var(--accent); transition: width .35s ease; }

/* -- SERVICE ROW (c-srv) — for services list ------------------------- */
.c-srv {
  display: grid;
  grid-template-columns: 12px 1fr auto auto auto auto;
  align-items: center; gap: 0.85rem;
  padding: 0.85rem 0.9rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  transition: background .12s;
  position: relative;
}
.c-srv:hover { background: var(--bg-input); }
.c-srv.is-selected { background: var(--accent-soft); }
/* status dot = c-led (semantic variant): running -> c-led--ok c-led--pulse,
   error -> c-led--danger c-led--pulse, paused -> c-led--warn, scheduled ->
   c-led--info, stopped -> c-led--neutral. See the LED (c-led) section. */

/* -- LANE (c-lane) — used for grouped multi-selects ------------------ */
.c-lane {
  padding: 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 0.55rem;
}
.c-lane__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.4rem; }
.c-lane__title { font-family: var(--font-sans); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.c-lane__kind {
  font-size: 0.55rem;
  color: var(--text-dim);
  padding: 2px 6px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.c-lanes { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .c-lanes { grid-template-columns: 1fr; } }

/* -- ADVANCED (c-advanced) — inline details/summary ------------------ */
.c-advanced { margin-top: 0.85rem; }
.c-advanced summary {
  cursor: pointer; user-select: none;
  font-size: 0.68rem;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 4px 0;
  list-style: none;
  transition: color .15s;
}
.c-advanced summary::-webkit-details-marker { display: none; }
.c-advanced summary::before {
  content: "›";
  color: var(--accent); font-family: var(--font-body); font-size: 0.9rem;
  line-height: 1;
  transition: transform .2s;
  display: inline-block;
}
.c-advanced[open] summary::before { transform: rotate(90deg); }
.c-advanced summary:hover { color: var(--accent); }
.c-advanced__body {
  margin-top: 0.6rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: grid; gap: 0.6rem;
}

/* -- SECTION HEAD (c-section-head) — eyebrow + title + lede pattern --
   Marketing/landing section header. The eyebrow's pulse-dot uses its
   own ds-eyebrow-pulse keyframes (opacity-only — different from the
   c-led-pulse box-shadow ring used by a running status dot). */
.c-section-head { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 2rem; }
.c-section-head__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.c-section-head__eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: ds-eyebrow-pulse 2.4s ease-in-out infinite;
}
@keyframes ds-eyebrow-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.c-section-head__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.15; letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 0.75rem; max-width: 28ch;
}
.c-section-head__lede {
  font-family: var(--font-body); font-size: 1rem;
  line-height: 1.55; color: var(--text-dim);
  max-width: 60ch;
}

/* -- ITALIC ACCENT (u-italic-accent) — editorial italic word in heading
   Use inside c-section-head__title or any heading: <h2>How <em class="u-italic-accent">it works</em></h2>.
   Loads Fraunces via --font-italic; falls back to Georgia. */
.u-italic-accent {
  font-family: var(--font-italic); font-style: italic; font-weight: 400;
  color: var(--accent);
}

/* -- COMPARE TABLE (c-compare) — 3-state honest comparison ------------ */
.c-compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-family: var(--font-body); font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.c-compare thead th {
  text-align: center; padding: 1rem 0.75rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.85rem;
  background: var(--bg-subtle); color: var(--text);
  border-bottom: 1px solid var(--line);
}
.c-compare thead th:first-child {
  text-align: left; padding-left: 1.25rem;
  color: var(--text-dim); font-weight: 500;
  font-size: 0.62rem; letter-spacing: 1.5px; text-transform: uppercase;
}
.c-compare thead th.is-us {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}
.c-compare tbody td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px dashed var(--line-soft);
  text-align: center;
}
.c-compare tbody td:first-child {
  text-align: left; padding-left: 1.25rem;
  font-family: var(--font-display); font-weight: 500; color: var(--text);
}
.c-compare tbody td.is-us {
  background: color-mix(in srgb, var(--accent-soft) 65%, transparent);
}
.c-compare tbody tr:last-child td.is-us {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.c-compare tbody tr:last-child td { border-bottom: 0; }
.c-compare__mark {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.85rem; font-weight: 700; line-height: 1;
}
.c-compare__mark--yes  { background: var(--success-soft); color: var(--success); }
.c-compare__mark--part { background: var(--warning-soft); color: var(--warning); }
.c-compare__mark--no   { background: var(--bg-input); color: var(--text-dim); opacity: 0.7; }

/* -- HERO (c-hero) — marketing landing hero pattern ---------------------
   Theme-agnostic component. All sizing/typography/visual treatment driven
   by --hero-* tokens defined per theme. Two-column grid: text left,
   isometric "stack" visual right. Mobile collapses to single column.

   Markup:
     <section class="c-hero">
       <div class="c-hero__text">
         <div class="c-section-head__eyebrow">…</div>
         <h1 class="c-hero__title">Build the <em class="u-italic-accent">design system</em>…</h1>
         <p class="c-hero__lede">…</p>
         <div class="c-hero__cta">
           <a class="c-btn c-btn--primary c-btn--lg">…</a>
           <a class="c-btn c-btn--lg">…</a>
         </div>
       </div>
       <div class="c-hero__visual">
         <div class="c-hero__iso">
           <div class="c-hero__iso-layer">core</div>
           <div class="c-hero__iso-layer">tokens</div>
           <div class="c-hero__iso-layer">themes</div>
           <div class="c-hero__iso-layer">your app</div>
         </div>
       </div>
     </section>

   Theme tokens (per-theme override) — defaults apply if theme doesn't
   set them. Editorial mirrors landing-marketing exactly. Technical is
   denser/sharper. Soft is rounded/modern. Glow leans premium dark.
*/
.c-hero {
  padding: var(--hero-padding-y, 5rem) var(--hero-padding-x, 0) calc(var(--hero-padding-y, 5rem) * 0.45);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: var(--hero-gap, 3rem);
  align-items: center;
}
@media (max-width: 900px) {
  .c-hero {
    grid-template-columns: 1fr;
    padding-top: calc(var(--hero-padding-y, 5rem) * 0.6);
  }
}
.c-hero__text { max-width: 100%; }
.c-hero__title {
  font-family: var(--hero-title-font, var(--font-display));
  font-weight: var(--hero-title-weight, 500);
  font-size: var(--hero-title-size, clamp(2rem, 4.5vw, 3.4rem));
  line-height: var(--hero-title-leading, 1.1);
  letter-spacing: var(--hero-title-tracking, -0.03em);
  color: var(--text);
  margin: 1rem 0 1.25rem;
}
.c-hero__title em { /* italic accent already styled by .u-italic-accent */ }
.c-hero__lede {
  font-family: var(--font-body);
  font-size: var(--hero-lede-size, 0.95rem);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 56ch;
}
.c-hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }

/* -- Hero visual: pure-CSS isometric stack of layers ----------------- */
.c-hero__visual {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: var(--hero-visual-size, 420px);
  margin-left: auto;
  position: relative;
  perspective: 1200px;
  display: grid; place-items: center;
}
.c-hero__iso {
  transform: var(--hero-iso-rotate, rotateX(58deg) rotateZ(-45deg));
  transform-style: preserve-3d;
  width: 70%; height: 70%;
  position: relative;
  animation: ds-hero-iso-float 8s ease-in-out infinite;
}
.c-hero__iso-layer {
  position: absolute; inset: 0;
  background: var(--hero-iso-layer-bg, var(--bg-card));
  border: var(--hero-iso-layer-border, 1px solid var(--line));
  border-radius: var(--hero-iso-layer-radius, var(--radius-lg));
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  font-family: var(--font-body);
  font-size: 0.6rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim);
}
.c-hero__iso-layer:nth-child(1) { transform: translateZ(0px); }
.c-hero__iso-layer:nth-child(2) { transform: translateZ(28px); }
.c-hero__iso-layer:nth-child(3) { transform: translateZ(56px); }
.c-hero__iso-layer:nth-child(4) {
  transform: translateZ(84px);
  background: var(--hero-iso-top-bg, var(--accent));
  color: var(--hero-iso-top-color, var(--accent-ink));
  border-color: transparent;
}
@keyframes ds-hero-iso-float {
  0%, 100% { transform: var(--hero-iso-rotate, rotateX(58deg) rotateZ(-45deg)) translateZ(0); }
  50%      { transform: var(--hero-iso-rotate, rotateX(58deg) rotateZ(-45deg)) translateZ(8px); }
}
/* Orbiting accent dots (decorative, optional — present on .c-hero__visual) */
.c-hero__visual::before, .c-hero__visual::after {
  content: ""; position: absolute;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent); opacity: 0.5;
  animation: ds-hero-orbit 8s linear infinite;
}
.c-hero__visual::before { top: 20%; left: 15%; }
.c-hero__visual::after  { bottom: 18%; right: 18%; animation-direction: reverse; animation-duration: 10s; }
@keyframes ds-hero-orbit {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(20px, -10px); }
  50%  { transform: translate(0, 10px); }
  75%  { transform: translate(-15px, -5px); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .c-hero__iso, .c-hero__visual::before, .c-hero__visual::after { animation: none; }
}

/* -- TIMELINE (c-timeline) — vertical release / changelog list ----------
   Levá osa 2px line + accent ring na každém item. První item zvýrazněn
   plným accent fill + halo (latest release pattern). Markup:

     <ul class="c-timeline">
       <li class="c-timeline__item">
         <div class="c-timeline__head">
           <span class="c-timeline__ver">v0.4.0</span>
           <span class="c-timeline__date">2026-05-01</span>
           <span class="c-badge c-badge--accent">latest</span>
         </div>
         <p>Release description.</p>
       </li>
       …
     </ul>
*/
.c-timeline {
  list-style: none; margin: 0; padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--line);
  position: relative;
}
.c-timeline > * { min-width: 0; }
.c-timeline__item {
  position: relative;
  padding: .85rem 1rem 1.1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform .15s;
}
.c-timeline__item:hover { transform: translateX(4px); }
.c-timeline__item::before {
  content: ""; position: absolute;
  left: -1.85rem; top: 1.1rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.c-timeline__item:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.c-timeline__head {
  display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .35rem;
}
.c-timeline__ver {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1rem; color: var(--text);
}
.c-timeline__date {
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--text-dim);
}
.c-timeline__item p {
  font-family: var(--font-body); font-size: .84rem;
  line-height: 1.5; color: var(--text-dim);
  margin: 0;
}

/* -- FAQ (c-faq) — accordion using native <details>/<summary> ------------
   Stack of expandable Q&A items. Plus → × rotace na open, accent border
   highlight na open item. Markup:

     <div class="c-faq">
       <details>
         <summary>Question?</summary>
         <div class="c-faq__body">Answer…</div>
       </details>
       …
     </div>
*/
.c-faq { display: grid; gap: .55rem; max-width: 780px; }
.c-faq details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .2s;
}
.c-faq details[open] { border-color: var(--accent); }
.c-faq summary {
  padding: 1rem 1.25rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: .95rem; color: var(--text);
  cursor: pointer; user-select: none;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.c-faq summary::-webkit-details-marker { display: none; }
.c-faq summary::after {
  content: "+";
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--bg-input); color: var(--text-dim);
  border-radius: 50%;
  font-size: 1rem; font-weight: 500; line-height: 1;
  transition: transform .25s, background .25s, color .25s;
  flex-shrink: 0;
}
.c-faq details[open] summary::after {
  transform: rotate(45deg);
  background: var(--accent); color: var(--accent-ink, #fff);
}
.c-faq__body {
  padding: 0 1.25rem 1.1rem;
  font-family: var(--font-body); font-size: .88rem;
  line-height: 1.6; color: var(--text-dim);
}

/* -- ONBOARDING CARD (c-onboard) — numbered marketing card -----------
   Use inside <ol class="c-onboard-grid"> — counter is auto-incremented
   and rendered as 01/02/03 via CSS counter. NOT to be confused with
   .c-step (sticky wizard rail in service-detail example). */
.c-onboard-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: c-onboard;
  list-style: none; padding: 0; margin: 0;
}
@media (max-width: 800px) { .c-onboard-grid { grid-template-columns: 1fr; } }
.c-onboard {
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  position: relative;
  counter-increment: c-onboard;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.c-onboard:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.c-onboard::before {
  content: "0" counter(c-onboard);
  font-family: var(--font-display); font-weight: 600;
  font-size: 3rem; line-height: 1; letter-spacing: -2px;
  color: var(--accent); opacity: 0.25;
  display: block; margin-bottom: 0.75rem;
}
.c-onboard h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.1rem; letter-spacing: -0.5px;
  color: var(--text); margin-bottom: 0.4rem;
}
.c-onboard p {
  font-family: var(--font-body); font-size: 0.84rem;
  line-height: 1.5; color: var(--text-dim);
}
.c-onboard__code {
  margin-top: 0.85rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-subtle);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--accent);
  overflow-x: auto; white-space: nowrap;
}

/* -- STICKY HEADER (c-header--sticky) — translucent + blur scroll header */
.c-header--sticky {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
}

/* -- CTA PANEL (c-cta-panel) — final marketing call-to-action -------- */
.c-cta-panel {
  margin: 4rem 0 5rem;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.c-cta-panel--compact { padding: 2.5rem 2rem; margin: 4rem 0 5rem; }
.c-cta-panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%,
    color-mix(in srgb, var(--accent) 18%, transparent) 0%,
    transparent 58%);
  pointer-events: none;
}
.c-cta-panel > * { position: relative; z-index: 1; }
.c-cta-panel h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 0.85rem;
}
.c-cta-panel--compact h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin-bottom: 0.75rem; }
.c-cta-panel p {
  font-family: var(--font-body); font-size: 1rem;
  color: var(--text-dim);
  max-width: 50ch; margin: 0 auto 1.75rem;
}
.c-cta-panel--compact p { font-size: 0.95rem; margin-bottom: 1.5rem; }
.c-cta-panel__row { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.c-cta-panel__hint {
  margin-top: 1rem;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-dim); letter-spacing: 1px;
}
.c-cta-panel__hint code {
  color: var(--accent);
  background: var(--bg-subtle);
  padding: 1px 6px; border-radius: var(--radius-sm);
}

/* -- REVEAL ON SCROLL (.reveal) — gated on <html class="js"> ----------
   Requires document.documentElement.classList.add('js') before paint
   (or use WHW.initReveal which adds it). Without that gate, no-JS
   visitors see content immediately. */
.js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* -- ICON EFFECTS (.c-ico--*) — SF-Symbols-style, opt-in on an icon <svg> ----
   Default sprite icons stay monochrome via currentColor. These add motion, a
   hierarchical signal meter, and variableColor reveal. They work even through
   <use href> because they drive INHERITED CSS custom properties (which cross
   the <use> shadow boundary), not child selectors (which don't reach into it).

     <svg class="c-ico--spin"><use href="icons.svg#refresh"/></svg>
     <svg fill="currentColor" class="c-ico--sig-3"><use href="icons.svg#signal"/></svg>
     <svg class="c-ico--vc"><use href="icons.svg#wifi"/></svg>                        */
.c-ico--solid { fill: currentColor; stroke: none; }

/* animations */
.c-ico--spin   { animation: c-ico-spin 1.1s linear infinite; transform-origin: 50% 50%; }
.c-ico--pulse  { animation: c-ico-pulse 1.3s ease-in-out infinite; }
.c-ico--wiggle { animation: c-ico-wiggle 1s ease-in-out infinite; transform-origin: 50% 15%; }
.c-ico--bounce { animation: c-ico-bounce 1.1s ease-in-out infinite; }
@keyframes c-ico-spin   { to { transform: rotate(360deg); } }
@keyframes c-ico-pulse  { 50% { opacity: .35; } }

/* device: fan speed — rotation RATE encodes speed (the LED-language "rate =
   magnitude" rule, cf. c-led--blink-N). Pair with #fan; no class = off/static. */
.c-ico--fan-1, .c-ico--fan-2, .c-ico--fan-3 {
  animation: c-ico-spin var(--c-ico-fan-dur) linear infinite; transform-origin: 50% 50%;
}
.c-ico--fan-1 { --c-ico-fan-dur: 2.4s; }   /* low  */
.c-ico--fan-2 { --c-ico-fan-dur: 1.3s; }   /* med  */
.c-ico--fan-3 { --c-ico-fan-dur: .7s;  }   /* high */

/* device: pump / compressor running — spin RATE = load (same rule as the fan;
   the casing is rotation-invariant so only the impeller reads as turning).
   Pair with #pump; no class = stopped. */
.c-ico--pump-1, .c-ico--pump-2, .c-ico--pump-3 {
  animation: c-ico-spin var(--c-ico-pump-dur) linear infinite; transform-origin: 50% 50%;
}
.c-ico--pump-1 { --c-ico-pump-dur: 2.4s; }  /* light load */
.c-ico--pump-2 { --c-ico-pump-dur: 1.3s; }  /* mid load   */
.c-ico--pump-3 { --c-ico-pump-dur: .7s;  }  /* heavy load */

/* device: heating / cooling active — the actuator is currently working. A
   breathing glow (the LED-ON look, pulsing): warm for heat, cold for cool.
   Pair with #flame / #snowflake; idle = no class = flat. */
.c-ico--heat, .c-ico--cool { animation: c-ico-glow 1.8s ease-in-out infinite; }
.c-ico--heat { color: var(--accent); --c-ico-glow: var(--accent); }      /* warm (orange = state, never action) */
.c-ico--cool { color: var(--info);   --c-ico-glow: var(--info);   }      /* cold */
@keyframes c-ico-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); opacity: .8; }
  50%      { filter: drop-shadow(0 0 4px var(--c-ico-glow)); opacity: 1; }
}
@keyframes c-ico-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(9deg); } 75% { transform: rotate(-9deg); } }
@keyframes c-ico-bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }

/* signal strength meter (hierarchical) — pair with #signal + fill="currentColor".
   Bars default to .18 opacity; c-ico--sig-N lights the first N via custom props. */
.c-ico--sig-1 { --c-ico-b1: 1; }
.c-ico--sig-2 { --c-ico-b1: 1; --c-ico-b2: 1; }
.c-ico--sig-3 { --c-ico-b1: 1; --c-ico-b2: 1; --c-ico-b3: 1; }
.c-ico--sig-4 { --c-ico-b1: 1; --c-ico-b2: 1; --c-ico-b3: 1; --c-ico-b4: 1; }

/* variableColor reveal — pair with #wifi. Its layers carry c-ico__vc1..4 (reveal
   order, centre→out). Inert until c-ico--vc sets the animation NAME. */
.c-ico__vc1, .c-ico__vc2, .c-ico__vc3, .c-ico__vc4 {
  animation-name: var(--c-ico-vc, none);
  animation-duration: 1.6s; animation-timing-function: steps(1);
  animation-iteration-count: infinite;
}
.c-ico__vc1 { animation-delay: 0s; }
.c-ico__vc2 { animation-delay: .18s; }
.c-ico__vc3 { animation-delay: .36s; }
.c-ico__vc4 { animation-delay: .54s; }
.c-ico--vc { --c-ico-vc: c-ico-vc; }
@keyframes c-ico-vc { 0% { opacity: .2; } 50%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .c-ico--spin, .c-ico--pulse, .c-ico--wiggle, .c-ico--bounce,
  .c-ico--fan-1, .c-ico--fan-2, .c-ico--fan-3, .c-ico--heat, .c-ico--cool,
  .c-ico--pump-1, .c-ico--pump-2, .c-ico--pump-3,
  .c-ico__vc1, .c-ico__vc2, .c-ico__vc3, .c-ico__vc4 { animation: none; }
}
