/* ==========================================================================
   sneck - design system + board/rail/detail/auth surfaces
   --------------------------------------------------------------------------
   Hand-written, no bundler. Tokens live on :root; every surface file
   (palette.css, list.css, subissues.css) builds on them.

   Type     Space Grotesk (display) + Instrument Sans (body) - vendored
            woff2 in ./fonts/ (OFL 1.1, see fonts/OFL.txt).
   Color    Deep blue-gray elevation scale (--bg-0..--bg-3), one mint
            accent, semantic + workflow-status hues.
   Motion   120–160ms ease; nothing slower except progress fills.
   ========================================================================== */

/* -- fonts (vendored, subsets) ---------------------------------------------- */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -- tokens ------------------------------------------------------------------- */

:root {
  /* Elevation scale - deep, subtly blue-gray */
  --bg-0: #0b0d10; /* the page bed */
  --bg-1: #101318; /* panels: rail, columns, modals */
  --bg-2: #151a21; /* raised: cards, inputs, bubbles */
  --bg-3: #1c222c; /* highest: hover, segmented tracks, popovers */

  --border: #232936;
  --border-strong: #313a4a;

  --text: #e9edf3;
  --text-2: #b9c2ce;
  --muted: #8791a1;
  --faint: #5e6877;

  /* One accent - mint - plus semantic hues */
  --accent: #3fdd9a;
  --accent-bright: #66e9b3;
  --accent-dim: #2a6b52;
  --accent-ink: #06231a;
  --accent-soft: rgba(63, 221, 154, 0.09);
  /* Primary-button disabled: the one place muted dark green lives */
  --primary-disabled-bg: #1d3a2f;
  --primary-disabled-text: #6d8a7d;

  --success: #3fdd9a;
  --warning: #e3b341;
  --danger: #e5534b;
  --info: #6cb6ff;

  /* Washed status surfaces (RATIFIED into the language 2026-10-05 —
     the instance-admin lane flagged the gap, worked around it with
     color-mix; the workaround pattern is now the token). The wash
     recipe: the hue at low alpha over transparent, so it composes
     with every tier's background. The -text pairings are the theme-
     safe foregrounds for text ON the washes. */
  --success-wash: color-mix(in srgb, var(--success) 9%, transparent);
  --success-wash-border: color-mix(in srgb, var(--success) 32%, transparent);
  --success-text: var(--success);
  --warning-wash: color-mix(in srgb, var(--warning) 10%, transparent);
  --warning-wash-border: color-mix(in srgb, var(--warning) 35%, transparent);
  --warning-text: #d9a833;

  /* Workflow status hues (backlog is sand - visitors at anchor) */
  --status-backlog: #d9c08a;
  --status-todo: #8b95a5;
  --status-in_progress: #6cb6ff;
  --status-done: #3fdd9a;
  --status-canceled: #e5534b;

  /* Derived tints, scrims and inks - everything a light theme needs to
     re-point. The white/black "lift" is the direction chip text and
     washes tint toward: white on dark, black on light. */
  --lift: white;
  --focus-halo: rgba(63, 221, 154, 0.18);
  /* ONE focus ring, everywhere, keyboard-only: a 2px bed-colored gap
     then a 2px accent halo - reads as a ring on any tier. Expressed in
     vars so light needs no override (the gap uses light's own bed). */
  --focus-ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);
  --scrollbar-thumb: #2b3444;
  --scrollbar-thumb-hover: #39445a;
  /* Popovers are elevation tier 2 by contract; the legacy name stays
     (surfaces reference it) and now resolves to the tier token. */
  --popover-shadow: var(--shadow-2);
  --wash-2: rgba(255, 255, 255, 0.02);
  --wash-3: rgba(255, 255, 255, 0.03);
  --wash-4: rgba(255, 255, 255, 0.04);
  --wash-5: rgba(255, 255, 255, 0.05);
  --wash-6: rgba(255, 255, 255, 0.06);
  --hero-glow: rgba(63, 221, 154, 0.045);
  --hero-glow-strong: rgba(63, 221, 154, 0.07);
  --scrim: rgba(5, 8, 10, 0.55);
  --scrim-strong: rgba(6, 8, 11, 0.55);
  --bar-panel: rgba(21, 26, 33, 0.82);
  --danger-wash: rgba(229, 83, 75, 0.1);
  --danger-wash-strong: rgba(229, 83, 75, 0.12);
  --danger-border: rgba(229, 83, 75, 0.4);
  --danger-border-soft: rgba(229, 83, 75, 0.35);
  --danger-text: #f2a6a9;
  --danger-text-dim: #f2938d;
  --danger-text-soft: #e39aa7;
  --warning-wash: rgba(227, 179, 65, 0.1);
  --warning-border: rgba(227, 179, 65, 0.35);
  --merged: #d6a4f2;
  --merged-border: rgba(214, 164, 242, 0.4);
  --avatar-ring: rgba(255, 255, 255, 0.14);
  --avatar-ring-soft: rgba(255, 255, 255, 0.12);
  /* AA (a11y pass): initials ink on the arbitrary avatar palette -
     #06231a measured 4.48:1 on the red dot (#e5534b), one hair under
     AA; this near-black green clears it (~5.1:1) and stays darker
     still on the mint/azure/amber dots. */
  --avatar-ink: #04160d;
  --shadow-soft: 0 6px 18px rgb(0 0 0 / 22%);
  --shadow-soft-2: 0 10px 30px rgb(0 0 0 / 25%);
  --shadow-soft-3: 0 12px 32px rgba(0, 0, 0, 0.35);
  --todo-wash: rgba(139, 149, 165, 0.12);
  --todo-border: #38404c;
  --sheet-shadow: 0 -14px 44px rgba(3, 6, 10, 0.55);
  --shadow-soft-4: 0 14px 40px rgb(0 0 0 / 35%);

  /* Label-chip text: user label colors are arbitrary mid/bright hues
     chosen against dark, so the ink is a MIX of the chip hue and the
     lift. Dark brightens (78% + white); light must darken much harder
     to reach ink-on-paper (see the light override below). */
  --chip-ink: color-mix(in srgb, var(--chip, var(--muted)) 78%, var(--lift));

  /* Radii - the contract scale. The legacy --radius-* names alias into
     it (older surface sheets still read them; values refine, names
     never die): --radius-lg rides 16 -> 14 with the v2 language. */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);

  /* The IA extension (v2.1, notes/makeover_ia_extension.md) - the
     three-zone shape: the 232px rail collapsing to a 48px icon strip,
     the tree's two indents, the view-switcher row. Theme-agnostic
     geometry, so :root is their only home. */
  --rail-w: 232px;
  --rail-w-collapsed: 48px;
  --tree-indent-1: 20px;
  --tree-indent-2: 36px;
  --tab-h: 30px;

  /* Elevation - depth is EXPLICIT, never ad-hoc: cards on the bed ride
     tier 1, popovers tier 2, modals tier 3. Tuned per theme (light
     re-points below with ink-tinted paper shadows). */
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.28);
  --shadow-2: 0 4px 12px rgb(0 0 0 / 0.34);
  --shadow-3: 0 12px 32px rgb(0 0 0 / 0.44);

  /* Spacing - the 4px rhythm, named. The legacy --space-* scale
     aliases the same steps (24 and 32 land on sp-6/sp-7). */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --space-1: var(--sp-1);
  --space-2: var(--sp-2);
  --space-3: var(--sp-3);
  --space-4: var(--sp-4);
  --space-5: var(--sp-6);
  --space-6: var(--sp-7);

  /* Motion - two durations, one curve. --t-fast/--t-med are the legacy
     aliases (surfaces reference them); they now carry the contract
     curve. Progress fills keep their own slower --t-fill. */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --t-fast: var(--dur-fast) var(--ease);
  --t-med: var(--dur-base) var(--ease);
  --t-fill: 340ms cubic-bezier(0.22, 0.68, 0.32, 1);

  /* Type scale - sizes with paired line-heights (font: <size>/<lh>).
     Roles (§3.5): titles lg/600, section headers base/600, body base,
     secondary sm via --text-2, meta/kbd xs via --muted.
     --size-2xs (10px) RATIFIED by the integrator 2026-10-04: dense
     metadata chrome - badge counts, whisper labels - the floor under
     xs; M3's former 9-10.5px literals swept onto it. */
  --size-2xs: 10px;
  --lh-2xs: 1.4;
  --size-xs: 11px;
  --lh-xs: 1.45;
  --size-sm: 12.5px;
  --lh-sm: 1.5;
  --size-base: 13.5px;
  --lh-base: 1.55;
  --size-md: 15px;
  --lh-md: 1.5;
  --size-lg: 18px;
  --lh-lg: 1.4;
  --size-xl: 22px;
  --lh-xl: 1.3;

  /* Type */
  --font-display: 'Space Grotesk', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* Legacy aliases - older surfaces (oauth inline styles) still read these */
  --bg: var(--bg-0);
  --panel: var(--bg-1);
  --panel-2: var(--bg-2);

  color-scheme: dark;
}

/* -- light theme -----------------------------------------------------------------
    Dark is the default (no attribute, zero regression); light opts in
    via html[data-theme="light"], set pre-paint by the root layout's
    bootstrap script from localStorage ("sneck-theme" = "light").

    The palette mirrors the dark hue relationships on paper: the same
    blue-gray family (ink #1a212b on #f5f6f8 ≈ 15:1, AA+), the same
    mint accent deepened to #0b7250 so it can carry TEXT (6.0:1 on
    white - the dark mint #3fdd9a is a light-mode whisper, not ink),
    the same amber/rose/azure semantics at paper-safe depths. Nothing
    neon: the washes are 3–8% ink, the shadows are soft, the scrims
    stay gray-blue. The landing pins itself back to dark (landing.css).
    Contrast notes (vs --bg-2 white unless stated):
      text 15.0:1 · text-2 9.6:1 · muted 5.3:1 · faint ~3.6:1 (10–11px
      metadata whispers - 2.9:1 in dark by design, light runs a touch
      safer) · accent 6.0:1 · danger 6.0:1 · info 5.3:1
      · warning 6.0:1 · status-backlog 5.3:1 · the age/health chips
      hold ≥4.5:1 even ON their 8–12% washes · border-strong 1.6:1
      (hairlines pair with fills; interactive edges ride --accent-dim
      3.5:1, the WCAG 1.4.11 UI boundary). */
html[data-theme="light"] {
  color-scheme: light;

  --bg-0: #f5f6f8; /* the page bed - paper */
  --bg-1: #fdfdfe; /* panels: rail, columns, modals */
  --bg-2: #ffffff; /* raised: cards, inputs, bubbles */
  --bg-3: #eceff3; /* hover, segmented tracks, popovers */

  --border: #dfe3ea;
  --border-strong: #c9d1dc;

  --text: #1a212b;
  --text-2: #3d4756;
  --muted: #626d7d;
  --faint: #79848f;

  --accent: #0b7250;
  --accent-bright: #096748;
  --accent-dim: #3a9e6f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 114, 80, 0.08);
  --primary-disabled-bg: #e4ece8;
  --primary-disabled-text: #7e988c;

  --success: #0b7250;
  --warning: #825c00;
  /* light-theme text-on-wash pairings (the washes compose; the TEXT
     must meet AA on paper) */
  --success-text: #0b7250;
  --warning-text: #825c00;
  --danger: #ad3d35;
  --info: #0b6bcb;

  --status-backlog: #82683a;
  --status-todo: #5f6b7c;
  --status-in_progress: #0b6bcb;
  --status-done: #0b7250;
  --status-canceled: #ad3d35;

  /* The derived set - same relationships, paper values */
  --lift: black;
  --focus-halo: rgba(11, 114, 80, 0.16);
  --scrollbar-thumb: #c6cdd7;
  --scrollbar-thumb-hover: #aeb7c3;
  --popover-shadow: var(--shadow-2);
  --wash-2: rgba(26, 32, 43, 0.03);
  --wash-3: rgba(26, 32, 43, 0.045);
  --wash-4: rgba(26, 32, 43, 0.06);
  --wash-5: rgba(26, 32, 43, 0.07);
  --wash-6: rgba(26, 32, 43, 0.08);
  --hero-glow: rgba(11, 114, 80, 0.05);
  --hero-glow-strong: rgba(11, 114, 80, 0.06);
  --scrim: rgba(23, 30, 40, 0.45);
  --scrim-strong: rgba(23, 30, 40, 0.45);
  --bar-panel: rgba(253, 253, 254, 0.86);
  --danger-wash: rgba(184, 67, 58, 0.08);
  --danger-wash-strong: rgba(184, 67, 58, 0.1);
  --danger-border: rgba(184, 67, 58, 0.4);
  --danger-border-soft: rgba(184, 67, 58, 0.35);
  --danger-text: #a63a32;
  --danger-text-dim: #a63a32;
  --danger-text-soft: #a63a32;
  --warning-wash: rgba(143, 100, 0, 0.09);
  --warning-border: rgba(143, 100, 0, 0.35);
  --merged: #7a4fb0;
  --merged-border: rgba(122, 79, 176, 0.4);
  --avatar-ring: rgba(255, 255, 255, 0.14);
  --avatar-ring-soft: rgba(255, 255, 255, 0.12);
  --avatar-ink: #04160d;
  --shadow-soft: 0 6px 18px rgba(26, 32, 43, 0.12);
  --shadow-soft-2: 0 10px 30px rgba(26, 32, 43, 0.14);
  --shadow-soft-3: 0 12px 32px rgba(26, 32, 43, 0.16);
  --todo-wash: rgba(95, 107, 124, 0.12);
  --todo-border: #c9d1dc;
  --sheet-shadow: 0 -14px 44px rgba(26, 32, 43, 0.18);
  --shadow-soft-4: 0 14px 40px rgba(26, 32, 43, 0.16);

  /* Paper chips need a heavier hand: a bright label hue (#76e3ea cyan)
     at 78% + black still reads ~2:1 on paper - 52% reaches ~6:1 and
     keeps the hue readable. */
  --chip-ink: color-mix(in srgb, var(--chip, var(--muted)) 52%, black);

  /* Elevation is shadow-led on paper, not lightness-led - the paper
     ladder's steps are hairlines apart (the getting-started lesson),
     so tier separation rides borders + these ink-tinted shadows. */
  --shadow-1: 0 1px 2px rgb(16 24 40 / 0.08);
  --shadow-2: 0 4px 12px rgb(16 24 40 / 0.12);
  --shadow-3: 0 12px 32px rgb(16 24 40 / 0.18);
}

/* -- base ---------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  /* keeps centered layouts from shifting when a modal locks scroll */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

/* Scroll lock while any modal is open (progressive enhancement) */
body:has(.modal-root) {
  overflow: hidden;
}

/* Focus - ONE ring, everywhere, keyboard-only (§3.2): the outline is
   replaced, never removed, by the --focus-ring halo (2px bed gap +
   2px accent). Text inputs still show it on mouse focus because form
   controls always match :focus-visible. Elements that carry a tier
   shadow of their own re-declare the ring just below their component
   rule so the ring wins the cascade while focused (box-shadow is not
   additive) - the sweep keeps that list short. */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Motion kill-switch (§3.3): durations collapse to 0.01ms for users
   who ask for less motion. Every enter/exit and hover transition in
   the system rides --dur-fast/--dur-base + --ease, so this one block
   covers the lot; !important beats any later per-surface shorthand.
   NOTE (wave 35 R2): this block STAYS in app.css - the a11y suite
   pins it here - while the rest of the global animation wiring moved
   to reactive.css, which ships an EXTENDED copy (the animation-delay
   reset the stagger vocabulary needs). The two agree on doctrine. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen-reader-only text (the a11y pass's utility): names otherwise
   empty table headers, etc. Same recipe as cycles.css's local copy,
   promoted to the system level. */
.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;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Thin, dark custom scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* -- form primitives ----------------------------------------------------------- */

input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-3);
  line-height: var(--lh-sm);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

select:not([multiple]) {
  min-height: 30px;
  vertical-align: middle;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:hover:not(:focus-visible),
select:hover:not(:focus-visible),
textarea:hover:not(:focus-visible) {
  border-color: var(--border-strong);
}

/* The focus diet for form controls: no always-on glow - the global
   :focus-visible recipe above draws the ring. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  line-height: var(--lh-base);
}

/* Single selects: custom chevron (multi-selects keep their native list) */
select:not([multiple]) {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238791a1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* The chevron glyph is baked into a data-URI, so a var() can't reach
   it - light mode re-issues the same SVG with the paper-muted stroke. */
html[data-theme="light"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23626d7d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select option {
  background: var(--bg-2);
  color: var(--text);
}

/* -- button primitives --------------------------------------------------------- */

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--size-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* ONE primary: bright mint, near-black ink, 600 weight. Add, Comment,
   Sign in, Create project - every "go" button on every surface. */
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}

/* The ring replaces the tier shadow while focused (box-shadow is not
   additive) - the one refinement the global :focus-visible rule needs
   on shadow-carrying interactives. */
.btn-primary:focus-visible {
  box-shadow: var(--focus-ring);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
}

/* Muted dark-green is the DISABLED state of a primary - never an
   enabled look. */
.btn-primary:disabled {
  background: transparent;
  color: var(--faint);
  border: 1px solid var(--border);
  box-shadow: none;
  cursor: default;
}

/* ONE ghost recipe: transparent, hairline border, muted text; hover
   lifts the border toward the accent and the text to full contrast.
   Every quiet secondary button (modal Cancel, cycle rollover, load
   more, clear-all, the dashed rail/toolbar chips) speaks this. */
.btn-ghost,
button.quiet,
.cycle-btn,
.load-more,
.clear-all,
.rail-new {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled),
button.quiet:hover:not(:disabled),
.cycle-btn:hover:not(:disabled),
.load-more:hover:not(:disabled),
.clear-all:hover:not(:disabled),
.rail-new:hover:not(:disabled) {
  border-color: var(--accent-dim);
  color: var(--text);
  background: var(--wash-2);
}

.btn-ghost:disabled,
button.quiet:disabled,
.cycle-btn:disabled,
.load-more:disabled,
.clear-all:disabled,
.rail-new:disabled {
  opacity: 0.4;
}

.kbd {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 0 var(--sp-1);
  font-size: var(--size-xs);
  font-family: var(--font-mono);
  color: var(--muted);
  line-height: 1.6;
}

/* Platform-aware keybind display: body.mac shows ⌘, body.pc shows Ctrl.
   The Layouts helper sets the body class from the User-Agent (its
   fallback is "pc"). Two invariants (E2E B6):
   - the off-platform hides are body-scoped (0-2-0) so the
     equally-specific `.kbd` rule above can never un-hide them by
     source order - keep them scoped, never bare;
   - this block sits AFTER `.kbd` so the no-body-class fallback (hide
     the mac glyph, show the pc one - the helper's own default) also
     resolves by order. Exactly one keycap ever renders. */
.kbd-mac { display: none; }
body.mac .kbd-mac,
body.pc .kbd-pc { display: inline-flex; }
body.mac .kbd-pc,
body.pc .kbd-mac { display: none; }

/* ==========================================================================
   App shell (root layout chrome)
   ========================================================================== */

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-8);
  background:
    radial-gradient(1100px 480px at 50% -120px, var(--hero-glow), transparent 65%),
    var(--bg-0);
  min-height: 100vh;
}

/* -- the three-zone shell (v2.1 IA extension) -----------------------------------
   The rail is fixed full-height chrome; .app yields to it via :has()
   (auth/landing pages render no rail and keep the centered 1280
   column; rail pages go full-bleed - "the canvas: max-width none,
   density wins"). The collapsed state lives on <body> (rail-collapsed,
   set by app.js from localStorage) - OUTSIDE every LiveView root, so
   patches never snap it back. No JS, no reachability loss: the strip
   only narrows chrome the rail already renders as links. */

.app:has([data-rail]) {
  max-width: none;
  padding-left: calc(var(--rail-w) + var(--sp-6));
  transition: padding-left var(--dur-base) var(--ease);
}

body.rail-collapsed .app:has([data-rail]) {
  padding-left: calc(var(--rail-w-collapsed) + var(--sp-5));
}

@media (max-width: 767px) {
  /* Phones: the 48px strip is the honest default (the 232px tree
     would eat the screen) - rail.css pins the same geometry. */
  .app:has([data-rail]) {
    padding-left: calc(var(--rail-w-collapsed) + var(--sp-3));
  }
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

h1 {
  font-size: var(--size-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--lh-lg);
  margin: 0;
  text-transform: lowercase;
}

.tagline {
  color: var(--muted);
  font-size: var(--size-sm);
  font-style: italic;
}

@media (max-width: 720px) {
  .tagline {
    display: none;
  }
}

.auth-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--size-sm);
  white-space: nowrap;
  min-width: 0;
}

.user-chip {
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Accent discipline (§3.4): body links are TEXT, not accent - the
   affordance is the underline, hover lifts contrast. */
.auth-link {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link--quiet {
  font-weight: 500;
}

.flash-group:empty {
  display: none;
}

.flash {
  border-radius: var(--r-md);
  border: 1px solid;
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  cursor: pointer;
  font-size: var(--size-base);
  line-height: var(--lh-base);
  box-shadow: var(--shadow-1);
}

.flash-error {
  background: var(--danger-wash);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.flash-info,
.flash-success {
  background: var(--accent-soft);
  border-color: var(--accent-dim);
  color: var(--success);
}

.footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: var(--size-xs);
  text-align: center;
}

/* ==========================================================================
   Modals - the generic overlay system (issue detail, new project, …)
   ========================================================================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  /* the entry animation lives in reactive.css (the motion layer,
     wave 35 R2) with the rest of the system's vocabulary */
}

.modal-panel {
  position: relative;
  z-index: 1;
  margin: 7vh auto 6vh;
  width: min(980px, calc(100vw - 32px));
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  /* the entry animation lives in reactive.css (the motion layer,
     wave 35 R2): scale-in, the modal's contract entry */
}

.modal-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-2), transparent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.modal-title {
  font-size: var(--size-base);
  font-weight: 600;
  margin: 0;
}

.modal-open-full {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--size-xs);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.modal-open-full:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.modal-close:hover {
  background: var(--danger-wash-strong);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The project form is small enough to be its own body */
.project-modal {
  width: min(460px, calc(100vw - 32px));
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
}

.project-form input {
  font-size: var(--size-base);
}

.modal-hint {
  margin: 0;
  color: var(--muted);
  font-size: var(--size-sm);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

/* ==========================================================================
   Board - topbar, project rail, create toolbar, columns, cards
   ========================================================================== */

/* -- topbar ---------------------------------------------------------------------
   ONE compact bar: brand · cycle chip · [spacer] · view switch · ⌘K ·
   account. The old cycle strip (a cell per team, each with its own
   rollover button, plus the scope/view groups) collapsed into the
   cycle chip's dropdown - progressive disclosure, Linear-style. */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  align-items: center;
  margin-bottom: var(--sp-4);
  min-width: 0;
}

/* The view title (v2.1: the topbar leads with the surface's name) -
   the page's one h1 now the brand lives in the rail head. */
.topbar-title {
  font-family: var(--font-display);
  font-size: var(--size-md);
  line-height: var(--lh-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
}

.topbar .brand {
  flex-shrink: 0;
}

.topbar .brand h1 {
  font-size: var(--size-md);
}

/* The workspace-color dot (org identity): shape only - the FILL is an
   inline style from the org's palette hex (the label-dot pattern, so
   no color literal lives here and the dot works in both themes). */
.brand-org-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-2);
  margin-left: calc(var(--sp-1) * -0.5);
}

.topbar .auth-nav {
  margin-left: 0;
}

/* The active-cycle chip - one line, one dropdown. Sits on the 32px
   control rhythm with the rest of the topbar's interactive strip. */
.cycle-chip-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.cycle-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 32px;
  padding: 0 var(--sp-2) 0 var(--sp-3);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--size-sm);
  font-weight: 500;
  white-space: nowrap;
  max-width: 340px;
  min-width: 0;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.cycle-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.cycle-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cycle-chip-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cycle-chip-dot--off {
  background: var(--faint);
  box-shadow: none;
}

/* The dropdown - the label-picker popover recipe (absolute, shadowed,
   scrollable) carrying each team's cycle history + rollover. Popover
   tier: bg-3 + border-strong + --shadow-2 (§3.1). */
.cycle-menu {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  z-index: 76;
  min-width: 300px;
  max-width: 380px;
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: var(--sp-2);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-hover) transparent;
}

.cycle-menu-team + .cycle-menu-team {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.cycle-menu-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.cycle-menu-key {
  font-size: var(--size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex-shrink: 0;
}

.cycle-menu-team-name {
  font-size: var(--size-xs);
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cycle-menu-head .cycle-btn {
  margin-left: auto;
}

.cycle-menu-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--size-sm);
  color: var(--muted);
}

.cycle-menu-row--active {
  color: var(--text);
  background: var(--wash-3);
}

.cycle-menu-name {
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}

.cycle-menu-dates {
  color: var(--muted);
  font-size: var(--size-xs);
  white-space: nowrap;
}

.cycle-menu-state {
  margin-left: auto;
  font-size: var(--size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--r-pill);
  padding: 1px var(--sp-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.cycle-menu-row--active .cycle-menu-state {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.cycle-btn {
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--size-xs);
  font-weight: 500;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

/* Right half of the topbar: view switch · tools · account */
.topbar-right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

/* The tool cluster (Search · theme · bell): one quiet group behind a
   hairline, so the view switch reads as navigation and the account
   chip as identity - three jobs, one bar (§3 hierarchy). */
.topbar-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding-left: var(--sp-3);
  border-left: 1px solid var(--border);
}

/* Segmented controls (Board | List, and the board-surface cycle scope) */
.scope-segment {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: var(--sp-1);
}

.scope-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--muted);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--size-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.scope-btn:hover:not(:disabled):not(.active) {
  color: var(--text);
  text-decoration: none;
}

.scope-btn.active {
  background: var(--bg-3);
  color: var(--accent);
  box-shadow: var(--shadow-1);
}

.scope-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.scope-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* The view switcher (v2.1): the family tabs ride the segmented
   vocabulary at the switcher row's own height (--tab-h), the pill
   selected. DOM order is the tab order - real links, no roving JS
   needed to traverse them. */
.view-switcher .scope-btn {
  min-height: var(--tab-h);
  align-items: center;
}

/* -- work surface grid --------------------------------------------------------- */

.work-surface {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

@media (max-width: 860px) {
  .work-surface {
    /* minmax(0,·) - an auto-minimum single track would size itself to the
       rail/table's min-content and push the page sideways */
    grid-template-columns: minmax(0, 1fr);
  }
}

/* -- project rail --------------------------------------------------------------- */

.project-rail {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  position: sticky;
  top: var(--sp-4);
}

.project-rail h2 {
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: var(--sp-1) var(--sp-1) var(--sp-2);
}

.project-item {
  display: flex;
  flex-direction: column;
  /* Center the name/progress/track block vertically — without this
     the content top-packs and the label floats ~5px high whenever
     the row is taller than its content (the active row, two-line
     names). Measured: dy -5.5px before, 0 after. */
  justify-content: center;
  gap: var(--sp-1);
  text-align: left;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  color: var(--text-2);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.project-item:hover {
  background: var(--bg-2);
  color: var(--text);
}

.project-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text);
}

.p-name {
  font-weight: 550;
  line-height: 1.35;
}

.p-progress {
  font-size: var(--size-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  display: block;
  height: 3px;
  background: var(--bg-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 3px;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--t-fill);
}

.rail-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  width: 100%;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--size-sm);
  font-weight: 500;
  margin-top: var(--sp-1);
}

.rail-new-glyph {
  font-size: 14px;
  line-height: 1;
}

/* -- create toolbar ---------------------------------------------------------------
   Intake-first: ONE input + ONE Add button; the board's cycle scope
   rides the same row at the far right. Every control is 32px tall. */

.create-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-4);
}

.create {
  display: flex;
  gap: var(--sp-2);
}

/* A panel-tier strip (bg-1 + hairline): the input inside is the raised
   element, so the bar itself carries no shadow (§3.1 - shadows mark
   raised cards, popovers and modals). */
.create-pro {
  flex: 1 1 260px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
}

.create-pro input[type='text'] {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 480px;
  background: var(--bg-2);
  height: 32px;
}

.create-pro .btn {
  height: 32px;
}

/* The one visible control above the columns */
.board-scope {
  flex-shrink: 0;
  margin-left: auto;
}

/* The ⌘K chip - rendered in the shared topbar (WorkShell) on both the
   board and the list. Same 32px rhythm. */
.palette-open-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--muted);
  padding: 0 var(--sp-3);
  height: 32px;
  font-size: var(--size-sm);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.palette-open-btn:hover {
  border-color: var(--accent-dim);
  border-style: solid;
  color: var(--text);
}

/* The theme toggle - sun/moon, the bell's idiom (inline SVG, quiet
   ghost button, 32px rhythm). Pure client-side: the onclick flips
   html[data-theme] + localStorage; the glyph shown is the one you'd
   switch TO (dark shows the sun, light shows the moon). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.theme-toggle:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.theme-toggle svg {
  display: block;
}

/* Default (dark): the sun invites you to the light. */
.theme-toggle .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .theme-icon-moon {
  display: block;
}

html[data-theme="light"] .theme-toggle .theme-icon-sun {
  display: none;
}

/* -- the one label picker -------------------------------------------------------- */

.lp {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.lp-compact {
  display: block;
  width: 100%;
}

/* Trigger: a chip - first label, or "+N", or a muted Labels prompt */
.lp-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 32px;
  padding: 0 var(--sp-2) 0 var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--size-sm);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.lp-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.lp-compact .lp-trigger {
  width: 100%;
  justify-content: space-between;
}

.lp-trigger-label {
  font-weight: 500;
}

.lp-more {
  font-size: var(--size-xs);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lp-caret {
  font-size: 9px;
  color: var(--faint);
  transition: transform var(--dur-fast) var(--ease);
}

.lp-trigger[aria-expanded='true'] .lp-caret {
  transform: rotate(180deg);
}

/* Click-away: a transparent fixed sheet behind the popover. The
   popover sits above it; anything else closes the picker. */
.lp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: transparent;
}

/* The popover - one recipe, reused by the toolbar and the modal.
   Popover tier: bg-3 + border-strong + --shadow-2 (§3.1). */
.lp-popover {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  z-index: 76;
  min-width: 220px;
  max-width: 280px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: var(--sp-1);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-hover) transparent;
}

.lp-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  color: var(--text-2);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.lp-row:hover {
  background: var(--wash-4);
  color: var(--text);
}

/* The checkbox-like square */
.lp-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--accent-ink);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.lp-row-on {
  color: var(--text);
}

.lp-row-on .lp-check {
  background: var(--accent);
  border-color: var(--accent);
}

.lp-empty {
  padding: var(--sp-3) var(--sp-2);
  color: var(--muted);
  font-size: var(--size-sm);
}

/* -- columns ------------------------------------------------------------------------ */

.board {
  display: grid;
  /* 220px column floor (the screenshot P1, 2026-10-10): minmax(0,1fr)
     let five columns crush to ~135px on a 1285px viewport (nav 240 +
     flyout 237 + gaps) - card titles rendered one letter per line and
     backlog titles vanished entirely. The floor keeps columns usable
     and the overflow-x scroll takes the remainder sideways (the
     mobile scroller at <768px keeps its own flex treatment below). */
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: var(--sp-3);
  overflow-x: auto;
  /* the scroller's own vertical space: keep snap OFF here (the
     <768px arm owns snap) but hide the bar so the grid reads clean */
  scrollbar-width: thin;
  padding-bottom: 2px;
}

@media (max-width: 1180px) {
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.column {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  min-height: 200px;
  transition: border-color var(--dur-fast) var(--ease);
}

.column:hover {
  border-color: var(--border-strong);
}

.column h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  /* one line, always (the screenshot: "TO DO" wrapped TO/DO on
     squeezed columns) - the count chip rides flex-shrink 0 */
  white-space: nowrap;
  color: var(--muted);
  margin: var(--sp-1) var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  padding: 2px var(--sp-1);
  transition: color var(--dur-fast) var(--ease);
}

.column:hover h2 {
  color: var(--text-2);
}

.count {
  background: var(--bg-3);
  border-radius: var(--r-pill);
  padding: 1px var(--sp-2);
  font-size: var(--size-xs);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* The dock: transparent water, dashed pier */
.column-backlog {
  background: transparent;
  border-style: dashed;
}

.column-backlog:hover {
  border-color: var(--border-strong);
}

.column-backlog .count {
  background: var(--bg-2);
}

.column-empty {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--faint);
  font-size: var(--size-xs);
  font-style: italic;
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  margin-top: 2px;
}

/* -- cards -------------------------------------------------------------------------- */

/* A card is ALWAYS a raised element: bg-2 + tier-1 shadow at rest
   (§3.1 - the getting-started lesson), lifting to tier 2 on hover. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  align-items: stretch;
  text-align: left;
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--status-todo);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
  border-left-color: var(--status-todo);
}

/* The card is role=button - the ring replaces the resting tier shadow
   while keyboard-focused. */
.card:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Left accent by status - the glanceable workflow signal */
.card.s-backlog {
  border-left-color: var(--status-backlog);
}

.card.s-todo {
  border-left-color: var(--status-todo);
}

.card.s-in_progress {
  border-left-color: var(--status-in_progress);
}

.card.s-done {
  border-left-color: var(--status-done);
}

.card.s-canceled {
  border-left-color: var(--status-canceled);
}

.card.s-in_progress:hover {
  border-left-color: var(--info);
}

.card.s-done:hover {
  border-left-color: var(--accent);
}

/* Requests at anchor: quiet, outlined, waiting to be charted. The
   backlog dims its CARDS only - the column header keeps full opacity. */
.card.s-backlog {
  background: transparent;
  border-style: dashed;
  opacity: 0.82;
}

.card.s-backlog:hover {
  opacity: 1;
}

.card.s-backlog .title {
  color: var(--muted);
}

/* Assignee: initials dot pinned to the card's top-right corner */
.assignee-dot {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--av, var(--muted));
  color: var(--avatar-ink);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px var(--avatar-ring);
  pointer-events: none;
}

.card.s-done .title,
.card.s-canceled .title {
  color: var(--muted);
}

.card.s-canceled .title {
  text-decoration: line-through;
}

.card-top {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

/* Anchor the status dot to the title's first line. */
.card-top .card-status {
  margin-top: 1px;
}

.card .title,
.issue-card .title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* AA (a11y pass): issue numbers are content, not decoration -
   --faint was 3.09:1 on cards (dark) / 3.6:1 (light); --muted holds
   5.5:1 / 5.3:1. The hover bump is folded in (same value). */
.num {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.title {
  line-height: var(--lh-lg);
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

/* The status dot - cycling lives here, clicks never open the modal */
.card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: -3px;
  flex-shrink: 0;
  align-self: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.card-status:hover {
  border-color: var(--border-strong);
  background: var(--bg-3);
  transform: scale(1.12);
}

.card-status:active {
  transform: scale(0.94);
}

/* -- status dot: a SIBLING, not a descendant (the a11y pass) ------------------
   The card is role="button" (open the issue); the status dot is its
   own button (advance the status). A button inside role="button" is
   the nested-interactive violation every audit tool flags, so the dot
   button now renders BEFORE the card as a sibling, absolutely pinned
   to the exact spot it occupied in .card-top's flex row - the
   .dot-slot spacer below reserves that flow space (identical flex
   metrics, identical paint, zero-nesting DOM). */
.issue-card {
  position: relative;
}

.issue-card > .card-status {
  position: absolute;
  /* The base .card-status margins (-3px x, 1px y) are FLOW spacing -
     meaningless for the pinned sibling; zero them so left/top match
     the .dot-slot's in-flow spot exactly. Offsets ride the card's
     --sp-3 padding + 1px border (and the dot's -3px x pull), so the
     pin tracks any future rhythm change. */
  margin: 0;
  top: calc(var(--sp-3) + 1px);
  left: calc(var(--sp-3) - 2px);
  z-index: 1;
}

/* The in-flow placeholder keeping .card-top's layout byte-stable now
   that the real button lives outside the card. Top-aligned (not
   centered like the original button): it must sit exactly where the
   sibling button is pinned - on multi-line titles the ORIGINAL dot
   centered mid-title; the sibling now rides the number's line, which
   reads truer anyway. Invisible either way. */
.dot-slot {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-left: -3px;
  flex-shrink: 0;
  align-self: flex-start;
}

.priority {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 1px var(--sp-1);
  flex-shrink: 0;
}

.team-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--size-xs);
  font-weight: 500;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  white-space: nowrap;
}

/* ONE chip recipe: inline-flex, 20px tall, --sp-2 side padding, fully
   rounded, xs type - tint variants via --chip. Cards, the detail
   header, list rows and the pickers all speak it. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--size-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--chip, var(--muted)) 38%, transparent);
  color: var(--chip-ink);
  background: color-mix(in srgb, var(--chip, var(--muted)) 10%, transparent);
}

.chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  display: inline-block;
  flex-shrink: 0;
  background: var(--chip, var(--muted));
}

/* The +N overflow chip (card label diet): same recipe, dashed, muted */
.chip.chip-more {
  border-style: dashed;
}

/* ==========================================================================
   Issue detail - shared by the standalone page and the ?issue= modal
   ========================================================================== */

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--size-sm);
  color: var(--muted);
}

/* A link, not a primary action: text + underline affordance (§3.4). */
.back-link {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crumb-sep {
  color: var(--faint);
}

.crumb-id {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  letter-spacing: 0.02em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px var(--sp-2);
}

/* Standalone page: the detail is its own panel.
   Modal: the panel provides chrome, keep the body quiet. */
.issue-detail > .detail {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
}

.modal-panel .detail {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
}

.detail-header {
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.detail-title {
  font-size: var(--size-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-3);
  cursor: text;
  line-height: var(--lh-lg);
  transition: color var(--dur-fast) var(--ease);
}

/* Editability affordance without accent: the underline hint (§3.4). */
.detail-title:hover {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: var(--sp-1);
}

.title-form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin: 0 0 var(--sp-3);
}

.title-form input {
  flex: 1;
  background: var(--bg-2);
  border-color: var(--accent-dim);
  font-size: var(--size-md);
  font-weight: 600;
}

.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 20px;
  padding: 0 var(--sp-3);
  font-size: var(--size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text-2);
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.status-pill:hover {
  border-color: var(--accent-dim);
}

.status-pill:active {
  transform: scale(0.97);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: currentColor;
}

.status-pill.s-backlog {
  color: var(--status-backlog);
  border-color: color-mix(in srgb, var(--status-backlog) 40%, transparent);
  background: color-mix(in srgb, var(--status-backlog) 9%, transparent);
  border-style: dashed;
}

.status-pill.s-in_progress {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 40%, transparent);
  background: color-mix(in srgb, var(--info) 9%, transparent);
}

.status-pill.s-done {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
}

.status-pill.s-canceled {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.detail-updated {
  margin-left: auto;
  font-size: var(--size-xs);
  color: var(--muted);
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-6);
  align-items: start;
}

@media (max-width: 860px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
}

.detail-section {
  margin-bottom: var(--sp-4);
}

.detail-section h3 {
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--sp-3);
}

.detail-section .count {
  margin-left: var(--sp-1);
  vertical-align: 1px;
}

/* Description: plain text, whitespace preserved. The empty state is a
   quiet dashed invitation - left-aligned at the content padding, no
   italics, no fake text. */
/* View mode: the description is TEXT, not a card — no background,
   no border, no min-height. The markdown's own block rhythm carries
   the spacing (first/last child margins are zeroed in markdown.css).
   The card chrome only appears on hover (the edit affordance) and in
   edit mode (where it's an input). */
.description-text {
  padding: var(--sp-1) 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: var(--lh-base);
  cursor: text;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast) var(--ease);
}

.description-text:hover {
  background: var(--bg-2);
}

.description-text.empty {
  color: var(--muted);
  padding: var(--sp-2) var(--sp-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  min-height: 44px;
}

.detail-section textarea {
  width: 100%;
  background: var(--bg-2);
  border-color: var(--accent-dim);
  font-size: var(--size-base);
}

.desc-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.desc-hint {
  font-size: var(--size-xs);
  color: var(--faint);
}

/* Forge links */
.forge-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.forge-link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--size-sm);
}

.forge-kind {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg-1);
  border-radius: var(--r-sm);
  padding: 2px var(--sp-1);
}

.forge-kind.k-pull_request {
  color: var(--info);
}

.forge-kind.k-commit {
  color: var(--accent);
}

.forge-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.forge-title:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.forge-state {
  font-size: var(--size-xs);
  font-weight: 700;
  border-radius: var(--r-sm);
  padding: 1px var(--sp-2);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}

.forge-state.st-open {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 40%, transparent);
}

.forge-state.st-merged {
  color: var(--merged);
  border-color: var(--merged-border);
}

.forge-state.st-closed {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.forge-repo {
  margin-left: auto;
  font-size: var(--size-xs);
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Comments - chat-like bubbles */
.comment {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}

.comment + .comment {
  margin-top: 2px;
}

.avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--avatar-ink);
  background: var(--av, var(--muted));
  box-shadow: inset 0 0 0 1px var(--avatar-ring-soft);
}

.comment-body {
  min-width: 0;
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  border-top-left-radius: 4px;
  padding: var(--sp-2) var(--sp-3);
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 600;
  font-size: var(--size-sm);
}

.comment-time {
  font-size: var(--size-xs);
  color: var(--faint);
}

.comment-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: var(--lh-base);
  color: var(--text-2);
}

.comment-composer {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.composer-column {
  flex: 1;
  min-width: 0;
}

.comment-composer textarea {
  width: 100%;
  background: var(--bg-2);
  resize: none;
}

.composer-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

/* Who's commenting: a proper identity chip - avatar initials + name */
.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-width: 0;
  max-width: 260px;
  height: 22px;
  padding: 0 var(--sp-3) 0 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: var(--size-xs);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-xs {
  width: 16px;
  height: 16px;
  font-size: 7.5px;
}

.composer-row .btn {
  margin-left: auto;
}

.empty-note {
  color: var(--muted);
  font-size: var(--size-sm);
  font-style: italic;
  padding: var(--sp-1) 0;
}

/* Sidebar properties */
.prop {
  margin-bottom: var(--sp-3);
}

.prop-label {
  display: block;
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.prop-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--faint);
}

.prop select {
  width: 100%;
  background-color: var(--bg-2);
}

/* Activity - a timeline with a connector line */
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.activity {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-1) 0 var(--sp-4) 2px;
  font-size: var(--size-sm);
  line-height: var(--lh-sm);
}

/* The connector: every entry draws a line that reaches the next dot */
.activity::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 18px;
  bottom: -4px;
  width: 1px;
  background: var(--border);
}

.activity:last-child::before {
  display: none;
}

.activity-marker {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 2px solid var(--faint);
}

.activity-entry {
  min-width: 0;
  flex: 1;
}

.activity-line {
  display: block;
}

.activity-actor {
  font-weight: 600;
}

.activity-actor.system {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

.activity-text {
  color: var(--text-2);
}

.activity-time {
  font-size: var(--size-xs);
  color: var(--faint);
  white-space: nowrap;
}

/* ==========================================================================
   Auth pages - their own chrome-less shell: one full-viewport column,
   the card centered in it. Flat background (no gradients) so nothing
   bands below the card.
   ========================================================================== */

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--sp-6);
}

/* A card on the bed: bg-2 + border-strong + tier-1 shadow (§3.1/§3.8). */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-7);
  box-shadow: var(--shadow-1);
}

.auth-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--sp-4);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
}

.auth-title {
  font-size: var(--size-lg);
  font-weight: 600;
  line-height: var(--lh-lg);
  margin: 0 0 var(--sp-1);
}

.auth-sub {
  color: var(--muted);
  font-size: var(--size-sm);
  line-height: var(--lh-sm);
  margin: 0 0 var(--sp-5);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.auth-form label {
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: var(--sp-2);
}

.auth-form input {
  background: var(--bg-2);
  font-size: var(--size-base);
}

.auth-error {
  color: var(--danger-text);
  font-size: var(--size-sm);
  margin: 0 0 2px;
}

/* Info flashes on the auth cards ("Signed out.") - same slot as the
   error line, mint instead of red. */
.auth-notice {
  color: var(--success);
  font-size: var(--size-sm);
  margin: 0 0 2px;
}

/* Password field: input + zero-JS reveal toggle in one row */
.auth-pass-row {
  position: relative;
}

.auth-pass-row input {
  width: 100%;
  padding-right: var(--sp-8);
}

.pass-toggle {
  position: absolute;
  top: 50%;
  right: var(--sp-1);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.pass-toggle:hover {
  color: var(--text);
  background: var(--bg-3);
}

/* Primary (Sign in / Create org) - the same recipe as .btn-primary */
.auth-submit {
  margin-top: var(--sp-4);
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  font-weight: 600;
  font-size: var(--size-base);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.auth-submit:focus-visible {
  box-shadow: var(--focus-ring);
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-bright);
}

.auth-submit:disabled {
  background: var(--primary-disabled-bg);
  color: var(--primary-disabled-text);
  box-shadow: none;
}

.auth-sep {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  /* --muted, not --faint (a11y pass): real text at 11px needs the
     4.5:1 the whisper token doesn't carry. */
  color: var(--muted);
  font-size: var(--size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: var(--sp-5) var(--sp-5) var(--sp-3);
}

.auth-sep::before,
.auth-sep::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* OAuth pair: one recipe, one text color, 16px brand marks, 10px
   between the two buttons. */
.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  color: var(--text);
  text-decoration: none;
  font-size: var(--size-base);
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.oauth-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-3);
  text-decoration: none;
}

.oauth-mark {
  flex-shrink: 0;
  opacity: 0.9;
}

.auth-alt {
  margin: var(--sp-5) 0 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--size-sm);
}

/* The estimate badge - quiet point chip beside the priority (only when
   the issue carries an estimate; nil is "unestimated", not zero). */
.pt-badge {
  font-size: var(--size-xs);
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 3px;
  color: var(--muted);
}

/* The estimate picker in the detail sidebar - a row of point chips. */
.estimate-picker {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.est-btn {
  font-size: var(--size-xs);
  min-width: var(--sp-6);
  padding: 2px var(--sp-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
}

.est-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.est-active {
  border-color: var(--accent);
  color: var(--accent);
}

/* -- board drag & drop (SortableJS: vendor/sortablejs.js, wired in app.js) ----
   Quiet, Linear-style: no flash, no scale - a lifted card, a faded ghost,
   one mint hairline on the column being crossed. The classes are
   SortableJS's own state hooks (sortable-chosen / sortable-ghost /
   sortable-drag); [draggable=true] is toggled by the library for the
   duration of a native drag. The column highlight rides :has(.sortable-ghost)
   - the ghost always sits in the hovered container, so no JS is needed. */

/* The grab affordance: cards drag, so the card says so on hover (click
   still opens - grab is the drag invitation, not the click promise). */
.issue-card .card:hover {
  cursor: grab;
}

/* The engaged card: SortableJS sets draggable on the wrapper (the
   draggable is .issue-card, not the inner .card) while a drag runs */
.issue-card[draggable="true"] .card {
  cursor: grabbing;
}

/* Pointer-down on a card, pre-drag - barely there. The class lands on
   the .issue-card wrapper; the style on the .card inside it. */
.issue-card.sortable-chosen .card {
  border-color: var(--border-strong);
}

/* The element that follows the pointer - the original in native mode,
   the clone in fallback mode - lifted, fully readable. */
.issue-card.sortable-drag .card,
.issue-card.sortable-fallback .card {
  opacity: 0.95;
  /* Drag = LIFT (shadow-2, the popover tier - M2's flag): shadow-3 is
     the modal tier; a dragged card rides above its column, not above
     the page. */
  box-shadow: var(--shadow-2);
  cursor: grabbing;
}

/* The placeholder left at the drop point - fades to a whisper */
.issue-card.sortable-ghost .card {
  opacity: 0.3;
  box-shadow: none;
}

/* The column under the pointer: one mint hairline, nothing louder */
.cards:has(.sortable-ghost) {
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--accent-dim);
  background: var(--accent-soft);
}

/* -- settings pages (automation: cycle settings + recurring schedules) ------ */

.settings-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* Raised sections on the bed: bg-2 + border-strong + tier-1 (§3.1/3.8). */
.settings-section {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-2);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-1);
}

.settings-heading {
  margin: 0;
  font-size: var(--size-base);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-title {
  font-size: var(--size-base);
  font-weight: 600;
  color: var(--text);
}

.settings-meta {
  font-size: var(--size-sm);
  color: var(--muted);
}

.settings-row-actions {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.settings-form input[type="text"],
.settings-form select,
.settings-form textarea {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-2);
  color: var(--text);
  font-size: var(--size-base);
}

.settings-form textarea {
  resize: vertical;
}

.settings-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--size-base);
  color: var(--text);
  cursor: pointer;
}

.settings-labels {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.settings-labels .chip-on {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
}

.tool-btn--danger {
  color: var(--danger, #e5534b);
}

/* -- template picker (create bar popover) ------------------------------------ */

.template-picker {
  position: relative;
}

/* Popover tier: bg-3 + border-strong + --shadow-2 (§3.1). */
.template-pop {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  /* Above .lp-backdrop (z 75, the label-picker close-catcher this popover
     reuses) - the rows must take the click, not the backdrop. */
  z-index: 76;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: var(--sp-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.template-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
}

.template-row:hover {
  background: var(--wash-4);
}

.template-name {
  font-size: var(--size-base);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.template-hint {
  font-size: var(--size-sm);
  color: var(--muted);
}

/* The template-token row (extracted from the board create form's
   inline styles by the makeover - M2's flag; this sheet is the only
   one that loads in BOTH board layouts): the row wraps under the
   composer, each token pairs its label with a compact input on the
   global input vocabulary. */
.template-tokens {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-top: 2px;
}

.template-token {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.template-token-input {
  width: 16ch;
  padding: 5px 8px;
  font-size: var(--size-base);
  color: inherit;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.template-token-input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* The optional template glyph (issue_templates.icon, the closed
   five-glyph set) next to the name in the create-bar picker -
   rendered only when set, so pre-column templates are unchanged. */
.template-icon {
  color: var(--text-2);
  line-height: 1;
}

/* ==========================================================================
   RESPONSIVE LAYER - phones (<768px) and tablets (768–1023px)
   --------------------------------------------------------------------------
   The mobile pass (notes/mobile_pass.md). Everything below this banner is
   viewport-scoped; desktop (≥1024px) is untouched by construction.

   Conventions:
   - 44px minimum hit height for interactive controls on phones.
   - Modals become bottom sheets <768px; popovers become action sheets
     (the group rule below uses a `body ` prefix so it beats the same
     0-1-0 rules in the later-loading per-surface files - list.css,
     saved_views.css, columns.css, notifications.css, detail_v2.css -
     regardless of source order).
   - Safe areas: sheets and the app shell pad with env(safe-area-inset-*)
     (root layout ships viewport-fit=cover; env() is 0 where it doesn't
     apply, so these paddings are no-ops on desktop/plain browsers).
   - iOS zoom guard: text inputs go to 16px on phones.
   ========================================================================== */

/* -- shared sheet motion ---------------------------------------------------
   The sheet-motion keyframes + their usages moved to reactive.css
   (the motion layer, wave 35 R2) with the rest of the animation
   wiring. */

/* -- tablets (768–1023): just prevent page-level sideways drift -------------- */

@media (max-width: 1023px) {
  html {
    overflow-x: clip;
  }
}

/* -- phones (<768px) --------------------------------------------------------- */

@media (max-width: 767px) {
  /* App shell: tighter gutters + notch clearance in standalone PWA mode */
  .app {
    padding: max(12px, env(safe-area-inset-top)) 12px
      calc(24px + env(safe-area-inset-bottom));
  }

  /* iOS Safari zooms the page when focusing <16px inputs - pin every
     text-bearing control at 16px and give it room not to clip. */
  input[type='text'],
  input[type='search'],
  input[type='email'],
  input[type='password'],
  input[type='date'],
  input[type='number'],
  input[type='url'],
  select,
  textarea {
    font-size: 16px;
    min-height: 40px;
  }

  input[type='checkbox'],
  input[type='radio'] {
    min-height: 0;
  }

  /* -- topbar: three tight rows ------------------------------------------------
     row 1: brand + the active-cycle chip (fills the rest of the row)
     row 2: Search · bell · settings gear · sign out (right-aligned)
     row 3: the surface switcher, full-width and horizontally scrollable
     The email user-chip hides - identity rides the gear + sign-out. */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .topbar .brand {
    flex: 0 0 auto;
  }

  .topbar .brand h1 {
    font-size: 14px;
  }

  .cycle-chip-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cycle-chip {
    width: 100%;
    max-width: none;
    height: 44px;
  }

  .topbar-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-right .scope-segment {
    order: 10;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-right .scope-segment::-webkit-scrollbar {
    display: none;
  }

  .user-chip {
    display: none;
  }

  .topbar .auth-nav {
    gap: 10px;
  }

  /* Keycap hints are desktop language - the Search chip keeps its text */
  .palette-open-btn .kbd {
    display: none;
  }

  /* -- project rail: a horizontal card scroller above the board --------------- */
  /* minmax(0,1fr): the board's flex row must size INTO the track, not
     stretch it - an auto-minimum track would grow to the sum of the
     85vw columns and blow the page sideways. */
  .work-surface {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-rail {
    position: static;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .project-rail::-webkit-scrollbar {
    display: none;
  }

  .project-rail h2 {
    display: none;
  }

  .project-item {
    flex: 0 0 190px;
    min-height: 44px;
    justify-content: center;
  }

  .rail-new {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    white-space: nowrap;
    min-height: 44px;
  }

  /* -- create bar: full-width row, controls at 44px --------------------------- */
  .create {
    flex: 1 1 100%;
    /* the 16px input raises the form's intrinsic min-content past the
       viewport - zero the automatic minimum so it always fits the row */
    min-width: 0;
  }

  .create-pro input[type='text'],
  .create-pro .btn {
    height: 44px;
  }

  /* -- board: one column per swipe, 85vw with a peek of the next --------------
     The status grid becomes a snap scroller; custom columns (.cols-scroll
     in columns.css) already scroll - they get the same snap treatment in
     their own file. Column headers stick to the viewport top while the
     (tall) column body scrolls under them. */
  .board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 2px 2px 10px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .board::-webkit-scrollbar {
    display: none;
  }

  .column {
    flex: 0 0 85vw;
    scroll-snap-align: center;
    min-height: 55vh;
  }

  .column h2 {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-1);
    padding-top: 6px;
    padding-bottom: 6px;
  }

  /* Backlog's column is transparent water - its header needs the page bed */
  .column-backlog h2 {
    background: var(--bg-0);
  }

  /* -- modals become bottom sheets ----------------------------------------------
     Every modal (issue detail, new project, saved-view compose, keyboard
     help, editors) pins to the bottom, rounds its top, grows a grabber,
     and clears the home indicator. The body was already the scroll area. */
  .modal-root {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
  }

  .modal-panel {
    margin: 0;
    width: 100%;
    max-width: 980px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    /* sheet-in entry: reactive.css's phone block */
  }

  .modal-head {
    position: relative;
    justify-content: center;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-4) var(--sp-3);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  /* The grabber: centered pill above the title row */
  .modal-head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--border-strong);
  }

  .modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* The issue sheet's inner padding tightens to the phone gutter */
  .modal-panel .detail {
    padding: 14px 14px 18px;
  }

  .detail-title {
    font-size: 17px;
  }

  .detail-updated {
    margin-left: 0;
    flex-basis: 100%;
  }

  .desc-actions,
  .composer-row,
  .modal-actions {
    flex-wrap: wrap;
  }

  /* -- popovers become action sheets ---------------------------------------------
     `body `-prefixed on purpose: these classes are (re)declared in files
     that load after app.css (list.css, saved_views.css, columns.css,
     notifications.css, detail_v2.css); the prefix wins on specificity
     no matter the source order. Each popover already renders beside a
     fixed transparent backdrop that both dims nothing and closes on tap.
     Exceptions kept as anchored dropdowns: .triage-popover (its host bar
     has backdrop-filter, which would become its containing block) and
     .topmenu-panel (already right-edge anchored) - see their files. */
  body .lp-popover,
  body .flt-popover,
  body .cycle-menu,
  body .os-menu,
  body .template-pop,
  body .vmenu,
  body .bcol-menu,
  body .nb-panel,
  body .rel-popover {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 90;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    max-height: min(72vh, 560px);
    max-height: min(72dvh, 560px);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--sheet-shadow);
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
    /* sheet-in entry: reactive.css's phone block (same class list) */
  }

  /* Sheet rows are taller - they're touch targets now (every popover
     container's rows, not just the label picker's) */
  body .lp-popover .lp-row,
  body .flt-popover .lp-row,
  body .vmenu .lp-row {
    min-height: 44px;
    padding: 10px 8px;
  }

  body .cycle-menu .cycle-menu-row {
    min-height: 44px;
  }

  /* The org-switcher sheet's rows ride the same touch-target rule
     (org_switcher.css owns the class, app.css owns the sheet list). */
  body .os-menu .os-row {
    min-height: 44px;
  }

  body .template-pop .template-row {
    min-height: 44px;
  }

  body .rel-popover .rel-result {
    min-height: 44px;
  }

  /* -- touch targets: nothing interactive under 44px on a phone ----------------- */
  .btn {
    min-height: 44px;
  }

  .tool-btn {
    min-height: 44px;
  }

  .palette-open-btn {
    height: 44px;
  }

  .nb-bell {
    width: 44px;
    height: 44px;
  }

  /* The segmented pill row reaches 44 via 36px buttons + its own padding */
  .scope-segment {
    padding: 4px;
  }

  .scope-btn {
    min-height: 36px;
    padding: 8px 14px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    font-size: 15px;
  }

  /* The status dot on cards: an invisible 44px square around the 7px dot */
  .card-status {
    width: 44px;
    height: 44px;
    margin-left: -10px;
  }

  .status-pill {
    min-height: 44px;
  }

  .board-cycle-chip {
    min-height: 44px;
  }

  .est-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .pass-toggle {
    width: 44px;
    height: 44px;
  }

  .rail-new {
    min-height: 44px;
  }

  .lp-trigger {
    height: 44px;
  }

  .clear-all {
    min-height: 44px;
  }

  .load-more {
    min-height: 44px;
  }

  /* The board's drag affordance is pointer-based; on a phone the card is
     a tap target first - the card itself already meets 44px by content. */
  .card {
    min-height: 44px;
  }
}

/* -- tablets (768–1023): keep the topbar on one line, let the switcher wrap ---- */

@media (min-width: 768px) and (max-width: 1023px) {
  .app {
    padding: 20px 16px 40px;
  }

  /* Seven surface links don't fit beside the account group - the switcher
     takes its own full-width scroll row, same as the phone layout. */
  .topbar-right .scope-segment {
    order: 10;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .topbar-right .scope-segment::-webkit-scrollbar {
    display: none;
  }

  .topbar .auth-nav {
    gap: 8px;
  }

  .user-chip {
    max-width: 140px;
  }
}

/* ==========================================================================
   Due dates (wave 33 lane V1) - the native picker + the quiet-red
   overdue status, every surface. Tokens only: light re-points the
   same vars, so both themes ride this block unchanged.
   ========================================================================== */

/* The native HTML5 date input, styled with tokens (zero JS, zero
   picker libraries): a compact text input carrying whatever calendar
   glyph the UA paints. color-scheme inherits the theme attr, so the
   picker's own popover matches dark/light too. */
.date-input {
  height: 26px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--text);
  font: 500 var(--size-xs)/1 var(--font-body);
}

.date-input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* The board create bar's picker: tight against the title input,
   never squeezing the Add button. */
.create-due {
  width: 132px;
  flex-shrink: 0;
}

/* The board card's due chip: --size-2xs (the ratified floor) - the
   date itself, muted; the overdue variant is the quiet-red STATUS
   (text plus a whisper of wash, never a fill alarm). */
.card-due {
  font-size: var(--size-2xs);
  font-weight: 600;
  line-height: var(--lh-2xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-due--overdue {
  color: var(--danger);
  background: var(--danger-wash);
  border-radius: var(--r-sm);
  padding: 1px var(--sp-1);
}

/* The overdue glow: the card's left accent leans rose - quiet, never
   a border alarm; hover keeps its own emphasis. Done/canceled cards
   never carry it (Work.due_state/2's doctrine). */
.card.card--overdue {
  border-left-color: var(--danger);
}

.card.card--overdue:hover {
  border-left-color: var(--danger);
}

/* The list/table Due cell: the same quiet vocabulary as the chip. */
.list-due {
  font-size: var(--size-2xs);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.list-due--overdue {
  color: var(--danger);
}
