

  /* ================================================================
   * Gluecron design system — 2026.09 "Clean White"
   * Pure white · neutral greys · near-black ink · one evergreen accent ·
   * hairline borders · Inter + JetBrains Mono (the Tallrig system, 2026-09-30).
   *
   * Replaces "Natural Light" (warm paper + clay). The owner's brief: a very
   * clean white system over the complete website, no reds, no yellows,
   * nice fonts. Warm greys read as paper; these read as white.
   * ============================================================== */
  :root, :root[data-theme='dark'] {
    /* Dark is opt-in (theme cookie). Same rules: neutral, no warm hues. */
    --bg:           #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary:  #171717;
    --bg-elevated:  #111111;
    --bg-surface:   #1a1a1a;
    --bg-hover:     rgba(255,255,255,0.05);
    --bg-active:    rgba(255,255,255,0.09);
    --bg-inset:     rgba(0,0,0,0.30);

    --border:        rgba(255,255,255,0.08);
    --border-subtle: rgba(255,255,255,0.05);
    --border-strong: rgba(255,255,255,0.16);
    --border-focus:  rgba(74,158,142,0.55);

    --text:        #ededed;
    --text-strong: #fafafa;
    --text-muted:  #a1a1a1;
    --text-faint:  #6e6e6e;
    --text-link:   #7fc4b4;
    --text-secondary: #c4c4cc;
    --success-subtle: rgba(74,222,128,0.12);

    --accent:        #4a9e8e;
    --accent-2:      #a1a1a1;
    --accent-warm:   #d4d4d4;
    --accent-hover:  #5cb3a2;
    --accent-pressed:#3d8577;
    --accent-gradient:       linear-gradient(135deg, #4a9e8e 0%, #3f8d84 100%);
    --accent-gradient-soft:  linear-gradient(135deg, rgba(74,158,142,0.14) 0%, rgba(63,141,132,0.14) 100%);
    --accent-gradient-faint: linear-gradient(135deg, rgba(74,158,142,0.06) 0%, rgba(63,141,132,0.06) 100%);
    --accent-glow:           0 0 0 1px rgba(74,158,142,0.22);
    /* Solid fill for icon tiles, avatars and bars (was an accent→clay
       gradient). Ink in light, lifted grey in dark. */
    --fill-strong:           #2e2e2e;

    /* Semantic. No red, no yellow: "bad" is bright ink, "caution" is grey. */
    --green:  #4ade80;
    --red:    #fafafa;
    --yellow: #a1a1a1;
    --amber:  #a1a1a1;
    --blue:   #7fb8d6;

    /* Kit v1 semantic tokens (src/views/kit) — read by the kit only, added
       beside the legacy names so untouched pages do not shift. Black
       mirrors white: pure black page, SOLID hairlines (they look the same
       over layered surfaces, unlike the rgba --border), and the primary
       swaps to paper-on-ink. --ok is the only hue, for proven success.
       Every text/surface pair holds WCAG AA (kit.test.ts). */
    --surface-0:   #000000;
    --surface-1:   #0b0b0c;
    --surface-2:   #161618;
    --line:        #232326;
    --line-strong: #3a3a3f;
    --ink:         #fafafa;
    --ink-2:       #a1a1aa;
    --ink-3:       #8b8b94;
    --on-ink:      #08080a;
    --ok:          #4ade80;
    --ok-subtle:   #0c2416;
    --focus:       #fafafa;

    /* Type (was Manrope; Inter since the Tallrig system): Inter for all UI and headings (open, even letterforms with a
       large x-height; clean at 13px, airy at display sizes), Geist Mono for
       code ONLY. Labels and eyebrows are sans, not mono: mono in UI chrome
       read as clutter. Loaded from Google Fonts with display=swap; the
       system stack is the fallback. */
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Cascadia Mono', Menlo, Consolas, 'Courier New', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono-feat: 'calt', 'liga';

    --r-sm:    6px;
    --r:       8px;
    --r-md:    10px;
    --r-lg:    12px;
    --r-xl:    16px;
    --r-2xl:   22px;
    --r-full:  9999px;
    --radius:  8px;

    --t-xs:        12px;
    --t-sm:        13px;
    --t-base:      14px;
    --t-md:        16px;
    --t-lg:        20px;
    --t-xl:        28px;
    --t-2xl:       40px;
    --t-3xl:       56px;
    --t-display:   72px;
    --t-display-lg:96px;

    --s-0: 0;
    --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
    --s-5: 20px; --s-6: 24px;  --s-7: 28px;  --s-8: 32px;
    --s-10:40px; --s-12:48px;  --s-14:56px;  --s-16:64px;
    --s-20:80px; --s-24:96px;  --s-32:128px;

    --elev-0:    0 0 0 1px var(--border);
    --elev-1:    0 1px 2px rgba(0,0,0,0.50), 0 0 0 1px var(--border);
    --elev-2:    0 8px 24px -8px rgba(0,0,0,0.60), 0 0 0 1px var(--border);
    --elev-3:    0 20px 48px -12px rgba(0,0,0,0.70), 0 0 0 1px var(--border-strong);
    --elev-glow: 0 0 0 1px rgba(74,158,142,0.32);
    --ring:      0 0 0 3px rgba(74,158,142,0.28);
    --ring-warn: 0 0 0 3px rgba(161,161,161,0.28);
    --ring-err:  0 0 0 3px rgba(250,250,250,0.28);

    --ease:           cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo:  cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --t-fast:  120ms;
    --dur-base: 200ms;
    --t-slow:  360ms;
    --t-slower:560ms;

    --header-h: 65px;

    /* Block O3 — visual coherence: named token aliases (additive). */
    --space-1: var(--s-1);
    --space-2: var(--s-2);
    --space-3: var(--s-3);
    --space-4: var(--s-4);
    --space-5: var(--s-5);
    --space-6: var(--s-6);
    --space-8: var(--s-8);
    --space-10: var(--s-10);
    --space-12: var(--s-12);
    --space-16: var(--s-16);
    --space-20: var(--s-20);
    --space-24: var(--s-24);
    --radius-sm: var(--r-sm);
    --radius-md: var(--r-md);
    --radius-lg: var(--r-lg);
    --radius-xl: var(--r-xl);
    --radius-full: var(--r-full);
    --font-size-xs: var(--t-xs);
    --font-size-sm: var(--t-sm);
    --font-size-base: var(--t-base);
    --font-size-md: var(--t-md);
    --font-size-lg: var(--t-lg);
    --font-size-xl: var(--t-xl);
    --font-size-2xl: var(--t-2xl);
    --font-size-3xl: var(--t-3xl);
    --font-size-hero: var(--t-display);
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;
    --leading-loose: 1.7;
    --z-base: 1;
    --z-nav: 10;
    --z-sticky: 50;
    --z-overlay: 100;
    --z-modal: 1000;
    --z-toast: 10000;
  }

  :root[data-theme='light'] {
    /* "Clean White" — the theme the site ships in (SSR default, see
       readTheme()). Every token is restated so nothing falls through to
       the dark block. Greys are strictly neutral (r = g = b). */
    --bg:           #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary:  #eeeef0;
    --bg-elevated:  #ffffff;
    --bg-surface:   #f7f7f8;
    --bg-hover:     rgba(0,0,0,0.035);
    --bg-active:    rgba(0,0,0,0.06);
    --bg-inset:     rgba(0,0,0,0.03);

    --border:        #e6e6ea;
    --border-subtle: #eeeef0;
    --border-strong: #cfcfd6;

    --text:        #08080a;
    --text-strong: #08080a;
    --text-muted:  #5c5c66;
    --text-faint:  #65656f;
    --text-link:   #08080a;
    --text-secondary: #3d3d46;
    --success-subtle: #eef7f1;

    /* #1f5f57 is 7.6:1 on white: AA for body text. The only hue on the
       page, kept for links, focus and success. */
    --accent:        #08080a;
    --accent-2:      #525252;
    --accent-warm:   #404040;
    --accent-hover:  #000000;
    --accent-pressed:#000000;
    --accent-glow:   0 0 0 1px rgba(8,8,10,0.12);
    --fill-strong:   #171717;
    --border-focus:  #08080a;
    --ring:          0 0 0 3px rgba(8,8,10,0.10);
    --elev-glow:     0 0 0 1px rgba(8,8,10,0.16);

    --accent-gradient:       linear-gradient(#08080a, #08080a);
    /* Tint tokens are neutral in Clean White: a highlighted panel is a
       quiet grey, never a green wash. */
    --accent-gradient-soft:  linear-gradient(#f5f5f5, #f5f5f5);
    --accent-gradient-faint: linear-gradient(#fafafa, #fafafa);

    /* No red, no yellow. "Error" = ink (weight carries it); "warning" =
       mid grey. Tints built from these (color-mix at 10-12%) come out as
       quiet grey panels. */
    --green:  #1b7a4b;
    --red:    #171717;
    --yellow: #525252;
    --amber:  #525252;
    --blue:   #2b5f7d;

    /* Kit v1 semantic tokens — the white half of the mirror above. */
    --surface-0:   #ffffff;
    --surface-1:   #f7f7f8;
    --surface-2:   #efeff1;
    --line:        #e6e6ea;
    --line-strong: #d4d4d8;
    --ink:         #08080a;
    --ink-2:       #5c5c66;
    --ink-3:       #6b6b75;
    --on-ink:      #ffffff;
    --ok:          #1b7a4b;
    --ok-subtle:   #eef7f1;
    --focus:       #08080a;

    --ring-warn: 0 0 0 3px rgba(82,82,82,0.18);
    --ring-err:  0 0 0 3px rgba(23,23,23,0.18);

    --elev-0: 0 0 0 1px var(--border);
    --elev-1: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px var(--border);
    --elev-2: 0 8px 24px -10px rgba(0,0,0,0.08), 0 0 0 1px var(--border);
    --elev-3: 0 20px 48px -16px rgba(0,0,0,0.12), 0 0 0 1px var(--border-strong);
  }


  /* Theme toggle — show the icon for the *opposite* theme so users see what they'll switch to. */
  .nav-theme { display: inline-flex; align-items: center; font-size: 15px; line-height: 1; opacity: 0.85; }
  .nav-theme:hover { opacity: 1; }
  .nav-digest { display: inline-flex; align-items: center; opacity: 0.85; }
  .nav-digest:hover { opacity: 1; }
  :root[data-theme='dark'] .theme-icon-dark { display: none; }
  :root[data-theme='light'] .theme-icon-light { display: none; }
  /* The theme switch is a pair of links (/theme/set?mode=dark|light); only the
     one that changes something shows. !important: the mobile menu's
     .nav-link display rules come later at equal specificity. */
  :root[data-theme='dark'] .theme-set--dark,
  :root:not([data-theme='dark']) .theme-set--light { display: none !important; }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  *::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text-strong); }

  html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

  body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: -0.011em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: 'calt', 'kern';
    /* Subtle: prefers grayscale font smoothing on macOS for thin text,
       and disables automatic synthesis of bold/italic which can produce
       muddier rendering on certain weights. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
  }
  /* Heading scale — confident, editorial, tight tracking. Single
     source of truth (token-based); the older hardcoded-px block that
     preceded this was fully overridden (dead) and has been folded in
     here, carrying over only its unique margin-top: 0. */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.18;
    color: var(--text-strong);
    margin-top: 0;
  }
  h1 { font-size: var(--t-xl); letter-spacing: -0.028em; }
  h2 { font-size: var(--t-lg); letter-spacing: -0.022em; }
  h3 { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.015em; }
  h4 { font-size: var(--t-base); font-weight: 600; letter-spacing: -0.01em; }
  h5, h6 { font-size: var(--t-sm); font-weight: 600; letter-spacing: -0.005em; }

  /* Link refinement — single collapsed rule. The earlier duplicate
     a{}/a:hover (underline on hover) was overridden by the later
     a:hover (no underline), which wins and is kept here. */
  a { color: var(--text-link); text-decoration: none; transition: color var(--t-fast) var(--ease); }
  a:hover { color: var(--accent-hover); text-decoration: none; }
  a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
    border-radius: 3px;
  }

  /* No full-page atmosphere overlay — clean backgrounds signal trustworthy
     infrastructure. Effects live on pages that earn them (landing hero only). */

  /* Editorial display heading utility — used by landing + marketing pages */
  .display {
    font-family: var(--font-display);
    font-size: clamp(40px, 7.5vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 600;
    color: var(--text-strong);
  }

  /* Eyebrow — uppercase mono label that sits above section headings */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s-3);
  }
  .eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
  }

  /* Section header — paired eyebrow + title + lede */
  .section-header { max-width: 720px; margin: 0 auto var(--s-10); text-align: center; }
  .section-header.left { text-align: left; margin-left: 0; margin-right: auto; }
  .section-header h2 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.028em;
    margin-bottom: var(--s-3);
  }
  .section-header p {
    color: var(--text-muted);
    font-size: var(--t-md);
    line-height: 1.6;
    max-width: 580px;
    margin: 0 auto;
  }
  .section-header.left p { margin-left: 0; }

  code, kbd, samp {
    font-family: var(--font-mono);
    font-feature-settings: var(--mono-feat);
  }
  code {
    font-size: 0.9em;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    color: var(--text);
  }
  kbd, .kbd {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--text);
    line-height: 1.5;
    vertical-align: middle;
  }

  /* Mono utility for technical chrome (paths, IDs, dates) */
  .mono { font-family: var(--font-mono); font-feature-settings: var(--mono-feat); font-size: 0.96em; }
  .meta-mono { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-muted); letter-spacing: 0; }

  /* Pre-launch banner — slim, refined, mono caption */
  .prelaunch-banner {
    position: relative;
    background:
      linear-gradient(180deg, rgba(200,200,200,0.10), rgba(200,200,200,0.03)),
      var(--bg);
    border-bottom: 1px solid rgba(200,200,200,0.28);
    color: var(--yellow);
    padding: 7px 24px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .prelaunch-banner::before {
    content: '◆';
    margin-right: 8px;
    font-size: 9px;
    opacity: 0.7;
    vertical-align: 1px;
  }

  /* Block Q3 — Playground banner. Brighter than the prelaunch strip so
     visitors don't miss the "save your work" CTA, but slim enough to
     not feel like a modal. */
  .playground-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background:
      linear-gradient(180deg, rgba(200,200,200,0.20), rgba(200,200,200,0.06)),
      var(--bg);
    border-bottom: 1px solid rgba(200,200,200,0.45);
    color: var(--yellow, #c8c8c8);
    padding: 8px 40px 8px 24px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
  }
  .playground-banner-icon { font-size: 14px; }
  .playground-banner-text { color: var(--text-strong, #e6edf3); }
  .playground-banner-countdown { font-weight: 600; }
  .playground-banner-cta {
    margin-left: 4px;
    color: var(--yellow, #c8c8c8);
    text-decoration: underline;
    font-weight: 600;
  }
  .playground-banner-cta:hover { opacity: 0.85; }
  .playground-banner-dismiss {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
  }
  .playground-banner-dismiss:hover { color: var(--text-strong, #e6edf3); }

  /* Site nav header — sticky, blurred, hairline border. Scoped to
     .site-header: pages use semantic <header> elements for section/hero
     headings, and a bare element selector here turns every one of them
     into a 64px sticky bar (the /pricing hero-overlap bug). */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: var(--header-h);
    background: rgba(13,17,23,0.80);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
  }
  :root[data-theme='light'] .site-header { background: rgba(251,251,252,0.85); }

  .site-header nav {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1920px;
    margin: 0 auto;
    height: 100%;
  }
  .logo {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-strong);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: opacity var(--t-fast) var(--ease);
  }
  .instance-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    white-space: nowrap;
    letter-spacing: 0;
  }
  .instance-badge.is-self-hosted {
    color: #555555;
    border-color: #adadad;
    background: rgba(173,173,173,0.12);
  }
  :root[data-theme='dark'] .instance-badge.is-self-hosted {
    color: #cacaca;
    border-color: rgba(202,202,202,0.55);
    background: rgba(202,202,202,0.10);
  }
  @media (max-width: 640px) { .instance-badge { display: none; } }
  .logo::before {
    content: '';
    width: 20px; height: 20px;
    border-radius: 6px;
    background: var(--accent);
    box-shadow: none;
    flex-shrink: 0;
    transition: box-shadow var(--dur-base) var(--ease);
  }
  .logo:hover { text-decoration: none; color: var(--text-strong); }
  .logo:hover::before {
    box-shadow: none;
  }

  .nav-search {
    flex: 1;
    max-width: 360px;
    margin: 0 4px 0 8px;
    position: relative;
  }
  .nav-search input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--t-sm);
    transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  }
  .nav-search::before {
    content: '';
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    width: 12px; height: 12px;
    border: 1.5px solid var(--text-faint);
    border-radius: 50%;
    pointer-events: none;
  }
  .nav-search::after {
    content: '';
    position: absolute;
    left: 19px; top: calc(50% + 4px);
    width: 5px; height: 1.5px;
    background: var(--text-faint);
    transform: rotate(45deg);
    pointer-events: none;
  }
  .nav-search input::placeholder { color: var(--text-faint); }
  .nav-search input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--border-focus);
    box-shadow: var(--ring);
  }

  .nav-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }

  /* Block N3 — site-admin deploy status pill */
  .nav-deploy-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin: 0 6px 0 0;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-strong);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  }
  .nav-deploy-pill:hover { background: var(--bg-hover); text-decoration: none; }
  .nav-deploy-pill .deploy-pill-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6b7280;
  }
  .deploy-pill-success .deploy-pill-dot { background: #34d399; }
  .deploy-pill-failed  .deploy-pill-dot { background: #9b9b9b; }
  .deploy-pill-failed  { border-color: rgba(155,155,155,0.4); }
  .deploy-pill-progress .deploy-pill-dot {
    background: #c8c8c8;
    animation: deployPillPulse 1.2s ease-in-out infinite;
  }
  @keyframes deployPillPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.8); }
  }
  .deploy-pill-empty .deploy-pill-dot { background: #9ca3af; }

  /* ── AI dropdown (nav consolidation) ── */
  .nav-ai-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .nav-ai-trigger {
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-weight: 500;
    padding: 7px 11px;
    border-radius: var(--r-sm);
    line-height: 1.2;
  }
  .nav-ai-trigger:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
  .nav-ai-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.40), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
    padding: 6px;
    display: none;
    z-index: var(--z-overlay, 100);
  }
  .nav-ai-dropdown:hover .nav-ai-menu,
  .nav-ai-dropdown.is-open .nav-ai-menu,
  .nav-ai-dropdown:focus-within .nav-ai-menu {
    display: block;
  }
  .nav-ai-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    transition: background var(--t-fast) var(--ease);
  }
  .nav-ai-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--text-strong);
  }
  .nav-ai-item-label {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--text-strong);
  }
  .nav-ai-item-sub {
    font-size: 11.5px;
    color: var(--text-muted);
  }

  .nav-link {
    position: relative;
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-weight: 500;
    padding: 7px 11px;
    border-radius: var(--r-sm);
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  }
  .nav-link:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
    text-decoration: none;
  }
  .nav-link.active { color: var(--text-strong); }
  .nav-link.active::after {
    content: '';
    position: absolute;
    left: 11px; right: 11px;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
  }
  /* "Migrate from GitHub" nav link — logged-out only, slightly accented
     so it reads as an action affordance rather than a passive link. */
  .nav-migrate {
    color: var(--accent);
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--text-strong) 13%, transparent);
    background: color-mix(in srgb, var(--text-strong) 3%, transparent);
  }
  .nav-migrate:hover {
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--text-strong) 6%, transparent);
    border-color: color-mix(in srgb, var(--text-strong) 24%, transparent);
  }
  @media (max-width: 780px) { .nav-migrate { display: none; } }

  /* ── Mobile nav ──────────────────────────��──────────────────── */
  @media (max-width: 640px) {
    .site-header nav { gap: 10px; padding: 0 var(--space-3); }
    .nav-search { display: none; }
    .nav-right { gap: 4px; }
    .nav-link { display: none; }
    .nav-ai-dropdown { display: none; }
    .nav-deploy-pill .deploy-pill-text { display: none; }
    .nav-inbox-btn .nav-inbox-badge { font-size: 9px; min-width: 14px; height: 14px; }
    /* The header overflowed a 390px phone by 9px on every logged-out page
       (logo 91 + prelaunch pill 151 + hamburger + Register + gaps = 377 in a
       342px row): the page scrolled sideways and the production-readiness
       overflow gate failed. 24px of header padding on top of the nav's own
       12px was the waste; the pill (nowrap, so it could never shrink) keeps
       its meaning in one word — the full sentence is its title/aria-label
       and the footer note. */
    .site-header { padding: 0 var(--space-2); }
    .site-header .prelaunch-pill { margin-left: 0 !important; flex-shrink: 1; min-width: 0; overflow: hidden; }
    .site-header .prelaunch-pill-detail { display: none; }
  }

  /* ── Mobile hamburger ─────────────────────────────────────────
     client-js.ts inserts .hamburger-btn and marks .nav-right
     .mobile-hidden below 768px, toggling .mobile-hidden/.mobile-visible
     on tap. Until 2026-10 neither class had a single rule, so the button
     toggled nothing and the full signed-in nav-right (inbox + New +
     avatar, ~154px) stayed in the row: every signed-in page scrolled
     sideways at 375px (GateTest walk). Collapsed now keeps only the one
     control that matters most (.nav-keep: the avatar menu signed in,
     Register signed out); the hamburger opens everything else as a
     wrapping panel under the header. Breakpoint matches the JS (768). */
  .hamburger-btn { display: none; }
  @media (max-width: 767px) {
    .hamburger-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px; height: 34px;
      margin-left: auto;
      flex-shrink: 0;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: var(--r-sm);
      background: transparent;
      color: var(--text);
      font-size: 16px;
      line-height: 1;
      cursor: pointer;
    }
    .hamburger-btn:hover { background: var(--bg-hover); }
    .nav-right.mobile-hidden { margin-left: 4px; flex-shrink: 0; }
    .nav-right.mobile-hidden > :not(.nav-keep) { display: none !important; }
    /* Collapsed, the avatar alone opens the menu; the name and caret
       (up to ~150px) are what overflowed between 641 and 767px. */
    .nav-right.mobile-hidden .nav-user-name,
    .nav-right.mobile-hidden .nav-user-caret { display: none; }
    .nav-right.mobile-visible {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      margin: 0;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      padding: 10px var(--space-3);
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 10px 24px -16px rgba(0,0,0,0.35);
    }
    .nav-right.mobile-visible .nav-link { display: inline-flex; }
    .nav-right.mobile-visible .nav-ai-dropdown { display: block; }
    /* Last in the row, flush right, so its right-anchored menu opens
       inside the viewport. */
    .nav-right.mobile-visible .nav-user-dropdown { margin-left: auto; }
  }

  .nav-user {
    color: var(--text-strong);
    font-weight: 600;
    font-size: var(--t-sm);
    padding: 6px 10px;
    border-radius: var(--r-sm);
    margin-left: 6px;
    transition: background var(--t-fast) var(--ease);
  }
  .nav-user::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: 1px;
  }
  .nav-user:hover { background: var(--bg-hover); text-decoration: none; }

  /* ── Inbox bell button ── */
  .nav-inbox-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    color: var(--text-muted);
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
    flex-shrink: 0;
  }
  .nav-inbox-btn:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
  .nav-inbox-badge {
    position: absolute;
    top: 3px; right: 3px;
    min-width: 15px; height: 15px;
    padding: 0 4px;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 15px;
    color: #fff;
    background: var(--accent);
    border-radius: 9999px;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  /* ── User dropdown ── */
  .nav-user-dropdown { position: relative; }
  .nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px 5px 5px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--t-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  }
  .nav-user-trigger:hover { background: var(--bg-hover); border-color: var(--border); }
  .nav-user-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--border);
  }
  .nav-user-name { font-weight: 500; font-size: var(--t-sm); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-user-caret { font-size: 8px; opacity: 0.5; }
  .nav-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: 0 16px 48px -8px rgba(0,0,0,0.55), 0 0 0 1px var(--border);
    padding: 6px;
    z-index: 200;
    animation: navMenuIn 140ms var(--ease) both;
  }
  .nav-user-menu.is-open { display: block; }
  .nav-user-menu-header {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .nav-user-menu-name { font-weight: 600; font-size: var(--t-sm); color: var(--text-strong); }
  .nav-user-menu-handle { font-size: var(--t-xs); color: var(--text-muted); }
  .nav-user-menu-sep { height: 1px; background: var(--border); margin: 4px -6px; }
  .nav-user-item {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: var(--t-sm);
    color: var(--text);
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    white-space: nowrap;
  }
  .nav-user-item:hover { background: var(--bg-hover); color: var(--text-strong); text-decoration: none; }
  .nav-user-item--danger { color: var(--red); }
  .nav-user-item--danger:hover { background: rgba(155,155,155,0.08); color: var(--red); }

  @keyframes navMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    /* Subtle entrance fade on page load — kept short (180ms) so it
       reads as responsiveness, not theatre. Honors reduced-motion. */
    animation: gxMainEnter 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes gxMainEnter {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @media (prefers-reduced-motion: reduce) {
    main { animation: none; }
  }
  /* 2026 polish — accent focus ring across all focusable elements.
     The default browser ring is utilitarian; this is the same width
     but tinted to the brand accent so keyboard navigation feels
     intentional, not jarring. :focus-visible only — mouse users
     never see it. */
  :focus-visible {
    outline: none;
  }
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Editorial footer: link grid + tagline row */
  footer {
    border-top: 1px solid var(--border);
    padding: 56px 24px 40px;
    color: var(--text-muted);
    font-size: var(--t-sm);
    background: var(--bg);
  }
  footer .footer-inner {
    max-width: 1920px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: start;
  }
  footer .footer-brand .logo { margin-bottom: var(--s-3); }
  footer .footer-tag {
    color: var(--text-muted);
    font-size: var(--t-sm);
    max-width: 320px;
    line-height: 1.55;
  }
  footer .footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, auto));
    gap: 0 56px;
  }
  footer .footer-col-title {
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-faint);
    margin-bottom: var(--s-3);
  }
  footer .footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: var(--t-sm);
    padding: 5px 0;
    transition: color var(--t-fast) var(--ease);
  }
  footer .footer-col a:hover { color: var(--text-strong); text-decoration: none; }
  footer .footer-bottom {
    max-width: 1920px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-faint);
    font-size: var(--t-xs);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
  }
  footer .footer-bottom a { color: var(--text-faint); }
  footer .footer-bottom a:hover { color: var(--text-muted); text-decoration: none; }
  footer .footer-build {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: help;
  }
  footer .footer-build-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    opacity: 0.9;
  }
  @media (max-width: 768px) {
    main { padding: 20px 14px 60px; }
    footer .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    footer .footer-links { grid-template-columns: repeat(2, 1fr); gap: 24px 32px; }
    footer .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  }
  @media (max-width: 480px) {
    main { padding: 14px 10px 48px; }
  }

  /* ============================================================ */
  /* Buttons                                                      */
  /* ============================================================ */
  /* ============================================================ */
  /* Buttons — Block U2 senior polish pass.                       */
  /* Rules:                                                       */
  /*  · hover lifts every .btn by 1px + soft drop shadow (180ms)  */
  /*  · active presses back down to 0 (80ms — faster on press)    */
  /*  · focus-visible uses a soft box-shadow ring (no outline)    */
  /*  · primary gradient shifts position on hover for a slow      */
  /*    600ms shimmer                                             */
  /*  · disabled never lifts and never animates                   */
  /* ============================================================ */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: var(--t-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
    letter-spacing: -0.008em;
    /* U2 — hover/transform settles in 180ms; press snaps in 80ms.
       Listed once on the base rule so :active can override only the
       transform/duration without re-typing the colour/bg transitions. */
    transition:
      background 180ms ease,
      border-color 180ms ease,
      transform 180ms ease,
      box-shadow 180ms ease,
      color 180ms ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
  }
  .btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text-strong);
    text-decoration: none;
    /* U2 — universal hover lift + soft accent drop shadow. */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(15, 17, 26, 0.45);
  }
  .btn:active {
    transform: translateY(0);
    transition-duration: 80ms;
  }
  /* U2 — soft modern focus ring via box-shadow, not outline.
     The literal legacy declaration is kept for external tooling that
     greps for the U2 contract; the var(--ring) declaration after it
     wins the cascade and renders the calm indigo ring. */
  .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
    box-shadow: var(--ring);
  }

  .btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.12),
      0 1px 2px rgba(0,0,0,0.25);
    transition:
      background 180ms ease,
      transform 180ms ease,
      box-shadow 180ms ease,
      color 180ms ease;
  }
  .btn-primary:hover {
    color: #fff;
    background: var(--accent-hover);
    border-color: transparent;
    transform: translateY(-1px);
    filter: none;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.15),
      0 4px 12px rgba(0,0,0,0.25);
  }
  .btn-primary:active { transform: translateY(0); transition-duration: 80ms; }
  /* U2 — primary focus ring uses the same accent box-shadow recipe. */
  .btn-primary:focus-visible {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.22),
      0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  }

  /* Quiet Intelligence (light) — primary actions are calm ink #16181d,
     not indigo. The indigo accent is reserved for links + active state,
     which is what reads as "trustworthy tool" vs "gamer SaaS". Scoped to
     the light theme only; the dark-theme gradient rules above are
     intentionally left byte-identical. */
  :root[data-theme='light'] .btn-primary {
    background: #16181d;
    color: #fff;
    text-shadow: none;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      0 1px 2px rgba(22,24,29,0.24),
      0 0 0 1px rgba(22,24,29,0.90);
  }
  :root[data-theme='light'] .btn-primary:hover {
    background: #2a2d35;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.10),
      0 6px 18px -6px rgba(22,24,29,0.30),
      0 0 0 1px rgba(22,24,29,0.90);
  }
  :root[data-theme='light'] .btn-primary:focus-visible {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  }

  .btn-danger {
    background: transparent;
    border-color: rgba(155,155,155,0.40);
    color: var(--red);
  }
  .btn-danger:hover {
    background: rgba(155,155,155,0.08);
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(155,155,155,0.30);
  }
  .btn-danger:focus-visible { box-shadow: 0 0 0 3px rgba(155,155,155,0.35); }

  .btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
  }
  .btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-strong);
    border-color: var(--border);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(15, 17, 26, 0.30);
  }

  .btn-secondary {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text-strong);
  }
  .btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(15, 17, 26, 0.35);
  }

  .btn-sm  { padding: 4px 10px; font-size: var(--t-xs); border-radius: var(--r-sm); gap: 5px; }
  .btn-lg  { padding: 11px 22px; font-size: var(--t-base); border-radius: var(--r); }
  .btn-xl  { padding: 14px 28px; font-size: var(--t-md); border-radius: var(--r); font-weight: 600; }
  .btn-block { width: 100%; }

  /* U2 — disabled never lifts, never shimmers, never glows. */
  .btn:disabled,
  .btn[aria-disabled='true'],
  .btn:disabled:hover,
  .btn[aria-disabled='true']:hover {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
  }
  @media (prefers-reduced-motion: reduce) {
    .btn,
    .btn:hover,
    .btn:active,
    .btn-primary,
    .btn-primary:hover {
      transform: none;
      transition: background-color 80ms linear, color 80ms linear;
    }
  }

  /* ============================================================ */
  /* Forms                                                        */
  /* ============================================================ */
  .form-group { margin-bottom: 20px; }
  .form-group label {
    display: block;
    font-size: var(--t-sm);
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  .form-group input,
  .form-group textarea,
  .form-group select,
  input[type='text'], input[type='email'], input[type='password'],
  input[type='url'], input[type='search'], input[type='number'],
  textarea, select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: var(--t-sm);
    font-family: var(--font-sans);
    transition:
      border-color var(--t-fast) var(--ease),
      background var(--t-fast) var(--ease),
      box-shadow var(--t-fast) var(--ease);
  }
  .form-group input::placeholder, textarea::placeholder, input::placeholder {
    color: var(--text-faint);
  }
  .form-group input:hover, textarea:hover, select:hover,
  input[type='text']:hover, input[type='email']:hover, input[type='password']:hover {
    border-color: var(--border-strong);
  }
  .form-group input:focus, .form-group textarea:focus, .form-group select:focus,
  input:focus, textarea:focus, select:focus {
    outline: none;
    background: var(--bg);
    border-color: var(--border-focus);
    box-shadow: var(--ring);
  }
  textarea { font-family: var(--font-mono); font-size: var(--t-sm); line-height: 1.55; }
  .input-disabled { opacity: 0.5; cursor: not-allowed; }

  /* ============================================================ */
  /* Auth (register / login / verify)                             */
  /* ============================================================ */
  .auth-container {
    /* Collapsed to one rule — the later plainer .auth-container (in the
       2026 polish layer) won on background/padding/border-radius/box-shadow,
       so those values are folded in here; the 480px width + centering +
       positioning survive from the original premium-gateway block. */
    max-width: 480px;
    margin: 72px auto;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.30), 0 0 0 1px var(--border);
    position: relative;
    overflow: hidden;
  }
  /* Both heading levels share this rule so an auth page's primary heading can
     be semantically top-level without any visual change; the rule fully
     specifies size and weight, so narrowing it would let the generic heading
     size take over. See src/routes/auth.tsx for why these were h2. NOTE: this
     string is emitted verbatim into every page, so keep tag-like literals out
     of it — they make the markup look like it contains elements it does not. */
  .auth-container h1,
  .auth-container h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: -0.025em;
    color: var(--text-strong);
    line-height: 1.15;
  }
  .auth-container .auth-subtitle {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0 0 24px;
  }
  .auth-container > p {
    color: var(--text-muted);
    font-size: var(--t-sm);
    margin-bottom: 24px;
  }
  .auth-container .btn-primary {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
  }

  /* OAuth provider buttons (Google / GitHub / SSO). Single-line layout
     with a brand-coloured logo on the left and a label centred-trailing.
     Hover lifts 1px with a subtle shadow — matches the rest of the
     button system but reads as a brand-affiliated action, not a brand-
     coloured primary CTA. */
  .auth-container .oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-surface, var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--r-md, 8px);
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition:
      transform var(--dur-base, 180ms) var(--ease, ease),
      box-shadow var(--dur-base, 180ms) var(--ease, ease),
      background var(--t-fast, 120ms) var(--ease, ease),
      border-color var(--t-fast, 120ms) var(--ease, ease);
  }
  .auth-container .oauth-btn:hover {
    transform: translateY(-1px);
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-strong);
    box-shadow: 0 4px 14px -4px rgba(0,0,0,0.25);
    text-decoration: none;
  }
  .auth-container .oauth-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
  }
  .auth-container .oauth-btn .oauth-icon {
    flex-shrink: 0;
  }
  /* GitHub icon adopts the text colour so it reads in both themes. */
  .auth-container .oauth-github .oauth-icon {
    color: var(--text-strong);
  }
  /* Google logo uses the official 4-colour treatment via inline SVG fill
     attributes — nothing to override here. */
  /* "or" divider between the password form and provider buttons */
  .auth-container .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 12px;
    color: var(--text-faint);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .auth-container .auth-divider::before,
  .auth-container .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }
  .auth-error {
    background: rgba(155,155,155,0.08);
    border: 1px solid rgba(155,155,155,0.35);
    color: var(--red);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    margin-bottom: 16px;
    font-size: var(--t-sm);
  }
  .auth-success {
    background: rgba(52,211,153,0.08);
    border: 1px solid rgba(52,211,153,0.35);
    color: var(--green);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    margin-bottom: 16px;
    font-size: var(--t-sm);
  }
  .auth-switch {
    margin-top: 20px;
    font-size: var(--t-sm);
    color: var(--text-muted);
    text-align: center;
  }
  .banner {
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--text-strong) 21%, transparent);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: var(--t-sm);
  }

  /* ============================================================ */
  /* Settings                                                     */
  /* ============================================================ */
  .settings-container { max-width: 720px; }
  .settings-container h2 { margin-bottom: 8px; font-size: var(--t-xl); letter-spacing: -0.02em; }
  .settings-container > h2 + p { color: var(--text-muted); font-size: var(--t-sm); margin-bottom: 24px; }
  .settings-container h3 { font-size: var(--t-md); margin-bottom: 12px; margin-top: 28px; }
  .settings-container h3:first-of-type { margin-top: 0; }
  .ssh-keys-list { margin-bottom: 24px; }
  .ssh-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 8px;
    background: var(--bg-elevated);
    transition: border-color var(--t-fast) var(--ease);
  }
  .ssh-key-item:hover { border-color: var(--border-strong); }
  .ssh-key-meta { font-size: var(--t-xs); color: var(--text-muted); margin-top: 4px; }
  .ssh-key-meta code { font-size: var(--t-xs); background: var(--bg-tertiary); padding: 1px 6px; border-radius: 3px; margin-right: 8px; }

  /* ============================================================ */
  /* Repo header + nav                                            */
  /* ============================================================ */
  .repo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
  }
  .repo-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: -0.025em;
    flex-wrap: wrap;
  }
  .repo-header .owner {
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--t-fast) var(--ease);
  }
  .repo-header .owner:hover { color: var(--text-link); text-decoration: none; }
  .repo-header .separator { color: var(--text-faint); font-weight: 300; }
  .repo-header .name {
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: -0.028em;
  }
  .repo-header .name:hover { color: var(--text-link); text-decoration: none; }
  .repo-header-fork {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.01em;
  }
  .repo-header-fork a { color: var(--text-muted); }
  .repo-header-fork a:hover { color: var(--accent); }
  .repo-header-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--r-full);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.6;
    vertical-align: 4px;
  }
  .repo-header-pill-archived {
    background: rgba(200,200,200,0.10);
    color: var(--yellow);
    border: 1px solid rgba(200,200,200,0.30);
  }
  .repo-header-pill-template {
    background: var(--bg-secondary);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--text-strong) 18%, transparent);
  }
  .repo-header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

  /* Push Watch discoverability — live/recent indicator in the repo header */
  .repo-header-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    vertical-align: 3px;
    transition: filter 140ms ease, opacity 140ms ease;
  }
  .repo-header-live-badge:hover { filter: brightness(1.15); text-decoration: none !important; }
  .repo-header-live-badge--live {
    background: rgba(117,117,117, 0.12);
    color: #9c9c9c;
    border: 1px solid rgba(117,117,117, 0.35);
  }
  .repo-header-live-badge--live .repo-header-live-dot {
    background: #22c55e;
    display: inline-block;
  }
  .repo-header-live-badge--recent {
    background: color-mix(in srgb, var(--text-strong) 4%, transparent);
    color: var(--text-muted);
    border: 1px solid color-mix(in srgb, var(--text-strong) 13%, transparent);
  }
  .repo-header-live-badge--recent:hover { color: var(--accent); }

  .repo-nav {
    display: flex;
    gap: 1px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    overflow-x: auto;
    /* scrollbar-width:thin still PAINTS a bar, and overflow-x:auto forces
       overflow-y to auto (see the note below), so the 1px that .repo-nav a
       pushes past the box with margin-bottom:-1px was enough to render a tiny
       VERTICAL scrollbar — arrows and all — at the right-hand end of a
       HORIZONTAL tab row, on every repo page. Setting none stops it being
       painted without changing a single box: the row still scrolls on a
       phone, which is the only reason overflow-x is here. */
    scrollbar-width: none;
  }
  /* overflow-x:auto exists so the tab row scrolls on phones — but per the
     CSS spec, overflow-x:auto forces overflow-y to auto as well, so this
     container CLIPS its absolutely-positioned children. The AI and More
     dropdowns live inside it: they opened into a 44px-tall scroll area and
     were cut to nothing. The button worked, the panel rendered, the user
     saw nothing — "the More button is not working, might be an overlay
     problem", reported 2026-08-05, and precisely right.
     While a menu is open, stop clipping; when it closes, phone scrolling
     returns. :has() for modern browsers, plus a JS-toggled class from the
     RepoNav script as the no-:has fallback. */
  .repo-nav:has(details.repo-nav-menu[open]),
  .repo-nav.repo-nav--menu-open {
    overflow: visible;
  }
  /* height:0 hides the horizontal bar; the vertical one needs width:0.
     Zeroing only height is why the vertical bar survived. */
  .repo-nav::-webkit-scrollbar { height: 0; width: 0; }
  .repo-nav a {
    position: relative;
    padding: 12px 16px;
    /* Owner, 2026-09-09, looking at /ccantynz/Vapron/actions: "tabs are
       really hard to see". They were 13px muted grey on white with a faint
       underline — the primary navigation of every repo page reading as a
       footnote. Body ink at 14px for the resting state; the accent is spent
       only on the active tab (text + underline) so it reads at a glance. */
    color: var(--text);
    border-bottom: 2px solid transparent;
    font-size: var(--t-base, 14px);
    font-weight: 500;
    margin-bottom: -1px;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
    white-space: nowrap;
  }
  .repo-nav a:hover { text-decoration: none; color: var(--text-strong); background: var(--bg-hover); }
  .repo-nav a.active {
    color: var(--accent);
    font-weight: 600;
  }
  .repo-nav a.active::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -1px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
  }
  /* AI links in the right-side cluster — sparkle accent */
  .repo-nav-ai {
    color: var(--accent) !important;
    font-weight: 500;
  }
  .repo-nav-ai:hover {
    color: var(--accent-hover) !important;
    background: var(--bg-secondary) !important;
  }
  .repo-nav-ai.active {
    color: var(--accent-hover) !important;
    font-weight: 600;
  }

  /* Repo-nav dropdown menus (✨ AI / More) — native <details> disclosure */
  .repo-nav-menu {
    position: relative;
    display: inline-flex;
    align-items: stretch;
  }
  .repo-nav-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 11px 14px;
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  }
  .repo-nav-menu > summary::-webkit-details-marker { display: none; }
  .repo-nav-menu > summary::after {
    content: "\25BE";
    font-size: 9px;
    opacity: 0.55;
  }
  .repo-nav-menu > summary:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
  .repo-nav-menu.is-active > summary { color: var(--text-strong); font-weight: 600; }
  .repo-nav-menu[open] > summary { color: var(--text-strong); background: var(--bg-hover); }
  .repo-nav-ai-menu > summary { color: var(--accent) !important; }
  .repo-nav-ai-menu > summary:hover {
    color: var(--accent-hover) !important;
    background: var(--bg-secondary) !important;
  }

  .repo-nav-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
    padding: 6px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .repo-nav-menu-panel-right { left: auto; right: 0; }
  /* Grouped variant — the AI menu absorbed the old "AI surfaces" strip, so
     it now carries 14 destinations. A flat list of 14 is a wall; three
     labelled groups (Understand / Build / Ship) make it scannable and give
     each item a reason to be where it is. Columns on wide viewports so the
     panel stays shorter than the fold. */
  .repo-nav-menu-panel-grouped {
    min-width: 520px;
    max-width: min(92vw, 760px);
    flex-direction: row;
    /* wrap so (a) the AI-unavailable banner can take a full row of its own
       and (b) four More groups fold to two columns instead of overflowing
       the viewport on narrow desktops. */
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
  }
  .repo-nav-menu-group { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 150px; }
  .repo-nav-menu-heading {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 4px 10px 6px;
  }
  @media (max-width: 720px) {
    .repo-nav-menu-panel-grouped {
      min-width: 0;
      width: min(88vw, 320px);
      flex-direction: column;
    }
    .repo-nav-menu-group { width: 100%; }
    .repo-nav-menu-group + .repo-nav-menu-group { margin-top: var(--space-2); }
  }
  /* Override the inherited .repo-nav a tab styling inside the dropdown panel */
  .repo-nav-menu-panel a {
    position: static;
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    border-bottom: none;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-weight: 500;
    white-space: nowrap;
  }
  .repo-nav-menu-panel a::after { display: none !important; }
  .repo-nav-menu-panel a:hover { color: var(--text-strong); background: var(--bg-hover); }
  .repo-nav-menu-panel a.active {
    color: var(--text-strong);
    font-weight: 600;
    background: color-mix(in srgb, var(--text-strong) 6%, transparent);
  }
  /* AI items when no API key is configured — still real links (their
     fallback pages explain each feature), but visibly not-live. */
  .repo-nav-menu-panel a.is-muted { opacity: 0.55; }
  .repo-nav-menu-panel a.is-muted:hover { opacity: 0.85; }
  /* One honest line at the top of the AI menu when AI is unavailable. */
  .repo-nav-ai-banner {
    flex-basis: 100%;
    width: 100%;
    margin-bottom: var(--space-2);
    padding: 8px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--yellow) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--yellow) 30%, transparent);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    white-space: normal;
  }
  .repo-nav-ai-banner strong {
    display: block;
    color: var(--text-strong);
    font-weight: 600;
  }
  .repo-nav-ai-banner a { color: var(--accent); }

  .breadcrumb {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-family: var(--font-mono);
    font-feature-settings: var(--mono-feat);
  }
  .breadcrumb a { color: var(--text-link); font-weight: 500; }
  .breadcrumb a:hover { color: var(--accent-hover); }
  .breadcrumb strong {
    color: var(--text-strong);
    font-weight: 600;
  }

  /* Page header — eyebrow + title + optional actions row.
     Use on dashboard, settings, admin, any "section landing" page. */
  .page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
  }
  .page-header-text { flex: 1; min-width: 280px; }
  .page-header .eyebrow { margin-bottom: var(--s-2); }
  .page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.028em;
    margin-bottom: 6px;
  }
  .page-header p {
    color: var(--text-muted);
    font-size: var(--t-sm);
    line-height: 1.55;
    max-width: 640px;
  }
  .page-header-actions { display: flex; gap: 8px; align-items: center; }

  /* ============================================================ */
  /* File browser table                                           */
  /* ============================================================ */
  .file-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-elevated);
    border-collapse: collapse;
  }
  .file-table tr { border-bottom: 1px solid var(--border-subtle); transition: background var(--t-fast) var(--ease); }
  .file-table tr:last-child { border-bottom: none; }
  .file-table td {
    padding: 9px 16px;
    font-size: var(--t-sm);
    font-family: var(--font-mono);
    font-feature-settings: var(--mono-feat);
  }
  .file-table tr:hover { background: var(--bg-hover); }
  .file-icon {
    width: 22px;
    color: var(--text-faint);
    font-size: 13px;
    text-align: center;
  }
  .file-name a {
    color: var(--text);
    font-weight: 500;
    transition: color var(--t-fast) var(--ease);
  }
  .file-name a:hover { color: var(--accent); text-decoration: none; }

  /* Inline SVG marks replacing the old 📁 / 📄 emoji. currentColor so they
     track the theme; directories take the accent so the eye can separate
     folders from files without reading the names. */
  .file-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
  }
  .file-mark-dir { color: color-mix(in srgb, var(--accent) 72%, var(--text-faint)); }

  /* Commit context. The name column keeps the space it needs; the commit
     subject takes what's left and truncates rather than wrapping, so rows
     stay one line and the table stays scannable. */
  .file-commit {
    width: 100%;
    max-width: 0;           /* lets the cell shrink so ellipsis engages */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
  }
  .file-commit a { color: var(--text-muted); font-weight: 400; }
  .file-commit a:hover { color: var(--text); text-decoration: underline; }
  .file-age {
    white-space: nowrap;
    text-align: right;
    color: var(--text-faint);
    font-size: var(--t-xs);
  }
  .file-size {
    text-align: right;
    color: var(--text-muted);
    font-size: var(--t-xs);
    white-space: nowrap;
  }
  .file-table-with-commits .file-name { white-space: nowrap; }
  /* On narrow viewports the subject is the first thing to go — the name and
     "when" are what you navigate by. */
  @media (max-width: 720px) {
    .file-commit { display: none; }
    /* With the subject gone the name takes the row, and a long one
       truncates instead of widening the table: at 375px the listing was
       449px wide and the whole page scrolled sideways (GateTest walk). The
       full name stays in the link's title. Same max-width:0 trick as
       .file-commit above. */
    .file-table td { padding: 9px 10px; }
    .file-table .file-name {
      width: 100%;
      max-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
  @media (max-width: 480px) {
    .file-size { display: none; }
  }

  /* ============================================================ */
  /* Blob view                                                    */
  /* ============================================================ */
  .blob-view {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-elevated);
  }
  .blob-header {
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: var(--t-sm);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .blob-code {
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    line-height: 1.65;
  }
  .blob-code table { width: 100%; border-collapse: collapse; }
  .blob-code .line-num {
    width: 1%;
    min-width: 56px;
    padding: 0 14px;
    text-align: right;
    color: var(--text-faint);
    user-select: none;
    white-space: nowrap;
    border-right: 1px solid var(--border);
  }
  .blob-code .line-content { padding: 0 16px; white-space: pre; }
  .blob-code tr:hover { background: var(--bg-hover); }

  /* ============================================================ */
  /* Commits + diffs                                              */
  /* ============================================================ */
  .commit-list {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-elevated);
  }
  .commit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--t-fast) var(--ease);
  }
  .commit-item:last-child { border-bottom: none; }
  .commit-item:hover { background: var(--bg-hover); }
  .commit-message {
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-strong);
    letter-spacing: -0.005em;
  }
  .commit-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.01em;
  }
  .commit-sha {
    font-family: var(--font-mono);
    font-feature-settings: var(--mono-feat);
    font-size: 11px;
    padding: 4px 9px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--t-fast) var(--ease);
  }
  .commit-sha:hover {
    border-color: color-mix(in srgb, var(--text-strong) 24%, transparent);
    background: var(--bg-secondary);
    color: var(--accent-hover);
    text-decoration: none;
  }

  /* Diff viewer */
  .diff-view { margin-top: 16px; }
  .diff-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .diff-summary { font-size: var(--t-sm); color: var(--text-muted); }
  .diff-view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
  }
  .diff-view-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    font-family: var(--font-sans);
  }
  .diff-view-btn:not(:first-child) { border-left: 1px solid var(--border); }
  .diff-view-btn:hover { color: var(--text); background: var(--bg-hover); }
  .diff-view-btn.active { background: var(--accent); color: #fff; }
  .diff-jump-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
  }
  .diff-jump-item {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all var(--t-fast) var(--ease);
  }
  .diff-jump-item:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
  .diff-jump-mod { color: var(--text-muted); }
  .diff-file {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--bg-elevated);
  }
  .diff-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    gap: 12px;
  }
  .diff-file-header:hover { background: var(--bg-hover); }
  .diff-file-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
  .diff-file-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-family: var(--font-sans); font-size: 12px; }
  .diff-file-chevron { color: var(--text-muted); font-size: 12px; transition: transform var(--t-fast) var(--ease); display: inline-block; }
  .diff-file-header.collapsed .diff-file-chevron { transform: rotate(-90deg); }
  .diff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    line-height: 1.65;
    table-layout: fixed;
  }
  .diff-ln {
    width: 44px;
    min-width: 44px;
    text-align: right;
    padding: 0 8px;
    color: var(--text-muted);
    user-select: none;
    border-right: 1px solid var(--border-subtle);
    vertical-align: top;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0.55;
  }
  .diff-cell { padding: 0 4px 0 2px; white-space: pre; overflow: hidden; vertical-align: top; }
  .diff-sigil { display: inline-block; width: 14px; user-select: none; opacity: 0.7; text-align: center; }
  .diff-row-add .diff-ln, .diff-row-add .diff-cell { background: rgba(52,211,153,0.08); }
  .diff-row-add .diff-cell { color: var(--green); }
  .diff-row-add .diff-sigil { color: var(--green); opacity: 1; }
  .diff-row-del .diff-ln, .diff-row-del .diff-cell { background: rgba(155,155,155,0.07); }
  .diff-row-del .diff-cell { color: var(--red); }
  .diff-row-del .diff-sigil { color: var(--red); opacity: 1; }
  .diff-row-hunk .diff-ln, .diff-row-hunk .diff-cell { background: color-mix(in srgb, var(--text-strong) 2%, transparent); color: var(--text-link); font-size: 11px; }
  .diff-row-ws.diff-row-add .diff-cell { background: rgba(52,211,153,0.04); opacity: 0.75; }
  .diff-row-ws.diff-row-del .diff-cell { background: rgba(155,155,155,0.04); opacity: 0.75; }
  .diff-ws-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 0 4px;
    font-size: 9px;
    font-family: var(--font-sans);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: middle;
    opacity: 0.6;
    user-select: none;
  }
  .diff-table-split .diff-ln-old, .diff-table-split .diff-cell-del { background: rgba(155,155,155,0.07); }
  .diff-table-split .diff-cell-del { color: var(--red); }
  .diff-table-split .diff-ln-new, .diff-table-split .diff-cell-add { background: rgba(52,211,153,0.08); }
  .diff-table-split .diff-cell-add { color: var(--green); }
  .diff-table-split .diff-cell-empty { background: var(--bg-secondary); }
  .diff-table-split .diff-cell-ctx { color: var(--text); }
  .diff-table-split .diff-cell-ws { opacity: 0.6; }
  .diff-binary { padding: 16px; font-size: var(--t-sm); color: var(--text-muted); font-style: italic; }

  .stat-add { color: var(--green); font-weight: 600; }
  .stat-del { color: var(--red); font-weight: 600; }

  /* ============================================================ */
  /* Empty state                                                  */
  /* ============================================================ */
  .empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
    background: var(--bg);
  }
  .empty-state h2 {
    font-size: var(--t-xl);
    margin-bottom: 8px;
    color: var(--text-strong);
    letter-spacing: -0.022em;
  }
  .empty-state p { font-size: var(--t-md); max-width: 480px; margin: 0 auto; line-height: 1.55; }
  .empty-state pre {
    text-align: left;
    display: inline-block;
    background: var(--bg-secondary);
    padding: 18px 24px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-feature-settings: var(--mono-feat);
    font-size: var(--t-sm);
    margin-top: 24px;
    line-height: 1.8;
    color: var(--text);
    box-shadow: var(--elev-1);
  }

  /* ============================================================ */
  /* Badges                                                       */
  /* ============================================================ */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--r-full);
    font-size: var(--t-xs);
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1.5;
  }

  /* ============================================================ */
  /* Branch dropdown                                              */
  /* ============================================================ */
  .branch-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: var(--t-sm);
    color: var(--text);
    margin-bottom: 12px;
    transition: border-color var(--t-fast) var(--ease);
  }
  .branch-selector:hover { border-color: var(--border-strong); }

  .branch-dropdown {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
  }
  .branch-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 10;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--elev-3);
  }
  .branch-dropdown:hover .branch-dropdown-content,
  .branch-dropdown:focus-within .branch-dropdown-content { display: block; }
  .branch-dropdown-content a {
    display: block;
    padding: 9px 14px;
    font-size: var(--t-sm);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast) var(--ease);
  }
  .branch-dropdown-content a:last-child { border-bottom: none; }
  .branch-dropdown-content a:hover { background: var(--bg-hover); text-decoration: none; }
  .branch-dropdown-content a.active-branch { color: var(--text-link); font-weight: 600; background: var(--bg-secondary); }

  /* ============================================================ */
  /* Card grid                                                    */
  /* ============================================================ */
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
  }
  .card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    background: var(--bg-elevated);
    transition:
      border-color 160ms cubic-bezier(0.16,1,0.3,1),
      transform 160ms cubic-bezier(0.16,1,0.3,1),
      box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .card:hover {
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.30);
  }
  .card h3 { font-size: var(--t-md); margin-bottom: 6px; letter-spacing: -0.012em; }
  .card h3 a { color: var(--text); font-weight: 600; }
  .card h3 a:hover { color: var(--text-link); }
  .card p { font-size: var(--t-sm); color: var(--text-muted); line-height: 1.5; }
  .card-meta {
    display: flex;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: var(--t-xs);
    color: var(--text-muted);
  }
  .card-meta span { display: flex; align-items: center; gap: 5px; }

  /* ============================================================ */
  /* Stat card / box                                              */
  /* ============================================================ */
  .stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    transition: border-color var(--t-fast) var(--ease);
  }
  .stat-card:hover { border-color: var(--border-strong); }
  .stat-label {
    font-size: var(--t-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
  }
  .stat-value {
    font-size: var(--t-xl);
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: -0.025em;
    color: var(--text);
    font-feature-settings: 'tnum';
  }

  /* ============================================================ */
  /* Star button                                                  */
  /* ============================================================ */
  .star-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: var(--t-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
  }
  .star-btn:hover { background: var(--bg-surface); border-color: var(--border-strong); text-decoration: none; }
  .star-btn.starred {
    color: var(--yellow);
    border-color: rgba(200,200,200,0.4);
    background: rgba(200,200,200,0.08);
  }

  /* ============================================================ */
  /* User profile                                                 */
  /* ============================================================ */
  .user-profile {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
  }
  .user-avatar {
    width: 96px;
    height: 96px;
    border-radius: var(--r-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
    letter-spacing: -0.02em;
  }
  .user-info h2 { font-size: var(--t-xl); margin-bottom: 2px; letter-spacing: -0.025em; }
  .user-info .username { font-size: var(--t-md); color: var(--text-muted); }
  .user-info .bio { font-size: var(--t-sm); color: var(--text-muted); margin-top: 10px; line-height: 1.55; }

  /* ============================================================ */
  /* New repo form                                                */
  /* ============================================================ */
  .new-repo-form { max-width: 640px; }
  .new-repo-form h2 { margin-bottom: 24px; font-size: var(--t-xl); letter-spacing: -0.025em; }
  .visibility-options { display: flex; gap: 12px; margin-bottom: 20px; }
  .visibility-option {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-elevated);
    cursor: pointer;
    text-align: left;
    transition: all var(--t-fast) var(--ease);
  }
  .visibility-option:hover { border-color: var(--border-strong); background: var(--bg-surface); }
  .visibility-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .visibility-option input { display: none; }
  .visibility-option .vis-label { font-size: var(--t-sm); font-weight: 600; margin-bottom: 4px; }
  .visibility-option .vis-desc { font-size: var(--t-xs); color: var(--text-muted); }

  /* ============================================================ */
  /* Issues                                                       */
  /* ============================================================ */
  .issue-tabs { display: flex; gap: 4px; }
  .issue-tabs a {
    color: var(--text-muted);
    font-size: var(--t-sm);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    transition: all var(--t-fast) var(--ease);
  }
  .issue-tabs a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
  .issue-tabs a.active { color: var(--text); background: var(--bg-elevated); }

  .issue-list {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-elevated);
  }
  .issue-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast) var(--ease);
  }
  .issue-item:last-child { border-bottom: none; }
  .issue-item:hover { background: var(--bg-hover); }
  .issue-state-icon {
    font-size: 14px;
    padding-top: 2px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    flex-shrink: 0;
  }
  .state-open { color: var(--green); }
  .state-closed { color: var(--text-link); }
  .issue-title {
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.012em;
  }
  .issue-title a { color: var(--text-strong); transition: color var(--t-fast) var(--ease); }
  .issue-title a:hover { color: var(--accent); text-decoration: none; }
  .issue-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.01em;
  }

  .issue-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.4;
  }
  .badge-open { background: rgba(52,211,153,0.10); color: var(--green); border: 1px solid rgba(52,211,153,0.35); }
  .badge-closed { background: rgba(154,168,239,0.10); color: var(--text-link); border: 1px solid rgba(154,168,239,0.35); }
  .badge-merged { background: color-mix(in srgb, var(--text-strong) 5%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--text-strong) 21%, transparent); }
  .badge-live { background: #0891b2; color: #fff; border: 1px solid #0891b2; }
  .badge-soon { background: transparent; color: #6b7280; border: 1px solid #d1d5db; }
  .badge-preview { background: transparent; color: #0891b2; border: 1px dashed rgba(8,145,178,0.45); }
  .state-merged { color: var(--accent); }
  .ai-review { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }

  /* Centered readable container — without the auto margins the whole
     detail page hugged the left half of wide viewports (audit #211). */
  .issue-detail { max-width: 1080px; margin: 0 auto; }
  .issue-comment-box {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--bg-elevated);
  }
  .comment-header {
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: var(--t-sm);
    color: var(--text-muted);
  }

  /* ============================================================ */
  /* Panel — flexible container used across many pages            */
  /* ============================================================ */
  .panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast) var(--ease);
  }
  .panel-item:last-child { border-bottom: none; }
  .panel-item:hover { background: var(--bg-hover); }

  /* ─── j/k keyboard list navigation ─── */
  .is-kbd-focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent) !important;
    outline-offset: -2px;
    background: color-mix(in srgb, var(--text-strong) 3%, transparent) !important;
    border-radius: 4px;
  }
  .is-kbd-selected {
    outline: 2px solid rgba(52,211,153,0.6) !important;
    background: rgba(52,211,153,0.06) !important;
  }
  .panel-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--t-sm);
  }

  /* ============================================================ */
  /* Search                                                       */
  /* ============================================================ */
  .search-results .diff-file { margin-bottom: 12px; }

  /* ============================================================ */
  /* Timeline                                                     */
  /* ============================================================ */
  .timeline { position: relative; padding-left: 28px; }
  .timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--border) 0%, transparent 100%);
  }
  .timeline-item { position: relative; padding-bottom: 16px; }
  .timeline-dot {
    position: absolute;
    left: -28px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: var(--r-full);
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--border-strong);
  }
  .timeline-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
  }

  /* ============================================================ */
  /* Toggle switch                                                */
  /* ============================================================ */
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    margin-left: 16px;
  }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: all var(--dur-base) var(--ease);
  }
  .toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: var(--r-full);
    transition: all var(--dur-base) var(--ease);
  }
  .toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: transparent;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  }
  .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
  }

  /* ============================================================
   * 2026 polish layer (purely additive — no layout changes).
   * Improves typography rendering, focus states, hover affordances,
   * and adds the gradient brand cue to primary buttons. Anything
   * that could alter dimensions stays in the rules above.
   * ============================================================ */
  html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  body { letter-spacing: -0.005em; font-feature-settings: 'cv11', 'ss01', 'ss03'; }
  *::selection { background: color-mix(in srgb, var(--text-strong) 14%, transparent); color: var(--text); }

  h1, h2, h3, h4 { letter-spacing: -0.018em; }
  h1 { letter-spacing: -0.025em; }

  /* Smoother colour transitions everywhere links live */
  a { transition: color 120ms cubic-bezier(0.16,1,0.3,1); }

  /* Buttons: focus rings + smoother transitions; primary gets the gradient */
  .btn {
    transition:
      background 120ms cubic-bezier(0.16,1,0.3,1),
      border-color 120ms cubic-bezier(0.16,1,0.3,1),
      transform 120ms cubic-bezier(0.16,1,0.3,1),
      box-shadow 120ms cubic-bezier(0.16,1,0.3,1);
  }
  .btn:active { transform: translateY(0.5px); }
  .btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
  }
  /* .btn-primary + .btn-primary:hover collapsed into the canonical rules
     earlier in the sheet; the dead duplicates that lived here were removed. */

  /* Inputs: cleaner focus ring + hover */
  .form-group input:hover,
  .form-group textarea:hover,
  .form-group select:hover {
    border-color: rgba(255,255,255,0.14);
  }
  .form-group input:focus,
  .form-group textarea:focus,
  .form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: var(--ring);
  }
  :root[data-theme='light'] .form-group input:hover,
  :root[data-theme='light'] .form-group textarea:hover,
  :root[data-theme='light'] .form-group select:hover {
    border-color: rgba(0,0,0,0.18);
  }

  /* Cards: subtle hover lift. The unscoped .card + .card:hover that
     lived here were collapsed into the canonical .card rules earlier in
     the sheet; only the light-theme hover override remains. */
  :root[data-theme='light'] .card:hover {
    border-color: rgba(0,0,0,0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }

  /* Issue / commit / panel rows: smoother hover */
  .issue-item, .commit-item {
    transition: background 120ms cubic-bezier(0.16,1,0.3,1);
  }
  .repo-nav a {
    transition: color 120ms cubic-bezier(0.16,1,0.3,1),
                border-bottom-color 120ms cubic-bezier(0.16,1,0.3,1);
  }
  .nav-link {
    transition: color 120ms cubic-bezier(0.16,1,0.3,1);
  }

  /* Auth card: the unscoped .auth-container (and its redundant h2
     letter-spacing, byte-identical to the canonical h2 rule) were
     collapsed into the canonical rules earlier; only the light-theme
     shadow override remains. */
  :root[data-theme='light'] .auth-container {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 0 0 1px var(--border);
  }

  /* Empty state: dashed border + var(--bg) background collapsed into the
     canonical .empty-state rule earlier; the dead duplicate was removed. */

  /* Badges + commit-sha: smoother transition */
  .commit-sha, .badge { transition: all 120ms cubic-bezier(0.16,1,0.3,1); }

  /* Gradient text utility — kept for back-compat, renders as plain accent color. */
  .gradient-text {
    color: var(--accent);
  }

  /* Custom scrollbars (subtle, themed) */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border: 2px solid var(--bg);
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
  :root[data-theme='light'] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); }
  :root[data-theme='light'] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

  /* Honour reduced-motion preference */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Block O3 — visual coherence additive rules. */
  .card.card-p-none { padding: 0; }
  .card.card-p-sm { padding: var(--space-3); }
  .card.card-p-md { padding: var(--space-4); }
  .card.card-p-lg { padding: var(--space-6); }
  .card.card-elevated { box-shadow: var(--elev-2); }
  .card.card-gradient {
    background: var(--bg-elevated);
  }
  .card.card-gradient::before { opacity: 1; }
  .notice {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
    line-height: var(--leading-normal);
  }
  .notice-info { border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--blue) 8%, transparent); color: var(--text); }
  .notice-success { border-color: var(--green); background: rgba(52,211,153,0.08); color: var(--text); }
  .notice-warn { border-color: var(--yellow); background: rgba(200,200,200,0.10); color: var(--yellow); }
  .notice-error { border-color: var(--red); background: rgba(155,155,155,0.10); color: var(--red); }
  .notice-accent { border-color: var(--accent); background: color-mix(in srgb, var(--text-strong) 5%, transparent); color: var(--text); }
  .email-preview {
    padding: var(--space-5);
    background: #fff;
    color: #111;
    border-radius: var(--radius-md);
  }
  .code-block {
    margin: var(--space-2) 0 0;
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    line-height: var(--leading-normal);
    overflow-x: auto;
  }
  .status-pill-operational {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: rgba(52,211,153,0.15);
    color: var(--green);
  }
  .api-tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-xs);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
  }
  .api-tag-auth { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--accent); }
  .api-tag-scope { background: rgba(52,211,153,0.15); color: var(--green); }
  .stat-number {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-strong);
    line-height: var(--leading-tight);
  }
  .stat-number-accent { color: var(--accent); }
  .stat-number-blue { color: var(--blue); }
  .stat-number-purple { color: var(--text-link); }
  footer .footer-tag-sub {
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-faint);
    line-height: var(--leading-normal);
  }
  footer .footer-version-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    cursor: help;
  }
  footer .footer-banner {
    max-width: 1240px;
    margin: var(--space-6) auto 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--font-size-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
  }
  footer .footer-banner-info { border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }
  footer .footer-banner-warn { border-color: rgba(200,200,200,0.40); color: var(--yellow); }
  footer .footer-banner-error { border-color: rgba(155,155,155,0.45); color: var(--red); }

  /* ============================================================ */
  /* Global toast notifications.                                  */
  /* Slide-in from right, auto-dismiss, ARIA-live for SR users.   */
  /* ============================================================ */
  .gx-toast {
    pointer-events: auto;
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 14px 12px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow:
      0 12px 36px -10px rgba(15,16,28,0.18),
      0 2px 6px rgba(15,16,28,0.04),
      0 0 0 1px rgba(15,16,28,0.02);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.45;
    opacity: 0;
    transform: translateX(16px);
    transition:
      opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .gx-toast--in { opacity: 1; transform: translateX(0); }
  .gx-toast--out { opacity: 0; transform: translateX(16px); }
  .gx-toast__icon {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
  }
  .gx-toast__text { flex: 1 1 auto; min-width: 0; padding-top: 2px; word-wrap: break-word; }
  .gx-toast__close {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    margin: -2px -2px 0 0;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  }
  .gx-toast__close:hover { background: var(--bg-hover); color: var(--text); }
  .gx-toast--success .gx-toast__icon { background: rgba(5,150,105,0.14); color: var(--green); }
  .gx-toast--error   .gx-toast__icon { background: rgba(114,114,114,0.14); color: var(--red); }
  .gx-toast--warn    .gx-toast__icon { background: rgba(144,144,144,0.16); color: var(--yellow); }
  .gx-toast--info    .gx-toast__icon { background: color-mix(in srgb, var(--text-strong) 6%, transparent); color: var(--accent); }
  @media (prefers-reduced-motion: reduce) {
    .gx-toast { transition: opacity 60ms linear; transform: none; }
    .gx-toast--in, .gx-toast--out { transform: none; }
  }

  /* ============================================================ */
  /* Block U4 — cross-document view transitions.                  */
  /* Chrome 126+, Edge, Safari 18.2+ get a soft 200ms fade on     */
  /* every same-origin navigation. Older browsers ignore these    */
  /* rules entirely — no JS shim, no breakage.                    */
  /* prefers-reduced-motion disables the animation honourably.    */
  /* ============================================================ */
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 200ms;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  ::view-transition-old(root) {
    animation-name: vt-fade-out;
  }
  ::view-transition-new(root) {
    animation-name: vt-fade-in;
  }
  @keyframes vt-fade-out {
    to { opacity: 0; }
  }
  @keyframes vt-fade-in {
    from { opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
      animation-duration: 0s;
    }
  }
  /* The transition system picks up its root subject from this rule. */
  body {
    view-transition-name: root;
  }
  /* Move 2: the chrome stays still while the page underneath changes.
     Named elements get their own transition group; identical old/new
     snapshots at the same place read as not moving at all, and the tab
     underline slides to its new tab instead of the whole page blinking. */
  .site-header { view-transition-name: site-header; }
  .repo-header { view-transition-name: repo-header; }
  .repo-nav { view-transition-name: repo-tabs; }


  .hljs-keyword { color: #a3a3a3; }
  .hljs-built_in { color: #bababa; }
  .hljs-type { color: #bababa; }
  .hljs-literal { color: #79c0ff; }
  .hljs-number { color: #79c0ff; }
  .hljs-string { color: #a5d6ff; }
  .hljs-regexp { color: #a5d6ff; }
  .hljs-symbol { color: #79c0ff; }
  .hljs-title { color: #7fc4b4; }
  .hljs-title.function_ { color: #7fc4b4; }
  .hljs-title.class_ { color: #bababa; }
  .hljs-params { color: #e6edf3; }
  .hljs-comment { color: #8b949e; font-style: italic; }
  .hljs-doctag { color: #8b949e; }
  .hljs-meta { color: #79c0ff; }
  .hljs-attr { color: #79c0ff; }
  .hljs-attribute { color: #79c0ff; }
  .hljs-selector-tag { color: #a3a3a3; }
  .hljs-selector-class { color: #7fc4b4; }
  .hljs-selector-id { color: #79c0ff; }
  .hljs-variable { color: #bababa; }
  .hljs-template-variable { color: #bababa; }
  .hljs-tag { color: #7ee787; }
  .hljs-name { color: #7ee787; }
  .hljs-section { color: #7fc4b4; font-weight: bold; }
  .hljs-addition { color: #aff5b4; background: rgba(63, 185, 80, 0.15); }
  .hljs-deletion { color: #e4e4e4; background: rgba(140,140,140, 0.1); }
  .hljs-property { color: #79c0ff; }
  .hljs-subst { color: #e6edf3; }
  .hljs-punctuation { color: #8b949e; }

  /* Quiet Intelligence (light) — GitHub-light-calibrated palette so code
     blocks, diffs and READMEs read crisp on the #fcfcfd editorial surface
     instead of the dark GitHub palette above. Higher specificity means
     these win on the light theme; the dark rules above are untouched. */
  :root[data-theme='light'] .hljs-keyword { color: #6b6b6b; }
  :root[data-theme='light'] .hljs-built_in { color: var(--accent); }
  :root[data-theme='light'] .hljs-type { color: #565656; }
  :root[data-theme='light'] .hljs-literal { color: #0550ae; }
  :root[data-theme='light'] .hljs-number { color: #0550ae; }
  :root[data-theme='light'] .hljs-string { color: #0a3069; }
  :root[data-theme='light'] .hljs-regexp { color: #0a3069; }
  :root[data-theme='light'] .hljs-symbol { color: #0550ae; }
  :root[data-theme='light'] .hljs-title { color: var(--accent); }
  :root[data-theme='light'] .hljs-title.function_ { color: var(--accent); }
  :root[data-theme='light'] .hljs-title.class_ { color: #565656; }
  :root[data-theme='light'] .hljs-params { color: #1f2328; }
  :root[data-theme='light'] .hljs-comment { color: #6e7781; font-style: italic; }
  :root[data-theme='light'] .hljs-doctag { color: #6e7781; }
  :root[data-theme='light'] .hljs-meta { color: #0550ae; }
  :root[data-theme='light'] .hljs-attr { color: #0550ae; }
  :root[data-theme='light'] .hljs-attribute { color: #0550ae; }
  :root[data-theme='light'] .hljs-selector-tag { color: #6b6b6b; }
  :root[data-theme='light'] .hljs-selector-class { color: var(--accent); }
  :root[data-theme='light'] .hljs-selector-id { color: #0550ae; }
  :root[data-theme='light'] .hljs-variable { color: #565656; }
  :root[data-theme='light'] .hljs-template-variable { color: #565656; }
  :root[data-theme='light'] .hljs-tag { color: #116329; }
  :root[data-theme='light'] .hljs-name { color: #116329; }
  :root[data-theme='light'] .hljs-section { color: var(--accent); font-weight: bold; }
  :root[data-theme='light'] .hljs-addition { color: #116329; background: rgba(74,194,107,0.15); }
  :root[data-theme='light'] .hljs-deletion { color: #3f3f3f; background: rgba(167,167,167,0.15); }
  :root[data-theme='light'] .hljs-property { color: #0550ae; }
  :root[data-theme='light'] .hljs-subst { color: #1f2328; }
  :root[data-theme='light'] .hljs-punctuation { color: #6e7781; }


  /* ---------- Kit v1 (src/views/kit) ----------
     The one component set. Reads ONLY the semantic tokens (--surface-*,
     --line*, --ink*, --on-ink, --ok, --focus), so white and black are the
     same DOM with different values. Class names stay clear of the legacy
     suffix selectors above (-banner, -empty, -chip, -pill, -badge, -card,
     -panel, -table, -hero, -notice, -row-meta ...) so nothing here is
     restyled twice; kit.test.ts enforces that. */
  .kit-intro { max-width: 72ch; margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
  .kit-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  p.kit-meta { margin: 0; }
  .kit-mono { font-family: var(--font-mono); font-size: 12px; }
  .kit-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; margin: 0 0 24px; }
  .kit-head-text { min-width: 0; flex: 1 1 420px; }
  .kit-head-title { margin: 0 0 6px; font-size: clamp(26px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
  .kit-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .kit-quiet { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer; }
  .kit-quiet:hover { color: var(--ink); text-decoration-color: var(--ink); }
  .kit-section { margin: 32px 0 0; }
  .kit-section-label { margin: 0 0 10px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
  .kit-verdict { margin: 0 0 16px; }
  .kit-verdict-line { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }

  .kit-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
  .kit-state[data-state="proven"] { color: var(--ok); }
  .kit-state[data-state="failing"], .kit-state[data-state="blocked"] { font-weight: 600; }
  .kit-state-detail { font-weight: 400; color: var(--ink-2); white-space: normal; }
  .kit-glyph { flex: none; }
  .kit-glyph-cut { stroke: var(--surface-0); }
  .kit-unknown { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }

  .kit-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-0); }
  .kit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; min-height: 44px; padding: 14px 20px; color: var(--ink); transition: background-color 120ms ease; }
  .kit-row + .kit-row { border-top: 1px solid var(--line); }
  .kit-row:hover { background: var(--surface-1); }
  .kit-row:hover .kit-glyph-cut { stroke: var(--surface-1); }
  .kit-row.is-dim .kit-row-main, .kit-row.is-dim .kit-row-detail { opacity: 0.72; }
  .kit-row-main { min-width: 0; }
  .kit-row-title { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
  .kit-row-name { font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; overflow-wrap: anywhere; }
  .kit-row-id, .kit-rowmeta { margin: 2px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
  .kit-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  .kit-row-actions form { margin: 0; }
  .kit-row-detail { grid-column: 1 / -1; }
  .kit-tag { display: inline-flex; align-items: center; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
  .kit-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 6px 0 0; }
  .kit-facts .is-wide { grid-column: 1 / -1; }
  .kit-facts dt { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
  .kit-facts dd { margin: 2px 0 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
  .kit-facts ul { margin: 0; padding: 0; list-style: none; }

  .kit-emptystate { padding: 24px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-0); color: var(--ink); }
  .kit-emptystate-title { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 600; color: var(--ink); }
  .kit-emptystate-body { max-width: 72ch; margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
  .kit-emptystate-body p { margin: 0 0 8px; }
  .kit-emptystate-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
  .kit-result, .kit-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1); font-size: 14px; line-height: 1.55; color: var(--ink); }
  .kit-result .kit-glyph, .kit-note .kit-glyph { margin-top: 3px; }
  .kit-result .kit-glyph-cut, .kit-note .kit-glyph-cut { stroke: var(--surface-1); }
  .kit-result-word { font-weight: 600; }
  .kit-result[data-outcome="done"] .kit-glyph, .kit-result[data-outcome="done"] .kit-result-word { color: var(--ok); }
  .kit-note-word { font-weight: 600; }

  .kit-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-0); }
  .kit-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; color: var(--ink); text-decoration: none; }
  .kit-tile + .kit-tile { border-left: 1px solid var(--line); }
  .kit-tile:hover { background: var(--surface-1); }
  .kit-tile-label, .kit-tile-window { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
  .kit-tile-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .kit-tile-value .kit-unknown { font-size: 14px; font-weight: 500; }
  .kit-tile-def { font-size: 12px; color: var(--ink-2); }
  .kit-receipt { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-decoration: none; }
  a.kit-receipt:hover { color: var(--ink); text-decoration: underline; }

  .kit-danger { margin: 40px 0 0; padding: 16px 0 0; border-top: 2px solid var(--line-strong); }
  .kit-danger-label { margin: 0 0 12px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
  .kit-danger-form { margin: 0; display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
  .btn.kit-destroy { font-weight: 600; }
  .kit-typed { display: inline-flex; flex-direction: column; gap: 4px; }

  .kit-setting { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
  .kit-setting p { margin: 0; }
  .kit-setting-label { font-weight: 600; color: var(--ink); }
  .kit-setting-effect { font-size: 13px; color: var(--ink-2); }
  .kit-setting-effective { font-size: 13px; color: var(--ink); }
  .kit-secret { padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-1); color: var(--ink); }
  .kit-secret-label { margin: 0 0 8px; font-weight: 600; }
  .kit-secret-field { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
  .kit-secret-value { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-0); font-family: var(--font-mono); font-size: 13px; overflow-x: auto; white-space: nowrap; user-select: all; }

  .kit-journey-context { margin: 0 0 10px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
  .kit-journey-steps { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .kit-step { padding: 14px 20px; }
  .kit-step + .kit-step { border-top: 1px solid var(--line); }
  .kit-step.is-next { background: var(--surface-1); }
  .kit-step.is-next .kit-step-title { font-weight: 600; }
  .kit-step-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
  .kit-step-title { color: var(--ink); }
  .kit-step-body { margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 14px; }
  .kit-step-receipt { margin: 4px 0 0; }

  .kit-provenance { margin: 40px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }

  [class^="kit-"] :focus-visible, [class^="kit-"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  @media (max-width: 860px) {
    .kit-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
    .kit-row-actions { justify-content: flex-start; }
    .kit-setting { grid-template-columns: minmax(0, 1fr); }
    .kit-tile + .kit-tile { border-left: 0; border-top: 1px solid var(--line); }
  }

