/* amadan — Ink & Verdigris.
   Direction contract (docs/superpowers/specs/2026-08-08-amadan-web-ux-design.md;
   lives here because html/template strips HTML comments, and this file
   ships verbatim in the binary at /static/css/amadan.css):

   THESIS: GitHub's grammar with amadan's heart. The one rule — "if the
   server is compromised, the attacker gets nothing" — is the hero,
   verbatim. Refused: the anonymous GitHub clone; dark-hacker neon.
   OWN-WORLD: Irish scriptorium rendered modern. Iron-gall ink neutrals
   (warm green cast, never GitHub blue-gray), verdigris accent, red-lead
   danger, gilt amber private tier. System-stack type throughout (speed
   embodied; Paul cut the display webfont 2026-08-08 — "horrible"),
   Commit Mono for code. Filled verdigris sealed chip for E2EE; outline
   chips for public/private. Wide field: 1400px cap, 60rem reading
   pages (Paul: wider, 2026-08-08).
   STORY: a developer recognizes GitHub instantly, reads plainly what
   amadan can and cannot see, and feels pages land instantly.
   FIRST VIEWPORT: signed-out home = the one rule set huge, one line of
   what amadan is, sign-in CTA, three-tier honesty ledger as the demo.
   FORM: brief-pinned direction (GitHub-familiar + amadan twist); no
   seed roll — user-pinned beats the roll.
   FINISH: unreviewed and undocumented is unfinished; this build ends
   with the finish review, the verdict, and DESIGN.md.

   No external requests: fonts below are embedded in the binary and
   served same-origin under CSP default-src 'self'.
   🤖 rewritten in the web-UX pass, 2026-08-08 (previous look: Task 5,
   2026-08-03). */

/* ---------- embedded faces ---------- */

@font-face {
  font-family: "Commit Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  /* Relative (not /static/-absolute) so the font rides the same
     fingerprinted prefix this stylesheet was fetched under. */
  src: url("../fonts/commit-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Commit Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/commit-mono-latin-700-normal.woff2") format("woff2");
}

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

:root {
  --on-accent: #ffffff;
  --on-danger: #ffffff;
  --bg: #ffffff;
  --bg-inset: #f4f7f5;
  --border: #d5ddd9;
  --fg: #181d1b;
  --fg-muted: #5c6660;
  --link: #0b6e63;
  --accent: #0b6e63;
  --accent-emph: #095a51;
  --accent-wash: #e7f2ef;
  --badge-public: #1a7f37;
  --badge-public-bg: #eaf5ec;
  --badge-private: #9a6700;
  --badge-private-bg: #fbf3e0;
  --sealed-bg: #0b6e63;
  --sealed-fg: #ffffff;
  --danger: #b03a25;
  --danger-bg: #fbeeea;
  --code-bg: #f4f7f5;
  --radius: 8px;
  --radius-ctl: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  /* Display = the same system stack, heavier — Paul cut the embedded
     display face (2026-08-08); personality lives in weight, color, and
     the chip system now. The token stays so a future face is a
     one-line change. */
  --display: var(--font);
  --mono: "Commit Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Ink night: developers at a terminal after dark — dark mode is a
   first-class scene, not an inversion. */
@media (prefers-color-scheme: dark) {
  :root {
    /* Bright verdigris carries the accent at night, so anything painted
       with it flips to ink-dark text — white-on-bright-teal fails
       contrast. */
    --on-accent: #0d1412;
    --on-danger: #1a0c08;
    --bg: #101413;
    --bg-inset: #171d1a;
    --border: #2b342f;
    --fg: #e7edea;
    --fg-muted: #93a09a;
    --link: #4cc4b5;
    --accent: #4cc4b5;
    --accent-emph: #6fd6c9;
    --accent-wash: #14251f;
    --badge-public: #4ac26b;
    --badge-public-bg: #12271a;
    --badge-private: #d4a72c;
    --badge-private-bg: #2b2312;
    --sealed-bg: #0b6e63;
    --sealed-fg: #ffffff;
    --danger: #f0704f;
    --danger-bg: #321812;
    --code-bg: #171d1a;
  }
}

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

* { box-sizing: border-box; }

html {
  color-scheme: light dark;
  /* Kill WebKit's mobile text autosizing: it inflated the code table's
     long non-wrapping lines to roughly double size on phones, while
     wrapped text (commit messages) was spared — the sized-in-CSS type
     scale is the intended one on every device. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Reserve the scrollbar's width even on pages too short to scroll, so
     the centered layout doesn't jump sideways when navigating between
     scrolling and non-scrolling pages. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  caret-color: var(--accent);
  scrollbar-color: var(--border) transparent;
}

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

a, button, input, select, textarea, summary {
  transition: color 120ms ease-out, background-color 120ms ease-out,
    border-color 120ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* .loading appears via a delayed animation (see .loading below), and
     a delayed appearance isn't motion: without this carve-out,
     animation:none would leave the loader visibility:hidden forever.
     Only the pulse is dropped. */
  .loading { animation: loading-appear 0s 0.5s forwards !important; }
}

code, pre, kbd, .mono { font-family: var(--mono); }

/* ---------- icons ----------
   Lucide geometry via an in-page sprite (templates/icons.html);
   every icon is an inline <svg class="icon"><use> pair, so this one
   rule is the single stroke-and-weight voice for all of them. */

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }

main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}
main.narrow { max-width: 60rem; }

/* ---------- site chrome ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.site-header .brand-mark { width: 24px; height: 24px; }
.site-header .brand:hover { color: var(--accent); text-decoration: none; }
.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { color: var(--fg-muted); font-size: 0.9rem; }
.site-header nav a:hover { color: var(--fg); text-decoration: none; }

/* Header menus (the "+" and profile dropdowns): plain <details> — no
   JS, native keyboard/touch, CSP-safe. Flat panels, per the system. */
.header-menus { display: flex; gap: 0.6rem; align-items: center; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1;
}
.menu-btn:hover, details.menu[open] > .menu-btn { border-color: var(--accent); color: var(--accent); }
/* The "+" is drawn, not a glyph (DESIGN.md's Drawn Mark Rule). */
.plus-mark { position: relative; display: inline-block; width: 0.75rem; height: 0.75rem; }
.plus-mark::before, .plus-mark::after { content: ""; position: absolute; background: currentColor; }
.plus-mark::before { left: 0; right: 0; top: calc(50% - 0.75px); height: 1.5px; }
.plus-mark::after { top: 0; bottom: 0; left: calc(50% - 0.75px); width: 1.5px; }
/* Outline at rest: filled verdigris at rest belongs to exactly one
   chip in this system — the sealed E2EE badge. */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.menu-btn:hover .avatar, details.menu[open] .avatar { border-color: var(--accent); color: var(--accent); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 13rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  z-index: 20;
}
.menu-panel a { display: block; padding: 0.45rem 0.6rem; border-radius: var(--radius-ctl); color: var(--fg); font-size: 0.9rem; }
.menu-panel a:hover { background: var(--bg-inset); text-decoration: none; }
.menu-note {
  margin: 0.15rem 0.6rem 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.8rem;
  word-break: break-all;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
}
.site-footer .receipt {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.site-footer .fool-line {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--fg-muted);
}

/* ---------- controls ---------- */

button, .btn {
  display: inline-block;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--fg);
  border-radius: var(--radius-ctl);
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-primary,
form button[type="submit"].primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-emph); border-color: var(--accent-emph); color: var(--on-accent); }

/* Revoke (and any destructive form action): quiet until intent. */
form[action$="/revoke"] button {
  color: var(--danger);
  border-color: var(--border);
  background: transparent;
}
form[action$="/revoke"] button:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

form input[type="text"], form input[type="url"], form select, form textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  padding: 0.35rem 0.6rem;
}
form input[type="text"]:hover, form input[type="url"]:hover, form select:hover, form textarea:hover { border-color: var(--fg-muted); }
form input[type="text"]:focus-visible, form input[type="url"]:focus-visible, form select:focus-visible, form textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}
form label { font-size: 0.9rem; }
::placeholder { color: var(--fg-muted); opacity: 1; }

/* ---------- tier chips (badge.html — markup pinned by tests) ---------- */

.badge {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  vertical-align: 0.15em;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge-public { color: var(--badge-public); background: var(--badge-public-bg); }
.badge-private { color: var(--badge-private); background: var(--badge-private-bg); }

/* The sealed chip: the one filled chip in the system — amadan's whole
   point, worn proudly. The seal mark is drawn (a rotated square), not
   a unicode glyph, and inherits the chip's own foreground. */
.badge-private-e2ee {
  color: var(--sealed-fg);
  background: var(--sealed-bg);
  border-color: var(--sealed-bg);
  font-weight: 600;
}
.badge-private-e2ee::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.45em;
  background: currentColor;
  transform: rotate(45deg);
  vertical-align: 0.08em;
}
/* Unknown/corrupt tier: deliberately alarming — filled red, never calm,
   and never mistakable for the sealed chip (final-review FIX 1). */
.badge-unknown {
  color: var(--on-danger);
  background: var(--danger);
  border-color: var(--danger);
  font-weight: 600;
}

/* Honesty subtext (design spec §2): always visible text, never only a
   tooltip. */
.tier-note { color: var(--fg-muted); font-size: 0.85rem; margin: 0.25rem 0 0.75rem; }

/* ---------- tier chooser (create-repo radios) ---------- */

.tier-chooser {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  margin: 0.75rem 0;
  max-width: 60rem;
}
.tier-chooser legend { padding: 0 0.4rem; color: var(--fg-muted); font-size: 0.85rem; }
.tier-chooser label {
  display: block;
  margin: 0.25rem 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-ctl);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}
.tier-chooser label:hover { background: var(--bg-inset); }
.tier-chooser label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.tier-chooser input { margin-right: 0.5rem; accent-color: var(--accent); }

/* ---------- landing (signed-out home) ---------- */

.hero { padding: 3.5rem 0 1rem; max-width: 62rem; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .hero-sub {
  font-size: 1.2rem;
  color: var(--fg-muted);
  max-width: 40rem;
  margin: 0 0 1.75rem;
}
.hero .btn-primary { font-size: 1rem; padding: 0.55rem 1.3rem; }

.tiers { margin-top: 3rem; max-width: 62rem; }
.tier-ledger { list-style: none; margin: 0; padding: 0; }
.tier-ledger li {
  display: grid;
  grid-template-columns: 14rem 1fr 15rem;
  gap: 1rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}
.tier-ledger li:last-child { border-bottom: 1px solid var(--border); }
.tier-ledger .badge { margin-left: 0; }
.tier-ledger .how {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: right;
}
@media (max-width: 720px) {
  .tier-ledger li { grid-template-columns: 1fr; gap: 0.25rem; }
  .tier-ledger .how { text-align: left; }
}

.tiers .tier-group {
  margin: 1.75rem 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-muted);
}

/* ---------- signed-in home / namespace ---------- */

.account-line { color: var(--fg-muted); font-size: 0.9rem; margin: 0 0 1.5rem; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.kind-chip {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 400;
  vertical-align: 0.2em;
}

ul.item-list { list-style: none; margin: 0; padding: 0; }
ul.item-list li {
  padding: 0.7rem 0.25rem;
  border-top: 1px solid var(--border);
}
ul.item-list li:last-child { border-bottom: 1px solid var(--border); }
ul.item-list li > a { font-weight: 600; }
ul.item-list li.empty { color: var(--fg-muted); font-size: 0.9rem; }

.create-form { margin-top: 1rem; }
.create-form .row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ---------- repo page ---------- */

.repo-header h1 { font-weight: 400; font-size: 1.5rem; }
.repo-header h1 a { color: var(--fg); }
.repo-header h1 a:hover { color: var(--accent); }
.repo-header h1 strong { font-weight: 700; }

/* Repo tab bar: Code | Branches | Discussions | Prompts | Settings.
   Underline tabs, verdigris active — GitHub's grammar in amadan's
   ink. Five tabs no longer fit a phone, so the bar scrolls sideways
   instead of clipping (scrollbar hidden — the cut-off next label is
   the affordance, same as GitHub's own mobile tab strip). */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 1rem 0 0;
}
/* Each tab is a Lucide icon + label pair (same recipe as .subtabs a);
   inline-flex keeps the two on one centered line. */
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.active { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }

/* Code toolbar: branch picker, Files|Commits sub-tabs, then a
   right-aligned group (Go to file, Clone). Every control in the row
   shares the .btn box (same font-size and vertical padding), so the
   row reads as one height. */
.code-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1rem 0; }
/* Toolbar controls carry a Lucide icon before their label. */
.code-toolbar .btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.toolbar-slot { display: flex; align-items: center; gap: 0.75rem; }
.toolbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.subtabs { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-ctl); overflow: hidden; }
.subtabs a { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.8rem; font-size: 0.9rem; color: var(--fg-muted); }
.subtabs a + a { border-left: 1px solid var(--border); }
.subtabs a:hover { color: var(--fg); background: var(--bg-inset); text-decoration: none; }
.subtabs a.active { background: var(--accent-wash); color: var(--accent-emph); font-weight: 600; }

/* The visible "Go to file" affordance for the `t` switcher, with a
   quiet keycap hint. Templates render it hidden; switcher.js unhides
   it once a file source is attached. */
.goto-file { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--fg-muted); }
.goto-file kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg-muted);
}

/* Clone popover: a <details> so the command is one click away with no
   JS; the panel is flat like the menus. */
details.clone-pop { position: relative; }
details.clone-pop > summary { list-style: none; cursor: pointer; }
details.clone-pop > summary::-webkit-details-marker { display: none; }
.pop-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(34rem, 88vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  z-index: 20;
}
.pop-panel pre { margin: 0 0 0.25rem; background: var(--bg-inset); border-radius: var(--radius-ctl); padding: 0.6rem 0.75rem; overflow-x: auto; }
.pop-panel code { font-size: 0.85rem; white-space: nowrap; }
.pop-panel .tier-note { margin-bottom: 0; }

/* Branch picker (branchpicker.js): a .btn trigger — so it sits at the
   same height as everything else in the toolbar row — opening an
   anchored typeahead menu, filter input on top, fuzzy-matched list
   below (the switcher's grammar, anchored instead of modal). The
   plaintext page server-renders this markup so it paints in final
   geometry; the <noscript> fallback form keeps the plain select +
   Go button. */
.branch-picker { position: relative; display: inline-block; font-size: 0.9rem; }
.branch-picker select { font: inherit; font-size: 0.9rem; margin: 0 0.4rem; padding: 0.25rem 0.3rem; }
/* JS off: the server-rendered trigger has no behavior to wire — hide
   it and let the <noscript> form own the slot. (Pre-2023 browsers
   without the `scripting` media feature show both; the form still
   works.) */
@media (scripting: none) {
  .branch-picker > .branch-trigger { display: none; }
}
.branch-trigger { display: inline-flex; align-items: center; gap: 0.4rem; max-width: min(20rem, 60vw); }
.branch-trigger .branch-word { color: var(--fg-muted); font-weight: 400; }
.branch-trigger .branch-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-trigger .caret { color: var(--fg-muted); font-size: 0.65em; }
.branch-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  width: min(22rem, 88vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 30;
}
.branch-filter {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}
.branch-options {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 40vh;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.branch-option {
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.branch-option.active { background: var(--bg-inset); box-shadow: inset 2px 0 0 var(--accent); }
.branch-option.current { font-weight: 700; }
.branch-option b { color: var(--accent); }
.branch-empty { padding: 0.5rem 0.75rem; color: var(--fg-muted); }

/* Phones: the toolbar holds one unwrapped row — the "branch" word and
   the button labels drop away (aria-labels keep the names for
   assistive tech), leaving the Lucide icons; the branch name truncates
   instead of wrapping the row (Paul, 2026-08-09). */
@media (max-width: 720px) {
  .code-toolbar { flex-wrap: nowrap; gap: 0.5rem; }
  .toolbar-slot, .toolbar-right { gap: 0.5rem; }
  .code-toolbar .branch-picker { min-width: 0; }
  .code-toolbar .branch-picker select { max-width: 35vw; }
  .branch-trigger .branch-word { display: none; }
  /* iOS Safari zooms the page when a focused text control is under
     16px; the picker focuses its filter input on open, so both it and
     the <noscript> select must hold the 16px line on phones. */
  .branch-filter, .branch-picker select { font-size: 1rem; }
  .subtab-label, .code-toolbar .btn-label, .goto-file kbd { display: none; }
  .subtabs a { padding: 0.35rem 0.6rem; }
  .goto-file, details.clone-pop > summary.btn { padding: 0.35rem 0.55rem; }
  /* With labels gone these boxes would collapse to the 1em icon;
     hold them at a text control's height (1.5 line box + 0.35rem
     vertical padding + 1px borders) so the row stays one height. */
  .subtabs a, .goto-file, details.clone-pop > summary.btn { min-height: calc(1.5em + 0.7rem + 2px); }
  /* Five tabs no longer fit a phone: the bar scrolls sideways instead
     of clipping (scrollbar hidden — the cut-off next label is the
     affordance, GitHub's own mobile tab grammar). Scoped to phones so
     desktop keeps the active tab's underline overlapping the bar's
     hairline cleanly (an always-on clip container would shave it). */
  /* overflow-y must be pinned: `auto` on one axis forces the other
     from `visible` to `auto`, and any y-overflow then makes the bar
     itself vertically scrollable (a joggling tab strip on touch). */
  .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  /* The -1px underline overlap is exactly that y-overflow — and the
     clip container shaves the overlapped pixel anyway, so it buys
     nothing on phones. Dropped: the bar has zero scrollable height. */
  .tabs a { white-space: nowrap; margin-bottom: 0; }
  /* The two segmented controls compress identically (subtabs above). */
  .discussion-filter a, .discussion-filter button { padding: 0.35rem 0.6rem; }
}

.repo-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
/* No file selected: collapse the empty content column instead of
   leaving a field of dead paper beside the tree. */
.repo-main.no-file { grid-template-columns: minmax(0, 280px); }
@media (max-width: 800px) {
  .repo-main { grid-template-columns: 1fr; }
}

.tree-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  background: var(--bg-inset);
  font-size: 0.9rem;
}
ul.tree, ul.tree ul { list-style: none; margin: 0; padding-left: 1rem; }
ul.tree { padding-left: 0; }
ul.tree li { padding: 0.1rem 0; }
ul.tree .icon { margin-right: 0.35rem; color: var(--fg-muted); }

/* Disclosed agent badge (agent-accounts, 2026-08-13): short name +
   bot icon, operator in the title attribute. */
.actor-agent { white-space: nowrap; }
.actor-agent .icon-bot { margin-left: 0.25rem; color: var(--fg-muted); }
ul.tree .tree-dir > details > summary > .icon { color: var(--accent); }
.tree-file a { color: var(--fg); }
.tree-file a:hover { color: var(--accent); text-decoration: none; }
.tree-dir > a { font-weight: 600; color: var(--fg); }
.tree-dir > a:hover { color: var(--accent); text-decoration: none; }
.tree-dir summary { cursor: pointer; font-weight: 600; }

.content-col { min-width: 0; }

.readme-below { margin-top: 1.5rem; }
/* A code page is a code page: once a file is open (E2EE client drops
   .no-file), the README below it goes away. The plaintext page makes
   the same call server-side (browse_render.go). */
.repo-main:not(.no-file) + .readme-below { display: none; }

.readme, .file-viewer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.file-viewer h3 { font-family: var(--mono); font-size: 0.9rem; margin-top: 0; }

.amadan-markdown { max-width: 72ch; }
/* The README is the page, not a comment in a thread: it fills its card
   the way GitHub's does, instead of wrapping at 72ch and leaving half
   the box empty (Paul, 2026-08-09). Discussion posts and branch
   descriptions keep the measure. */
.readme .amadan-markdown { max-width: none; }
.amadan-markdown pre { background: var(--code-bg); padding: 0.75rem; border-radius: var(--radius-ctl); overflow-x: auto; }
.amadan-markdown code { background: var(--code-bg); padding: 0.1rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.amadan-markdown pre code { background: none; padding: 0; }

table.file-lines {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.45;
  tab-size: 4;
}
table.file-lines td.ln {
  color: var(--fg-muted);
  text-align: right;
  padding-right: 0.75rem;
  user-select: none;
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
table.file-lines td.code { white-space: pre; }
table.file-lines tr:hover td { background: var(--bg-inset); }
/* Phones: code still scrolls sideways rather than wrapping, but a
   notch smaller so a useful stretch of each line fits in view
   (Paul, 2026-08-09: 13px reads too big to parse on mobile). */
@media (max-width: 720px) {
  table.file-lines { font-size: 0.75rem; }
  table.file-lines td.ln { padding-right: 0.5rem; }
}

/* Syntax highlighting (site/js/syntax.js token kinds) — tinted to the
   Ink & Verdigris palette: strings take the verdigris accent family,
   keywords the red-lead danger family, comments/numbers stay muted
   ink so color marks meaning, not noise. */
:root {
  --hl-com: #5c6660;
  --hl-str: #0b6e63;
  --hl-kw: #b03a25;
  --hl-num: #9a6700;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hl-com: #93a09a;
    --hl-str: #4cc4b5;
    --hl-kw: #f0704f;
    --hl-num: #d4a72c;
  }
}
.hl-com { color: var(--hl-com); font-style: italic; }
.hl-str { color: var(--hl-str); }
.hl-kw { color: var(--hl-kw); }
.hl-num { color: var(--hl-num); }
.too-large { color: var(--fg-muted); font-style: italic; }

/* Full-width file list (plaintext server-rendered browse) — the
   GitHub-shaped name / last-commit-message / last-changed table. The
   E2EE page keeps the .repo-main two-column grid above. */
.repo-files { margin-top: 0.5rem; }

/* ---------- About sidebar (repo front page) ---------- */

/* Two columns on the root Files view: files + README in the main
   column, About on the right. Single column on phones with the
   sidebar FIRST (order: -1) — GitHub's own mobile order. */
.repo-columns { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 2.5rem; align-items: start; }
@media (max-width: 900px) {
  .repo-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .about-sidebar { order: -1; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 0.5rem; }
}
.about-sidebar h2 { font-size: 1rem; font-weight: 700; margin: 0.6rem 0 0.75rem; }
.about-sidebar h3 { font-size: 0.9rem; font-weight: 700; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.45rem; }
.about-desc { margin: 0 0 0.75rem; font-size: 0.95rem; overflow-wrap: anywhere; }
.about-empty { color: var(--fg-muted); font-size: 0.9rem; font-style: italic; margin: 0 0 0.75rem; }
.about-row { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.6rem; font-size: 0.9rem; }
.about-row .icon { color: var(--fg-muted); flex: none; }
.about-homepage { font-weight: 600; overflow-wrap: anywhere; }
.about-sidebar section { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.about-count { color: var(--fg-muted); font-weight: 400; }
.about-contributors ul { list-style: none; padding: 0; margin: 0; }
.about-contributors li { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.9rem; padding: 0.15rem 0; }
.about-contributors .c-count { color: var(--fg-muted); flex: none; }
/* The language bar is an SVG (segment widths/fills are SVG attributes,
   not styles — the CSP has no style-src carve-out for inline styles). */
.lang-bar svg { display: block; width: 100%; height: 8px; border-radius: 4px; margin-bottom: 0.6rem; }
.lang-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.lang-list li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.lang-list .lang-dot { flex: none; }
.lang-list .lang-pct { color: var(--fg-muted); }

/* The Settings tab's About form (description + homepage). */
.about-form { margin: 1.5rem 0; }
.about-form label { display: block; margin: 0.6rem 0; max-width: 30rem; }
.about-form input[type="text"], .about-form input[type="url"] { width: 100%; margin-top: 0.25rem; display: block; }
.about-form .btn { margin-top: 0.5rem; }

/* LLM disclosure (LLM-disclosure change, 2026-08-09): the self-declared
   badge chip, its "self-declared" tag, the async measured-share line,
   and the bot mark on LLM contributor rows. Chip colors reuse the tier
   badge palette — verdigris for all, gilt amber for partial, public
   green for none. */
.llm-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.llm-chip.llm-all { color: var(--accent); background: var(--accent-wash); border-color: var(--accent); }
.llm-chip.llm-partial { color: var(--badge-private); background: var(--badge-private-bg); border-color: var(--badge-private); }
.llm-chip.llm-none { color: var(--badge-public); background: var(--badge-public-bg); border-color: var(--badge-public); }
.llm-declared { color: var(--fg-muted); font-size: 0.8rem; }
.llm-share { color: var(--fg-muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.commits-filter { color: var(--fg-muted); font-size: 0.9rem; margin: 0.5rem 0 1rem; }
.about-contributors .c-name { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.about-contributors .c-name .icon { color: var(--fg-muted); }

/* The Settings About form's LLM radio group. */
.llm-fieldset { border: 1px solid var(--border); border-radius: var(--radius-ctl); margin: 0.75rem 0; padding: 0.5rem 0.75rem 0.75rem; max-width: 30rem; }
.llm-fieldset legend { font-size: 0.9rem; font-weight: 600; padding: 0 0.25rem; }
.llm-fieldset label { display: block; margin: 0.4rem 0; }
.llm-fieldset input[type="radio"] { margin-right: 0.45rem; }
.llm-fieldset .tier-note { margin-top: 0; }
table.file-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  overflow: hidden;
  font-size: 0.875rem; /* 14px — GitHub's file-list size; inheriting the 16px body reads oversized */
}
table.file-table td { padding: 0.45rem 0.75rem; }
table.file-table tr.file-row + tr.file-row td { border-top: 1px solid var(--border); }
table.file-table td.name { white-space: nowrap; width: 1%; min-width: 12rem; }
table.file-table td.name a { text-decoration: none; color: var(--fg); }
table.file-table td.name a:hover { color: var(--link); }
table.file-table td.name.tree-dir a { font-weight: 500; }
table.file-table td.name .icon { margin-right: 0.45rem; color: var(--fg-muted); }
table.file-table td.name.tree-dir .icon { color: var(--accent); }
table.file-table td.last-msg {
  color: var(--fg-muted);
  max-width: 0; /* lets the ellipsis actually engage inside a full-width table */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.file-table td.last-msg a { color: var(--fg-muted); text-decoration: none; }
table.file-table td.last-msg a:hover { color: var(--link); }
table.file-table td.last-time {
  white-space: nowrap;
  text-align: right;
  color: var(--fg-muted);
  font-size: 0.8rem;
  width: 1%;
}
/* Phones: the last-commit message column had ellipsized down to a
   letter or two — no point even trying (Paul, 2026-08-09); drop it
   and let the filename take the width (truncating if it must) with
   the date holding the right edge. */
@media (max-width: 720px) {
  table.file-table td.last-msg { display: none; }
  table.file-table td.name {
    width: auto;
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* Directory breadcrumb (replaces the old "... (up)" row / back link):
   repo root, then each ancestor a link, current segment plain. */
.breadcrumb {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  word-break: break-all;
}
.breadcrumb .crumb { text-decoration: none; }
.breadcrumb .crumb:hover { text-decoration: underline; }
.breadcrumb .crumb-sep { color: var(--fg-muted); margin: 0 0.25rem; }
.breadcrumb .crumb-here { font-weight: 600; color: var(--fg); }

/* The `t` fuzzy file switcher (switcher.js). */
.switcher-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 100;
}
.switcher {
  width: min(40rem, 92vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.switcher-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  outline: none;
}
.switcher-results {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 50vh;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.switcher-result {
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switcher-result.active { background: var(--bg-inset); box-shadow: inset 2px 0 0 var(--accent); }
.switcher-result b { color: var(--accent); font-weight: 700; }
.switcher-empty { padding: 0.6rem 0.9rem; color: var(--fg-muted); }

/* Commit page: header, diffstat, per-file colored diff. */
.commit-header { margin: 1rem 0; }
.commit-subject { margin: 0 0 0.25rem; }
.commit-body {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
}
.commit-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; color: var(--fg-muted); font-size: 0.9rem; }
.commit-meta .sha { background: var(--code-bg); padding: 0 0.3rem; border-radius: 4px; word-break: break-all; }
.parent-link { text-decoration: none; }

.diffstat { margin: 1rem 0; }
.diffstat-summary { font-weight: 500; }
.additions { color: var(--badge-public); }
.deletions { color: var(--danger); }
ul.diffstat-files { list-style: none; padding: 0; margin: 0.5rem 0 0; }
ul.diffstat-files li { padding: 0.15rem 0; font-size: 0.9rem; }

.diff-file {
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  margin-bottom: 1rem;
  overflow: hidden;
}
.diff-file-header {
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: nowrap;
}
table.diff-lines { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
table.diff-lines td.code {
  font-family: var(--mono);
  white-space: pre-wrap;
  word-break: break-all;
  padding: 0 0.75rem;
}
tr.diff-add td.code { background: rgba(46, 160, 67, 0.15); }
tr.diff-del td.code { background: rgba(248, 81, 73, 0.15); }
tr.diff-hunk td.code { background: var(--bg-inset); color: var(--fg-muted); }
tr.diff-meta td.code { color: var(--fg-muted); }

/* Two-phase commit diff (diffload.js): pending/error placeholders and
   the click-to-load button for huge files. */
.diff-pending .diff-placeholder, .diff-file .diff-error { margin: 0; padding: 0.5rem 0.75rem; }
.diff-load-btn { margin: 0.5rem 0.75rem; }

.commits-section { margin-top: 1.5rem; }
ul.commits { list-style: none; padding: 0; margin: 0; }
ul.commits li.commit {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.9rem;
}
ul.commits li.commit:last-child { border-bottom: 1px solid var(--border); }

/* CI status dot (Task 11): a small colored circle per commit row, one
   per state — reused as-is on the commit page's own CI summary line.
   Colour is never the only signal: the commits-list dot always carries
   a `title` and the commit-page summary always sits beside its label
   text in words, so screen readers and colour-blind users get the
   same information sighted users get from colour alone. */
.ci-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  align-self: center;
  /* Task 12: on private_e2ee this is a <button>, not a <span> (there is
     no separate commit page to link to on that tier — clicking it
     toggles the inline .ci-section instead). Reset the UA button chrome
     here, at the same specificity as the plain-color rules below, so a
     later same-specificity rule (.ci-lost's border, say) still wins in
     source order exactly as it does for the plaintext tiers' <span>. */
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
}
button.ci-dot { cursor: pointer; }
button.ci-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ci-success { background: var(--badge-public); }
.ci-failure { background: var(--danger); }
.ci-running { background: var(--accent); }
.ci-queued { background: var(--badge-private); }
.ci-skipped { background: var(--fg-muted); }
.ci-lost { background: var(--bg); border: 2px solid var(--danger); }
.ci-stale { background: var(--bg); border: 2px dashed var(--fg-muted); }
/* ci-unreadable (Task 12, private_e2ee only): a "reported" row whose
   sealed payload wouldn't open. Deliberately neither the pass-green nor
   the fail-red — this browser could not read what happened, so it must
   not look like it decided. */
.ci-unreadable { background: var(--bg); border: 2px dotted var(--fg-muted); }

/* A pending run breathes, so a page you leave open tells you at a
   glance that something is still happening. Only queued and running
   pulse — a verdict holds still. Respects reduced-motion: the colour
   already distinguishes the states, so dropping the animation loses
   nothing. */
@keyframes ci-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ci-running, .ci-queued { animation: ci-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .ci-running, .ci-queued { animation: none; }
}

/* The dot is a link on the plaintext tiers: same size and position, no
   underline, and a focus ring that matches the E2EE tier's button. */
.ci-dot-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  text-decoration: none;
  border-radius: 50%;
}
.ci-dot-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- CI run page --------------------------------------------------- */
.ci-run { margin: 1.5rem 0; }
.ci-run-title { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.ci-run-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0 0 1.5rem;
}
.ci-run-facts dt { color: var(--fg-muted); }
.ci-run-facts dd { margin: 0; }
/* Same treatment as the collapsed .ci-log pre this page expands on, so
   a log reads identically wherever you meet it. */
.ci-run-log {
  overflow-x: auto;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  padding: 0.75rem;
}
.ci-run-log-empty { margin: 0.5rem 0; }

/* --- branch CI tab ------------------------------------------------- */
ul.ci-runs { list-style: none; padding: 0; margin: 0; }
.ci-run-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.ci-run-state { flex: 0 0 12rem; }
.ci-run-row .sha-link { flex: 0 0 auto; }
.ci-run-runner-cell { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ci-run-elapsed { flex: 0 0 auto; color: var(--fg-muted); font-size: 0.85rem; }
.ci-run-row .when { flex: 0 0 auto; color: var(--fg-muted); font-size: 0.85rem; }
.merge-ci-more { margin-top: 0.5rem; font-size: 0.85rem; }
/* The repo CI tab adds a branch column the branch tab does not need. */
.ci-run-branch { flex: 0 0 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 40rem) {
  .ci-run-row { flex-wrap: wrap; gap: 0.4rem 0.75rem; }
  .ci-run-state { flex-basis: auto; }
  .ci-run-branch { flex-basis: auto; }
  .ci-run-runner-cell { flex-basis: 100%; }
}
.ci-run-live { margin-top: 1rem; font-size: 0.9rem; }

ul.commits li.commit > .ci-section { flex-basis: 100%; }
.ci-section { margin: 1.25rem 0; }
.ci-summary { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.ci-summary .ci-dot { width: 0.7rem; height: 0.7rem; }
.ci-log { margin-top: 0.5rem; }
.ci-log summary { cursor: pointer; color: var(--fg-muted); font-size: 0.9rem; }
.ci-log pre {
  margin: 0.5rem 0 0;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 24rem;
  overflow-y: auto;
  overflow-x: auto;
}
.commit .sha {
  color: var(--accent);
  background: var(--code-bg);
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.commit .msg { flex: 1; min-width: 10rem; font-weight: 500; }
.commit .author, .commit .when { color: var(--fg-muted); font-size: 0.85rem; }
.commit .when { font-variant-numeric: tabular-nums; }
/* Phones: the single wrapping row clipped the author at the right
   edge — instead, message first at full width, then one quiet
   sha · author · time meta row. */
@media (max-width: 720px) {
  ul.commits li.commit { gap: 0.3rem 0.6rem; }
  .commit .msg { order: -1; flex: 1 1 100%; min-width: 0; }
}

/* ---------- prompt ledger ---------- */
/* Task 9 (Hub Prompts tab): the session index. Human/LLM is "the
   unmistakable" distinction (task-9-brief.md's Global Constraint) —
   badge-llm is a FILLED chip, the same tier-chip precedent as
   .badge-private-e2ee above (the meaningful one, worn proudly);
   badge-human stays an outline chip, same shape as .badge-public/
   .badge-private. Withheld/redacted chips reuse the gilt-amber private
   tier tokens rather than inventing new colors — tokens only, both
   light and dark ("Ink night" already flips --badge-private/-bg). */

.prompts-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin: 1rem 0;
}
.prompts-filter label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.prompts-count { color: var(--fg-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }

.session-list { list-style: none; padding: 0; margin: 0; max-width: 80ch; }
.session-row {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}
.session-list li.session-row:last-child { border-bottom: 1px solid var(--border); }

.session-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}
.session-author { color: var(--fg); font-weight: 600; }
.session-model {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--code-bg);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
}
.session-when { font-variant-numeric: tabular-nums; }
.session-branch {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.session-landed { margin-left: auto; }

.session-summary {
  margin: 0.3rem 0;
  font-weight: 500;
}
.session-first, .session-latest {
  margin: 0.2rem 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.session-first .prompt-label, .session-latest .prompt-label {
  display: inline-block;
  min-width: 3.5rem;
  margin-right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.session-prompts { font-size: 0.8rem; margin: 0.3rem 0 0; }

/* Human/LLM badges — same shape family as .badge (tier chips), reused
   rather than duplicated: outline for human, filled verdigris for LLM. */
.badge-human {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid currentColor;
  color: var(--fg-muted);
  margin-right: 0.4rem;
}
.badge-llm {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  margin-right: 0.4rem;
}

/* Withheld/redacted: amber-tinted via the existing gilt private-tier
   tokens (never a new color for "something is hidden here"). */
.chip-withheld, .chip-redacted {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--badge-private);
  background: var(--badge-private-bg);
  border: 1px solid currentColor;
}

/* Task 10: the ledger transcript page (templates/ledger.html) and the
   commit page's Intent panel (templates/commit.html) — tokens only,
   same family as the session-row rules above; .ledger-entry is the
   ledgerEntryRow (badge.html) shared partial's own wrapper, so both
   surfaces render one entry identically. */
.ledger-title { margin: 0.5rem 0 1rem; }
.ledger-title .branch {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.ledger-transcript { display: flex; flex-direction: column; gap: 0.6rem; }
.ledger-entry {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0 0;
}
.entry-author { color: var(--fg); font-weight: 600; margin-right: 0.5rem; }
.entry-when { color: var(--fg-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.entry-text { margin: 0.3rem 0 0; }
.ledger-commit-marker {
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.ledger-commit-marker a { color: var(--accent); text-decoration: none; }
.ledger-commit-marker a:hover { text-decoration: underline; }
.ledger-commit-marker .sha {
  background: var(--code-bg);
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.ledger-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.ledger-footer .sha {
  background: var(--code-bg);
  padding: 0 0.35rem;
  border-radius: 4px;
}

.intent-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1.25rem 0;
}
.intent-heading {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.intent-list .ledger-entry:first-child { border-top: none; padding-top: 0; }
.intent-full-link { margin: 0.6rem 0 0; font-size: 0.85rem; }
.landed-from { margin: 0 0 1rem; font-size: 0.9rem; color: var(--fg-muted); }

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

.token-reveal {
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  max-width: 44rem;
}
.token-reveal p { margin: 0 0 0.5rem; }
.token-reveal pre { margin: 0; overflow-x: auto; }
.token-reveal code { font-size: 0.9rem; font-weight: 700; }

table.data {
  border-collapse: collapse;
  width: 100%;
  max-width: 56rem;
  font-size: 0.9rem;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 0.55rem 0.75rem 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
table.data td form { margin: 0; }

.hint { color: var(--fg-muted); font-size: 0.9rem; }

/* ---------- settings / keys ---------- */

/* The user Settings area (settings-sidebar pass, 2026-08-09): Keys /
   Access tokens / Petnames are sections of one /settings area —
   sidebar nav on the left, section content beside it. Active paint
   mirrors .subtabs a.active. At the site's 720px breakpoint the nav
   wraps into a horizontal row above the content and the group
   headings hide. */
.settings-page { display: flex; align-items: flex-start; gap: 2.5rem; max-width: 60rem; }
.settings-nav {
  flex: 0 0 10.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: sticky;
  top: 1rem;
}
.settings-nav a { padding: 0.3rem 0.6rem; border-radius: var(--radius-ctl); color: var(--fg); font-size: 0.95rem; }
.settings-nav a:hover { background: var(--bg-inset); text-decoration: none; }
.settings-nav a.active { background: var(--accent-wash); color: var(--accent-emph); font-weight: 600; }
.settings-nav-group {
  margin: 1rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.settings-nav-group:first-child { margin-top: 0; }
.settings-content { flex: 1; min-width: 0; }
.settings-content h1 { margin-top: 0; }
@media (max-width: 720px) {
  .settings-page { flex-direction: column; gap: 1.25rem; }
  /* flex: none — the desktop 10.5rem flex-basis would become HEIGHT
     once .settings-page turns into a column. */
  .settings-nav { position: static; flex: none; flex-direction: row; flex-wrap: wrap; gap: 0.25rem; width: 100%; }
  .settings-nav-group { display: none; }
}

.settings-slot, .settings { margin-top: 1.5rem; }
/* Repo Settings sections (repo-settings-sidebar pass, 2026-08-09):
   the tab reuses the account-settings sidebar layout; inside
   .repo-body the page-level top margin comes from the wrapper, not
   the .settings content box. */
.repo-body .settings-page { margin-top: 1.5rem; }
.repo-body .settings-page .settings { margin-top: 0; }
/* .settings is a flex item, so a first child's own margin-top doesn't
   collapse into it — it becomes visible internal space that differs
   per section (dl/form/h3/h2 all carry different UA/rule margins),
   making the content column jump as you click through the sidebar
   (finding 2, repo-settings-sidebar final review). Zero it on both
   the plaintext template's direct children and the E2EE client's
   per-section [data-section] wrapper divs. */
.repo-body .settings-page .settings > :first-child,
.repo-body .settings-page .settings > [data-section] > :first-child { margin-top: 0; }
.settings-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.5rem; margin: 1.25rem 0 0.5rem; max-width: 40rem; }
.settings-facts dt { color: var(--fg-muted); font-size: 0.9rem; }
.settings-facts dd { margin: 0; }
.settings-facts .badge { margin-left: 0; }
.settings ul.members { list-style: none; padding: 0; }
.settings pre, .key-status pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-ctl);
  overflow-x: auto;
  font-size: 0.85rem;
}
.muted { color: var(--fg-muted); font-size: 0.9rem; }

.explainer {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 40rem;
  color: var(--fg-muted);
}
/* The E2EE repo's locked state is the only thing on an otherwise wide
   page (the unlocked browse grid needs the full width, so the page
   can't be .narrow) — center the card so the emptiness reads as
   sealed-on-purpose, not as a stranded column. */
#app .explainer { margin: 3rem auto; }

.key-status dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; }
.key-status dt { color: var(--fg-muted); }
.key-status dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 0.85rem; }
.key-import form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 40rem; margin-top: 1.5rem; }
.key-import textarea { font-family: var(--mono); font-size: 0.85rem; }
.message { min-height: 1.2em; }

/* ---------- states ---------- */

/* Hidden for the first 500ms: on a fast load the page must paint
   nothing where the decrypted content will land — the instant
   "Loading…" line read as a flash of an error page. The 0s-duration
   delayed animation flips visibility on only when a load is actually
   slow; the pulse waits out the same delay. */
.loading {
  color: var(--fg-muted);
  visibility: hidden;
  animation: loading-appear 0s 0.5s forwards, loading-pulse 1.2s 0.5s ease-in-out infinite alternate;
}
@keyframes loading-appear { to { visibility: visible; } }
@keyframes loading-pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ---------- error page ---------- */

.error-page { max-width: 44rem; padding-top: 4rem; }
.error-page .status {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
.error-page p { font-size: 1.05rem; }

/* ---------- branches & discussions ----------
   Both worlds (repo_plaintext.html/branch.html/discussion.html and
   branches.js/discussions.js/discussviews.js) emit the same class
   names by construction — one set of rules styles both. Row layouts
   mirror .commits/.commit (below); the state/branch chips reuse the
   tier badge's pill shape (.badge, above); post cards reuse the
   .pop-panel card look; forms reuse .key-import form's stacked
   spacing. No new tokens — existing --accent/--fg-muted/--border/etc.
   only. 🤖 Task 14 (branches & discussions), 2026-08-09. */

.branches-list { margin-top: 1rem; }
ul.branches { list-style: none; padding: 0; margin: 0; }
ul.branches li.branch-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.9rem;
}
ul.branches li.branch-row:last-child { border-bottom: 1px solid var(--border); }
.branch-row .branch-name { font-weight: 600; }
.branch-row .msg { flex: 1; min-width: 10rem; font-weight: 500; }
.branch-row .author, .branch-row .when { color: var(--fg-muted); font-size: 0.85rem; }
.branch-row .when { font-variant-numeric: tabular-nums; }

.branch-title, .discussion-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.branch-description { margin: 1rem 0; }

/* The state pill (open/closed — discussions) and the branch chip
   (branch name — consolidated discussions list, task list) share the
   tier badge's pill shape (.badge, above): 1px currentColor border,
   999px radius, small caps-height text. */
.state {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.state-open { color: var(--accent); background: var(--accent-wash); }
.state-closed { color: var(--fg-muted); background: var(--bg-inset); }

.branch-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}
a.branch-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.branch-chip.muted { cursor: default; font-size: 0.75rem; }

.discussions-list { margin-top: 1rem; }

/* The All/Open/Closed state filter is a segmented control — the
   .subtabs recipe (Files|Commits, above), restated here because the
   plaintext world emits <a> links (must work without JS) while the
   E2EE world emits <button>s, and .subtabs only dresses anchors.
   Active state: class="active" (both worlds; the plaintext template
   adds aria-current alongside). */
.discussion-filter {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctl);
  overflow: hidden;
  margin: 0 0 1rem;
}
.discussion-filter a,
.discussion-filter button {
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg-muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.discussion-filter a + a,
.discussion-filter button + button { border-left: 1px solid var(--border); }
.discussion-filter a:hover,
.discussion-filter button:hover { color: var(--fg); background: var(--bg-inset); text-decoration: none; }
.discussion-filter .active {
  background: var(--accent-wash);
  color: var(--accent-emph);
  font-weight: 600;
}

ul.discussions { list-style: none; padding: 0; margin: 0; }
ul.discussions li.discussion-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.9rem;
}
ul.discussions li.discussion-row:last-child { border-bottom: 1px solid var(--border); }
/* Phones: same reflow as the commits ledger (its 720px rule above) —
   title first at full width, then one quiet chip · state · author meta
   row, instead of the author clipping ragged at the right edge. */
@media (max-width: 720px) {
  ul.branches li.branch-row, ul.discussions li.discussion-row, ul.tasks li.task-row { gap: 0.3rem 0.6rem; }
  .discussion-row > a:not(.branch-chip) { flex: 1 1 100%; }
  .branch-row .branch-name { flex: 1 1 100%; }
}
/* :not(.branch-chip): the branch chip is also a direct-child anchor on
   branch-attached rows — without the guard it inherits the title's
   stretch and weight and renders as a huge bold pill. */
.discussion-row > a:not(.branch-chip) { flex: 1; min-width: 10rem; font-weight: 600; }
.discussion-row .author { color: var(--fg-muted); font-size: 0.85rem; }

/* Post cards (a discussion's opening post + replies) reuse the
   .pop-panel card shape — border, radius, padding — flowed inline
   instead of floated. */
.post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.post.opening-post { background: var(--bg-inset); }
.post-meta { margin: 0 0 0.5rem; }
.post-meta .author { font-weight: 600; font-size: 0.85rem; color: var(--fg-muted); }
.post .amadan-markdown:last-child { margin-bottom: 0; }

ul.tasks { list-style: none; padding: 0; margin: 0; }
ul.tasks li.task-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.9rem;
}
ul.tasks li.task-row:last-child { border-bottom: 1px solid var(--border); }
.task-row .task-title { flex: 1; min-width: 10rem; font-weight: 500; }
.task-row .task-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
}
.btn-small { padding: 0.2rem 0.6rem; font-size: 0.8rem; }
.inline-form { display: inline-block; margin: 0; }
.reply-form + .inline-form { margin-top: 0.75rem; }

/* Reply/add-task/new-discussion/edit-description forms: the same
   stacked-with-gap recipe as .key-import form (above) — this repo's
   one existing "settings form" precedent. */
.reply-form,
.add-task,
details.new-discussion form,
details.edit-description form,
.settings form,
.status-config form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 40rem;
  margin-top: 0.75rem;
}
.reply-form { margin-top: 1.25rem; }
/* new-discussion carries a bottom margin too: on the Discussions tab
   (members) it sits directly above the filter capsule, which has no
   top margin of its own. */
details.new-discussion { margin: 0.75rem 0 1rem; }
details.edit-description { margin-top: 0.75rem; }
.status-config { margin-top: 1.5rem; }

ol.status-list { margin: 0.5rem 0 1rem; padding-left: 1.25rem; font-size: 0.9rem; }
ol.status-list li { padding: 0.15rem 0; }

.error { color: var(--danger); font-size: 0.85rem; margin: 0.4rem 0 0; }

/* ---- Branch review: subtabs, Overview grid, Changes surface ----
   (branch review UI design, 2026-08-12). Ledger rules apply: hairline
   rows, no cards, flat; verdigris wash marks the selected file. */

/* Five tabs since Amendment B: the capsule scrolls within itself on
   narrow screens instead of widening the page. display:flex (not the
   base inline-flex) so max-width applies; width fits content via the
   border-box capsule already being inline in flow. */
.branch-subtabs { margin: 0.5rem 0 1rem; max-width: 100%; overflow-x: auto; white-space: nowrap; }
.branch-subtabs a { flex-shrink: 0; }

.branch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; align-items: start; }
.branch-rail section { margin-bottom: 1.5rem; }
.branch-rail h3 { margin: 0 0 0.5rem; }
.branch-rail .rail-count { color: var(--fg-muted); font-weight: 400; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.branch-rail ul.commits li.commit { font-size: 0.85rem; }
.changes-summary .counts, .changes-summary .viewed-progress { display: block; font-size: 0.85rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

.changes-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.changes-rail { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
ol.changes-files { list-style: none; margin: 0; padding: 0; }
ol.changes-files a.changes-row { display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.5rem; border-top: 1px solid var(--border); color: var(--fg); font-size: 0.85rem; }
ol.changes-files li:last-child a.changes-row { border-bottom: 1px solid var(--border); }
a.changes-row:hover { background: var(--bg-inset); text-decoration: none; }
a.changes-row.current { background: var(--accent-wash); color: var(--accent-emph); font-weight: 600; }
.changes-row .path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; font-family: var(--mono); font-size: 0.8rem; }
.changes-row .viewed-mark { color: var(--accent); flex: none; }
/* [hidden] has no UA effect on inline SVG (HTML-namespace rule only) —
   keep the 1em slot so the path column never shifts, hide the mark. */
.changes-row .viewed-mark[hidden] { visibility: hidden; }
.counts { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.8rem; }
.counts .add { color: var(--badge-public); }
.counts .del { color: var(--danger); }
.counts .bin { color: var(--fg-muted); }
.changes-progress { border-top: 1px solid var(--border); margin: 0; padding: 0.5rem; font-size: 0.85rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.changes-progress.all-viewed { color: var(--accent-emph); }
.branch-moved { margin: 0 0 0.5rem; padding: 0.4rem 0.5rem; font-size: 0.85rem; color: var(--fg-muted); border: 1px dashed var(--border); border-radius: var(--radius-ctl); }

.changes-file { margin-bottom: 1.5rem; }
.changes-file-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-ctl) var(--radius-ctl) 0 0; }
.changes-file-head .path { font-size: 0.85rem; overflow-wrap: anywhere; }
.changes-file-head .viewed-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--fg-muted); white-space: nowrap; cursor: pointer; }
.changes-file .diff-file { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.changes-file .diff-file-header { display: none; }
.changes-empty { margin-top: 1rem; }

/* Dashboard cards (Amendment B): Discussions + Tasks side by side in
   the main column, above Activity. Must precede the 800px media query
   below — its stacking override has equal specificity and wins only
   by cascade order. */
.dash-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.dash-cards section { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0; }
.dash-cards h3 { margin: 0 0 0.5rem; }
.dash-cards .rail-count { color: var(--fg-muted); font-weight: 400; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .branch-grid, .changes-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-cards { grid-template-columns: 1fr; }
  /* The dashboard's main column (description, stats, Activity) leads
     on narrow screens; the rail cards follow. (The v1 order:-1 rule
     predated Amendment A, when the description lived in the rail.) */
  .changes-rail { position: static; max-height: none; }
}

/* ---- Branch dashboard (Amendment A): stat tiles + Activity ----
   Tiles are text, not charts: label over a semibold value in the
   default proportional figures (tabular-nums is for columns, not
   display sizes). One hairline capsule, internal dividers — the
   subtabs grammar at rest. */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0 1.5rem; }
.stat-tile { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 1rem; }
.stat-tile + .stat-tile { border-left: 1px solid var(--border); }
.stat-label { font-size: 0.8rem; color: var(--fg-muted); }
.stat-value { font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.stat-sub { font-size: 0.8rem; color: var(--fg-muted); }

.branch-activity h3 { margin-bottom: 0.5rem; }
ul.activity { list-style: none; margin: 0; padding: 0; }
li.activity-row { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; padding: 0.35rem 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
ul.activity li:last-child { border-bottom: 1px solid var(--border); }
.activity-row .actor { font-weight: 600; }
.activity-row .verb { color: var(--fg-muted); }
.activity-row .object { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.activity-row .when { margin-left: auto; color: var(--fg-muted); font-size: 0.8rem; white-space: nowrap; }

/* Branch lifecycle: state chips, the closed-branch banner, and the
   Branches tab's Active|Closed filter capsule. */
.branch-filter { margin: 0.5rem 0 1rem; }
.state-chip { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.75rem; color: var(--fg-muted); }
.chip-merged { color: var(--accent-emph); background: var(--accent-wash); border-color: transparent; }
.chip-archived { background: var(--bg-inset); }
.chip-deleted { border-style: dashed; }
.branch-banner { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; margin: 0 0 1rem; font-size: 0.9rem; }
.branch-banner form { margin-left: auto; }
.branch-admin { margin-top: 1.5rem; }

/* Merge readiness rows (Amendment C): status dot + text, reusing the
   ci-dot state colors. */
.merge-checks { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.merge-check { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }

.tasks-card ul.tasks { font-size: 0.9rem; }
.discussions-card ul.discussions { font-size: 0.9rem; }
.rail-link { font-size: 0.85rem; margin: 0.5rem 0 0; }

@media (max-width: 800px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-tile:nth-child(odd) { border-left: none; }
  .stat-tile:nth-child(n+3) { border-top: 1px solid var(--border); }
}
