/* aswa: "Timetable". See DESIGN.md for the system and the reasons.
   Light, ruled, exact. One signal red, used only for what waits for a person. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* Neutrals: a cool gray at low chroma, tuned to read as paper and ink, not as blue. */
  --bg: oklch(0.975 0.002 250);
  --panel: oklch(1 0 0);
  --panel-2: oklch(0.955 0.003 250);
  --rail: oklch(0.955 0.003 250);
  --border: oklch(0.9 0.004 250);
  --rule: oklch(0.93 0.003 250);
  --text: oklch(0.22 0.012 255);
  --muted: oklch(0.5 0.01 255);
  --faint: oklch(0.64 0.008 255);

  /* Roles */
  --ink: oklch(0.22 0.012 255);          /* the primary button */
  --ink-fg: oklch(0.985 0 0);
  --signal: oklch(0.575 0.205 27);       /* what waits for a person. Nothing else is this red. */
  --signal-bg: oklch(0.965 0.022 27);
  --accent: oklch(0.47 0.12 240);        /* links and focus */
  --ok: oklch(0.52 0.12 155);
  --ok-bg: oklch(0.965 0.03 155);
  --warn: oklch(0.55 0.12 65);
  --warn-bg: oklch(0.97 0.035 85);
  --bad: oklch(0.53 0.19 27);
  --agent: oklch(0.46 0.08 205);
  --human: oklch(0.22 0.012 255);
  --accent-text: var(--ink-fg);

  /* Type: Schibsted Grotesk for the interface, JetBrains Mono for ids, code and figures. Scale 1.2 from 14px. */
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --t-xs: 11.5px;
  --t-sm: 12.5px;
  --t-md: 14px;
  --t-lg: 17px;
  --t-xl: 20px;
  --t-2xl: 24px;

  /* Space: a 4px base. Tight inside a group, wide between groups. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 5px;
  --r-md: 8px;
  /* One shadow, only for things that float above the page: the drawer, dialogs, toasts. */
  --shadow: 0 1px 2px oklch(0.2 0.01 255 / 0.06), 0 12px 32px -8px oklch(0.2 0.01 255 / 0.18);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 120ms;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t-md)/1.5 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: 100%;
}
body > .login { grid-column: 1 / -1; }
::selection { background: oklch(0.88 0.06 240); }

h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; }
kbd {
  font: 500 10.5px/1 var(--mono);
  color: var(--faint);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 4px;
  background: var(--panel);
}
.mono, code { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.dim { opacity: .45; }
.spacer { flex: 1; }
.error { color: var(--bad); }

/* ---------- Controls ---------- */
button, select, input, textarea { font: inherit; color: inherit; }
button, a.button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 11px;
  font-weight: 550;
  font-size: var(--t-sm);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
button:hover, a.button:hover, .btn:hover { border-color: oklch(0.8 0.006 250); background: var(--panel-2); }
button:active, a.button:active { background: var(--border); }
button.primary, a.button.primary { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
button.primary:hover, a.button.primary:hover { background: oklch(0.32 0.014 255); border-color: oklch(0.32 0.014 255); }
button.primary kbd { background: transparent; color: oklch(0.75 0.01 255); border-color: oklch(0.42 0.012 255); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--panel-2); border-color: transparent; }
button.ok { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
button.ok:hover { background: oklch(0.32 0.014 255); }
button.bad { background: var(--panel); color: var(--bad); border-color: oklch(0.85 0.05 27); }
button.bad:hover { background: var(--signal-bg); border-color: var(--bad); }
button.small, a.button.small { min-height: 26px; padding: 2px 9px; font-size: var(--t-xs); }
button.icon { width: 30px; padding: 0; font-size: 16px; font-weight: 500; }
button:disabled, button[disabled] { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

select, input, textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 9px;
  min-height: 32px;
  transition: border-color var(--fast) var(--ease);
}
select:hover, input:hover, textarea:hover { border-color: oklch(0.82 0.006 250); }
select:focus, input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px oklch(0.47 0.12 240 / 0.14); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { width: 100%; resize: vertical; min-height: 76px; line-height: 1.5; }
input { width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--ink); }

.link { color: var(--accent); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
a { color: var(--accent); }

/* ---------- Rail ---------- */
.rail {
  display: flex; flex-direction: column; gap: var(--s4);
  background: var(--rail);
  border-right: 1px solid var(--border);
  padding: var(--s4) var(--s3);
  overflow-y: auto;
  min-height: 0;
}
.rail[hidden], main[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; letter-spacing: -0.03em; padding: 2px 6px; }
.mark { width: 16px; height: 16px; border-radius: 3px; background: var(--ink); position: relative; flex-shrink: 0; }
.mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: var(--signal); }
.rail-project { display: flex; gap: var(--s1); }
.rail-project select { flex: 1; min-width: 0; font-weight: 550; }

.tabs { display: flex; flex-direction: column; gap: 1px; }
.tabs button {
  justify-content: flex-start; gap: var(--s2);
  width: 100%; min-height: 34px;
  background: transparent; border-color: transparent;
  color: var(--muted); font-weight: 500; font-size: var(--t-md);
  padding: 4px 8px;
}
.tabs button:hover { background: oklch(0.925 0.004 250); color: var(--text); }
.tabs button.active { background: var(--panel); color: var(--text); border-color: var(--border); }
.tabs button.main { font-weight: 650; color: var(--text); font-size: 15px; min-height: 38px; }
.tabs button.main:not(.active) { color: oklch(0.38 0.012 255); }
.tabs button.minor { font-size: var(--t-sm); min-height: 30px; }
.tab-name { flex: 1; text-align: left; }
.tabs kbd { opacity: 0; transition: opacity var(--fast) var(--ease); }
.tabs button:hover kbd, .tabs button:focus-visible kbd { opacity: 1; }
.tabs-sep { height: 1px; background: var(--border); margin: var(--s2) 6px; }

.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  font: 650 11.5px/1 var(--font); font-variant-numeric: tabular-nums;
  background: var(--signal); color: #fff;
}
.badge.muted { background: var(--border); color: var(--text); }
.badge.live { background: transparent; color: var(--ok); border: 1px solid oklch(0.85 0.06 155); }
.badge.beta { background: transparent; color: var(--faint); border: 1px solid var(--border); font-size: 10.5px; height: 18px; }

.rail-label { font-size: var(--t-xs); font-weight: 600; color: var(--faint); padding: 0 8px var(--s1); }
.duty { flex: 1; min-height: 0; }
.duty-row {
  display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: baseline;
  padding: 5px 8px; border-radius: var(--r-sm); cursor: pointer;
}
.duty-row:hover { background: oklch(0.925 0.004 250); }
.duty-row .pulse { transform: translateY(-1px); }
.duty-name { font-weight: 600; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-doing { grid-column: 2; font-size: var(--t-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-empty { font-size: var(--t-xs); color: var(--faint); padding: 0 8px; }
.rail-foot { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--border); padding-top: var(--s2); }
.rail-foot button { justify-content: flex-start; color: var(--muted); font-weight: 500; }
#account-btn::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); flex-shrink: 0; }

/* ---------- Main ---------- */
main { display: flex; flex-direction: column; overflow: auto; min-width: 0; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s6);
  min-height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.topbar-title { flex: 1; display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.topbar-title h1 { font-size: var(--t-xl); margin: 0; white-space: nowrap; }
#view-sub { font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search { width: 240px; }
.view { padding: var(--s5) var(--s6) var(--s7); flex: 1 0 auto; }
.view[hidden] { display: none; }
.empty { color: var(--muted); padding: var(--s5) 0; }
.empty-big { max-width: 520px; margin: 72px auto; text-align: center; }
.empty-big h2 { margin: 0 0 var(--s2); font-size: var(--t-2xl); }
.empty-big .muted { margin-top: var(--s5); }
.view-hint { color: var(--muted); font-size: var(--t-sm); margin: 0 0 var(--s5); max-width: 72ch; }
.view-hint .link { margin-left: 6px; color: var(--signal); font-weight: 600; }
.narrow { max-width: 820px; }
.wide { max-width: 1040px; }

/* Section heads: sentence case, weight and a rule. No all-caps eyebrows. */
.needs h3, .overview h3, .feedback h3, #view-agents h3.section, .results h3 {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--t-md); font-weight: 650; color: var(--text);
  margin: var(--s6) 0 var(--s1); padding-bottom: 0;
}
.needs h3:first-child, .needs .view-hint + h3 { margin-top: 0; }
.section-hint { margin: 0 0 var(--s3); font-size: var(--t-sm); color: var(--muted); }
h3 .ghost.small, .needs h3 .small { margin-left: auto; }

/* ---------- Verdicts: ruled entries, not boxes ---------- */
.approval {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s2);
}
.approval .msg-head { font-size: var(--t-sm); color: var(--muted); gap: 6px; flex-wrap: wrap; align-items: baseline; }
.approval .msg-head .link { color: var(--text); font-weight: 600; }
.approval .msg-head .link:hover { color: var(--accent); }
.approval .msg-body { font-size: var(--t-md); margin-top: 6px; }
.approval.done { background: var(--panel-2); }
.approval-actions { display: flex; gap: var(--s2); margin-top: var(--s3); align-items: center; }
.approval-actions input { flex: 1; }

.pr-list { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.pr-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--s3);
  padding: 10px var(--s4); min-height: 48px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}
.pr-row:first-child { border-top: 0; }
.pr-row:hover, .pr-row:focus-visible { background: var(--panel-2); outline: none; }
.pr-age { font: 500 var(--t-sm)/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-row .pr-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-row .pr-where { font: var(--t-xs) var(--mono); color: var(--muted); white-space: nowrap; }
.verdict { font-weight: 650; font-size: var(--t-sm); white-space: nowrap; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.verdict.warn { color: var(--warn); }
.verdict.none { color: var(--faint); font-weight: 500; }
.pr-row .verdict { padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; font-size: var(--t-xs); }
.pr-row .verdict.none { border-color: var(--border); }

/* The verdict count: the one big number on the screen. */
.tally { display: flex; align-items: baseline; gap: var(--s3); margin: 0 0 var(--s5); }
.tally b { font: 700 44px/1 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--signal); }
.tally.clear b { color: var(--ok); }
.tally span { color: var(--muted); font-size: var(--t-md); }
.tally .parts { display: flex; gap: var(--s4); margin-left: auto; font-size: var(--t-sm); }
.tally .parts em { font-style: normal; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Board ---------- */
.board { display: flex; gap: var(--s3); align-items: flex-start; min-width: max-content; }
.col { width: 272px; flex-shrink: 0; }
.col-head { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: var(--t-sm); padding: 0 2px var(--s2); }
.col-head span:last-child { font-variant-numeric: tabular-nums; color: var(--faint); }
.col-head.waiting_human { color: var(--signal); }
.cards { display: flex; flex-direction: column; gap: 6px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}
.card:hover { border-color: oklch(0.78 0.008 250); }
.card.needs-human { border-color: oklch(0.82 0.08 27); background: var(--signal-bg); }
.card.stale { border-style: dashed; border-color: oklch(0.78 0.08 75); }
.card-top { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: var(--t-xs); }
.card-top > span:first-child { font-family: var(--mono); }
.card-title { margin: 5px 0; font-weight: 600; line-height: 1.35; }
.card-meta { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; color: var(--muted); font-size: var(--t-xs); }
.col-empty { height: 44px; border: 1px dashed var(--border); border-radius: var(--r-md); }
.filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.filters select { width: auto; max-width: 320px; }
.filters .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); cursor: pointer; font-size: var(--t-sm); }
.check input { width: auto; }
.chip { border-radius: 15px; min-height: 28px; padding: 2px 12px; background: transparent; color: var(--muted); font-weight: 500; }
.chip.on { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }

/* ---------- Identity and tags ---------- */
.who { font-weight: 600; white-space: nowrap; }
.who.agent { color: var(--agent); }
.who.agent::before { content: "◆ "; font-size: 0.7em; vertical-align: 1px; }
.who.human { color: var(--human); }
.who.human::before { content: "● "; font-size: 0.7em; vertical-align: 1px; color: var(--faint); }
.tag {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  font-size: var(--t-xs); font-weight: 550; line-height: 18px;
  color: var(--muted); background: var(--panel);
}
.tag.goal { color: var(--text); border-color: var(--text); }
.tag.feature { color: var(--agent); border-color: oklch(0.82 0.04 205); }
.tag.ms { color: var(--text); background: var(--panel-2); border-color: var(--panel-2); font-family: var(--mono); font-size: 11px; }
.tag.warn { color: var(--warn); border-color: oklch(0.85 0.06 75); background: var(--warn-bg); }
.prio { font-weight: 650; font-size: var(--t-xs); }
.prio-1 { color: var(--bad); }
.prio-2 { color: var(--warn); }
.prio-3, .prio-4 { color: var(--muted); }
.labels { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.label { display: inline-block; font: 500 11px/18px var(--mono); padding: 0 6px; border-radius: 4px; background: var(--panel-2); color: oklch(0.38 0.012 255); }
.pr { font: 500 11px/18px var(--mono); padding: 0 6px; border-radius: 4px; text-decoration: none; border: 1px solid currentColor; white-space: nowrap; }
.pr-open { color: var(--ok); }
.pr-draft { color: var(--muted); }
.pr-merged { color: var(--text); }
.pr-closed { color: var(--bad); }
.progress { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin: var(--s2) 0; }
.progress > div { height: 100%; background: var(--ink); transition: width .3s var(--ease); }

/* ---------- Intent ---------- */
.overview { max-width: 1040px; }
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s3); }
.proj-head h1 { font-size: var(--t-2xl); margin: 0 0 var(--s1); display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.proj-head h1 .muted { font: 500 var(--t-md) var(--mono); }
.proj-desc { color: var(--muted); max-width: 72ch; }
.proj-head .row { display: flex; gap: 6px; margin: 0; }
.stats { display: flex; gap: var(--s6); margin: var(--s4) 0 var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat[data-goto] { cursor: pointer; }
.stat[data-goto]:hover b { color: var(--accent); }
.stat b { font-size: var(--t-2xl); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: var(--t-sm); }
.stat small { display: block; color: var(--muted); font-size: var(--t-xs); margin-top: 2px; }
.stat.warn b { color: var(--signal); }
.stat.live b { color: var(--ok); }
.goal-row {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s3) var(--s4); margin-bottom: 6px; cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}
.goal-row:hover { border-color: oklch(0.78 0.008 250); }
.goal-row b { font-weight: 650; }
.goal-row .muted:first-child { font-family: var(--mono); font-size: var(--t-sm); }
.goal-row.feature .goal-main > div:first-child::before { content: "Feature "; color: var(--agent); font-size: var(--t-xs); font-weight: 600; margin-right: 4px; }
.goal-row.milestone b { font-size: var(--t-lg); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.agent-mini { display: flex; gap: var(--s2); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); }

/* ---------- Agents and routing ---------- */
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.pulse.live { background: var(--ok); box-shadow: 0 0 0 3px oklch(0.52 0.12 155 / 0.16); }
.pulse.idle { background: oklch(0.72 0.13 75); }
.pulse.off { background: transparent; border: 1.5px solid var(--faint); }
table.agents { border-collapse: separate; border-spacing: 0; width: 100%; max-width: 1100px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; font-size: var(--t-sm); }
table.agents th { text-align: left; color: var(--muted); font-weight: 550; font-size: var(--t-xs); padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.agents td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
table.agents tr:first-child td { border-top: 0; }
table.agents tbody tr:hover td { background: oklch(0.985 0.002 250); }
table.agents td:nth-child(n+5):not(:last-child) { font-variant-numeric: tabular-nums; }
td.doing { max-width: 320px; }
.routing td:last-child { line-height: 1.9; }
.activity { margin-top: 4px; font-size: var(--t-xs); color: var(--agent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity::before { content: "▸ "; }
.activity-inline { color: var(--agent); }
.mini-doing { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Feedback ---------- */
.feedback { max-width: 980px; }
.report-row { display: flex; gap: var(--s3); align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px var(--s4); margin-bottom: 6px; cursor: pointer; }
.report-row:hover { border-color: oklch(0.78 0.008 250); }
.report-row.fixed, .report-row.wontfix, .report-row.duplicate { opacity: .6; }
.votes { min-width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--panel-2); display: grid; place-items: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.report-main { flex: 1; min-width: 0; }
.report-title { font-weight: 600; margin-bottom: 3px; overflow-wrap: anywhere; }
.sev { font-size: var(--t-xs); font-weight: 650; }
.sev-blocker { color: #fff; background: var(--bad); padding: 0 6px; border-radius: 4px; }
.sev-high { color: var(--bad); }
.sev-medium { color: var(--warn); }
.sev-low { color: var(--muted); }
.tag.kind-bug { color: var(--bad); border-color: oklch(0.85 0.05 27); }
.tag.kind-friction { color: var(--warn); border-color: oklch(0.85 0.06 75); }
.tag.kind-workflow { color: var(--text); }
.tag.kind-missing { color: var(--agent); border-color: oklch(0.82 0.04 205); }
.tag.kind-idea { color: var(--ok); border-color: oklch(0.85 0.05 155); }

/* ---------- Activity ---------- */
.event { color: var(--muted); padding: 5px 0; display: flex; gap: var(--s3); border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.event time { min-width: 120px; font-variant-numeric: tabular-nums; color: var(--faint); }

/* ---------- Drawer ---------- */
#drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(600px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: auto;
  z-index: 20;
  animation: slide-in 180ms var(--ease);
}
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } }
.drawer-inner { padding: var(--s5) var(--s6) var(--s7); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: var(--t-sm); }
#drawer h2 { margin: var(--s2) 0 var(--s3); font-size: var(--t-xl); line-height: 1.3; }
#drawer h3 { font-size: var(--t-sm); font-weight: 650; color: var(--text); margin: var(--s5) 0 var(--s2); }
.fields { display: grid; grid-template-columns: 96px 1fr; gap: 8px var(--s3); align-items: center; font-size: var(--t-sm); }
.fields label { color: var(--muted); }
.desc { white-space: pre-wrap; background: var(--panel-2); border-radius: var(--r-sm); padding: var(--s3); }
.sub { display: flex; gap: var(--s2); padding: 6px 0; cursor: pointer; border-bottom: 1px solid var(--rule); align-items: baseline; }
.sub:hover .sub-title { text-decoration: underline; }
.msg { border-left: 2px solid var(--border); padding: 4px 0 var(--s2) var(--s3); margin-bottom: var(--s2); }
.msg.kind-question { border-color: var(--signal); }
.msg.kind-handoff { border-color: var(--agent); }
.msg.kind-result { border-color: var(--ok); }
.msg.kind-decision { border-color: var(--ink); }
.msg-head { color: var(--muted); font-size: var(--t-xs); display: flex; gap: 6px; }
.msg-body { white-space: pre-wrap; margin-top: 2px; }
.row { display: flex; gap: 6px; margin-top: var(--s2); }
.row.wrap { flex-wrap: wrap; align-items: center; }
.row select { width: auto; }
input.tiny { width: 64px; }
.title-input { font-size: var(--t-lg); font-weight: 650; margin: 6px 0; }
.hint-box { border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--r-md); padding: 10px var(--s3); margin: var(--s2) 0 var(--s3); color: var(--muted); font-size: var(--t-sm); }
.hint-box.warn { border-color: oklch(0.85 0.06 75); background: var(--warn-bg); color: var(--text); }
.hint-box .row { margin-top: var(--s2); }
.hint-box .row input { flex: 1; }

/* ---------- Dialog and panels ---------- */
dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  width: min(540px, calc(100vw - 32px));
  padding: var(--s5);
  box-shadow: var(--shadow);
}
dialog[open] { animation: pop 160ms var(--ease); }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } }
dialog::backdrop { background: oklch(0.22 0.012 255 / 0.28); }
dialog form { display: flex; flex-direction: column; gap: var(--s3); }
dialog h2 { margin: 0; font-size: var(--t-xl); }
dialog h3 { font-size: var(--t-md); margin: var(--s4) 0 0; }
dialog .hint, .hint { color: var(--muted); margin: 0; font-size: var(--t-sm); }
dialog .actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }
dialog .row { display: flex; gap: var(--s2); }
dialog.wide-dialog { width: min(660px, calc(100vw - 32px)); }
.kind-pick { display: grid; gap: 6px; }
.kind-opt { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s2); align-items: baseline; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px var(--s3); cursor: pointer; }
.kind-opt input { width: auto; margin: 0; }
.kind-opt span { grid-column: 2; color: var(--muted); font-size: var(--t-sm); }
.kind-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.secret { font-family: var(--mono); font-size: var(--t-sm); word-break: break-all; background: var(--panel-2); border: 1px solid oklch(0.85 0.06 75); border-radius: var(--r-sm); padding: var(--s2) 10px; }
.list-row { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.ws-block { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: var(--s2) 0; }
.ws-block h3 { margin: 0 0 6px; font-size: var(--t-md); }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { flex: 1; }
.inline-form select { width: auto; }
.role { font-size: var(--t-xs); color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; }
.token-paste { margin: var(--s2) 0; }
.token-paste summary { cursor: pointer; }
.repo-pick { display: flex; flex-direction: column; max-height: 280px; overflow: auto; margin: 6px 0; border: 1px solid var(--border); border-radius: var(--r-md); }
.repo-pick button { justify-content: flex-start; gap: var(--s2); border: 0; border-radius: 0; border-bottom: 1px solid var(--rule); min-height: 38px; font-weight: 500; }
.repo-pick button:last-child { border-bottom: 0; }
.repo-pick button:hover { background: var(--panel-2); }
.repo-pick .grow { flex: 1; text-align: left; }
.repo-pick > .muted { padding: var(--s3); }

/* ---------- Results ---------- */
.results { max-width: 980px; }
.bars { display: flex; align-items: stretch; gap: 3px; height: 180px; margin-top: var(--s2); border-bottom: 1px solid var(--border); }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; }
.bar { width: min(44px, 70%); background: var(--ink); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: var(--accent); }
.bar-val { font-size: var(--t-xs); color: var(--text); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tip { display: none; position: absolute; bottom: calc(100% - 24px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--ink-fg); border-radius: var(--r-sm); padding: 4px 8px; white-space: nowrap; z-index: 2; pointer-events: none; font-size: var(--t-xs); }
.bar-col:hover .tip, .bar-col:focus-visible .tip { display: block; }
.bar-labels { display: flex; gap: 3px; margin-top: 4px; }
.bar-labels span { flex: 1; text-align: center; font-size: var(--t-xs); color: var(--muted); }
.table-view { margin: var(--s3) 0; }
.table-view summary { cursor: pointer; color: var(--muted); }
.bar-col.current .bar { opacity: .45; }

/* ---------- Markdown ---------- */
.md code { font-family: var(--mono); font-size: 0.86em; background: var(--panel-2); border-radius: 4px; padding: 1px 5px; }
.md pre { background: var(--panel-2); border-radius: var(--r-sm); padding: 10px var(--s3); overflow: auto; white-space: pre; }
.md pre code { padding: 0; background: none; }
.md ul { margin: 4px 0; padding-left: 20px; }
.md a { color: var(--accent); }
.md-h { font-weight: 650; margin-top: 6px; }
.msg-body.md, .desc.md { white-space: pre-wrap; }

/* ---------- Toasts and banner ---------- */
#toasts { position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; }
.toast {
  display: flex; gap: 10px; align-items: baseline;
  background: var(--ink); color: var(--ink-fg);
  border-radius: var(--r-md); padding: 10px var(--s4);
  box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px));
  font-size: var(--t-sm);
  animation: pop 160ms var(--ease);
}
.toast::before { content: "✕"; color: oklch(0.72 0.15 27); font-weight: 700; }
.toast.ok::before { content: "✓"; color: oklch(0.78 0.13 155); }
#banner { position: sticky; top: 0; z-index: 60; background: var(--signal); color: #fff; padding: 8px var(--s6); font-weight: 550; font-size: var(--t-sm); }

/* ---------- Login ---------- */
.login { display: flex; align-items: center; justify-content: center; padding: var(--s4); min-height: 100%; }
.login[hidden] { display: none; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: var(--s2); }
.login-box .brand { padding: 0; margin-bottom: var(--s6); }
.login-box h1 { font-size: 30px; margin: 0 0 var(--s3); letter-spacing: -0.025em; }
.login-box label { color: var(--muted); font-size: var(--t-sm); margin-top: var(--s1); font-weight: 550; }
.login-box input { min-height: 40px; }
.login-box button { margin-top: var(--s3); min-height: 42px; font-size: var(--t-md); }
.login-box p { margin: var(--s3) 0 0; font-size: var(--t-sm); }

/* ---------- Review feed: one PR on each screen ---------- */
main:has(#view-review:not([hidden])) { overflow: hidden; }
.feed-view { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.feed-view[hidden] { display: none; }
.feed-bar { display: flex; gap: 6px; align-items: center; padding: var(--s2) var(--s6); border-bottom: 1px solid var(--rule); }
.feed-bar .keys { font-size: var(--t-xs); }
.feed { flex: 1; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.reel { min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.reel-body { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: var(--s5) var(--s6) var(--s2); }
.reel-body h3 { font-size: var(--t-sm); font-weight: 650; color: var(--muted); margin: var(--s5) 0 var(--s2); }
.reel-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--t-sm); }
.reel-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: var(--s3) 0 6px; }
.reel-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.fact { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px 9px; background: var(--panel); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.fact.ok { color: var(--ok); border-color: oklch(0.85 0.05 155); background: var(--ok-bg); }
.fact.bad { color: var(--bad); border-color: oklch(0.85 0.05 27); background: var(--signal-bg); }
.fact.warn { color: var(--warn); border-color: oklch(0.85 0.06 75); background: var(--warn-bg); }
.reel-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.flag { color: var(--warn); background: var(--warn-bg); border: 1px solid oklch(0.85 0.06 75); border-radius: var(--r-sm); padding: 3px 9px; cursor: help; font-size: var(--t-sm); font-weight: 550; }
.flag-no-tests, .flag-large { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.rv { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px var(--s4); background: var(--panel); margin-bottom: var(--s2); }
.rv.ok { background: var(--ok-bg); border-color: oklch(0.88 0.04 155); }
.rv.bad { background: var(--signal-bg); border-color: oklch(0.88 0.04 27); }
.rv.warn { background: var(--warn-bg); border-color: oklch(0.88 0.05 80); }
.rv-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: 4px; font-size: var(--t-sm); }
.rv-stale { color: var(--warn); font-size: var(--t-xs); }
.concerns { margin: 6px 0 0; padding-left: 20px; }
.reel-summary { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px var(--s4); white-space: pre-wrap; }
.reel-acc { margin-top: var(--s3); }
.reel-acc summary, .file summary { cursor: pointer; }
.file { border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 4px; background: var(--panel); overflow: hidden; }
.file summary { display: flex; gap: var(--s2); padding: 7px var(--s3); align-items: baseline; }
.file summary:hover { background: var(--panel-2); }
.file.flagged summary .fname { color: var(--warn); }
.fname { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--t-sm); }
.add { color: var(--ok); font-variant-numeric: tabular-nums; }
.del { color: var(--bad); font-variant-numeric: tabular-nums; }
.diff { margin: 0; padding: var(--s2) 0; overflow-x: auto; font: 12px/1.55 var(--mono); background: oklch(0.985 0.002 250); border-top: 1px solid var(--rule); }
.diff > * { padding: 0 var(--s3); }
.diff .add { color: oklch(0.38 0.1 155); background: oklch(0.95 0.045 155); display: inline-block; min-width: 100%; }
.diff .del { color: oklch(0.42 0.15 27); background: oklch(0.955 0.03 27); display: inline-block; min-width: 100%; }
.diff .hunk { color: var(--agent); }
.reel-actions {
  position: sticky; bottom: 0;
  display: flex; gap: var(--s2); justify-content: center;
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: linear-gradient(oklch(0.975 0.002 250 / 0), var(--bg) 40%);
}
.reel-actions button, .reel-actions .btn { min-height: 42px; padding: 8px 18px; font-size: var(--t-md); }
.reel-actions [data-feed="merge"] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); min-width: 120px; }
.reel-actions [data-feed="merge"]:hover:not([disabled]) { background: oklch(0.32 0.014 255); }
.reel-actions button[disabled] { opacity: .4; cursor: not-allowed; }
.reel-actions .armed { background: var(--signal) !important; border-color: var(--signal) !important; color: #fff !important; }

/* ---------- Narrow screens: the rail goes on top ---------- */
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .rail .brand { display: none; }
  .rail-project { flex: 1; min-width: 160px; }
  .tabs { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .tabs button { width: auto; flex-shrink: 0; }
  .tabs kbd, .tabs-sep, .duty { display: none; }
  .rail-foot { flex-direction: row; border-top: 0; padding-top: 0; }
  .topbar { padding: var(--s2) var(--s4); flex-wrap: wrap; }
  #view-sub { display: none; }
  #search { width: 100%; order: 3; }
  .view { padding: var(--s4); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .col { width: 80vw; }
  table.agents th:nth-child(n+6), table.agents td:nth-child(n+6) { display: none; }
  .pr-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .pr-row .pr-where, .pr-row .who { display: none; }
  .reel-title { font-size: 21px; }
  .reel-body, .feed-bar { padding-left: var(--s4); padding-right: var(--s4); }
  .feed-bar .keys { display: none; }
  .reel-actions { gap: 6px; padding-left: var(--s2); padding-right: var(--s2); }
  .reel-actions button, .reel-actions .btn { flex: 1; padding: 8px 6px; font-size: var(--t-sm); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* A class with display must not beat the hidden attribute. */
.badge[hidden], kbd[hidden] { display: none; }
#view-agents > h3.section:first-of-type { margin-top: 0; }
@media (max-width: 860px) {
  .tally { flex-wrap: wrap; }
  .tally b { font-size: 36px; }
  .tally .parts { margin-left: 0; width: 100%; flex-wrap: wrap; gap: var(--s3); }
  .approval-actions { flex-wrap: wrap; }
  .approval-actions input { flex-basis: 100%; }
  .topbar #search { margin-top: 2px; }
}

/* ---------- Home ---------- */
a.brand { color: var(--text); text-decoration: none; border-radius: var(--r-sm); padding: 6px 8px; margin: -4px -2px; transition: background-color var(--fast) var(--ease); }
a.brand:hover { background: oklch(0.925 0.004 250); }
body:has(#view-home:not([hidden])) a.brand { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); }
.home { max-width: 1100px; }
.home-date { font-size: var(--t-sm); margin-bottom: var(--s2); }
.home-tally { cursor: pointer; padding: var(--s4) var(--s5); margin: 0 0 var(--s2); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color var(--fast) var(--ease); }
.home-tally:hover, .home-tally:focus-visible { border-color: oklch(0.78 0.008 250); outline: none; }
.home-tally b { font-size: 56px; }
.home-go { margin-left: auto; font-weight: 600; }
.home h3 { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-md); font-weight: 650; margin: var(--s6) 0 var(--s2); }
.home h3 .muted { font-weight: 450; font-size: var(--t-sm); }
.home h3 .ghost.small, .small-link { margin-left: auto; }
.small-link { font-size: var(--t-sm); font-weight: 550; }
.proj-table { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.proj-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px 64px 64px 120px; align-items: center; gap: var(--s3);
  padding: 12px var(--s4); border-top: 1px solid var(--rule); cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}
.proj-row:first-child { border-top: 0; }
.proj-row:not(.head):hover, .proj-row:focus-visible { background: var(--panel-2); outline: none; }
.proj-row.head { cursor: default; background: var(--panel-2); padding-top: 8px; padding-bottom: 8px; font-size: var(--t-xs); font-weight: 550; color: var(--muted); }
.proj-row.head span:not(:first-child) { text-align: right; }
.proj-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-name b { font-weight: 650; font-size: 15px; }
.proj-ws { font-size: var(--t-sm); margin-left: 6px; }
.proj-num { text-align: right; font: 600 var(--t-lg)/1 var(--font); font-variant-numeric: tabular-nums; }
.proj-num.hot { color: var(--signal); }
.proj-num.zero { color: var(--faint); font-weight: 400; }
.proj-when { text-align: right; font-size: var(--t-sm); white-space: nowrap; }
.home-cols { margin-top: var(--s2); }
.now-row { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) auto; align-items: baseline; gap: var(--s2); padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.now-doing { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-seen { font-size: var(--t-xs); }
.home .event time { min-width: 72px; }
@media (max-width: 860px) {
  .proj-row { grid-template-columns: minmax(0, 1fr) 56px 56px; }
  .proj-row > :nth-child(n+4) { display: none; }
  .home-tally b { font-size: 40px; }
}

/* ---------- The field (Home) ---------- */
/* Home fills the window on black. The rail and the top bar step aside. */
body.field-mode { background: #07080a; }
body.field-mode .rail, body.field-mode .topbar { display: none; }
#view-home { position: fixed; inset: 0; z-index: 10; background: #07080a; color: #f2f3f5; overflow: hidden; padding: 0; margin: 0; }
.field-canvas { position: absolute; inset: 0; display: block; }
.field-hud { position: absolute; top: 18px; left: 22px; display: flex; align-items: center; gap: var(--s5); z-index: 2; }
.field-brand { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; font: 750 18px/1 var(--font); letter-spacing: -0.03em; color: #f2f3f5; padding: 6px 8px; margin: -6px -8px; border-radius: var(--r-sm); }
.field-brand .mark { background: #f2f3f5; }
.field-brand .mark::after { background: var(--signal); }
.field-brand:hover, .field-brand:focus-visible { background: rgba(255,255,255,0.07); }
.field-nav { display: flex; gap: 2px; }
.field-nav button { all: unset; cursor: pointer; font: 500 13px/1 var(--font); color: rgba(242,243,245,0.5); padding: 7px 9px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 6px; transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.field-nav button:hover, .field-nav button:focus-visible { color: #f2f3f5; background: rgba(255,255,255,0.07); }
.field-nav kbd { font: 500 10px/1 var(--mono); color: rgba(242,243,245,0.35); border: 1px solid rgba(255,255,255,0.14); border-radius: 3px; padding: 2px 4px; background: none; }
.field-you { all: unset; cursor: pointer; position: absolute; top: 14px; right: 26px; z-index: 2; display: flex; align-items: baseline; gap: 8px; padding: 4px 8px; border-radius: var(--r-md); }
.field-you b { font: 750 56px/1 var(--font); color: var(--signal); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.field-you span { font: 500 13px/1 var(--font); color: rgba(242,243,245,0.6); }
.field-you.zero b { color: rgba(242,243,245,0.3); }
.field-you:hover, .field-you:focus-visible { background: rgba(255,255,255,0.05); }
.field-ticker { position: absolute; top: 16px; right: 170px; z-index: 2; list-style: none; margin: 0; padding: 0; width: 440px; display: flex; flex-direction: column; gap: 5px; pointer-events: auto; }
.field-ticker li { font: 400 12px/1.35 var(--font); color: rgba(242,243,245,0.62); display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.field-ticker .t-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.field-ticker .t-who { font: 600 11.5px/1 var(--mono); }
.field-ticker .t-who.a { color: #5ccbdc; }
.field-ticker .t-who.p { color: #f2f3f5; }
.field-ticker .link { color: rgba(242,243,245,0.85); font: 500 11px/1 var(--mono); cursor: pointer; }
.field-ticker .link:hover { color: #fff; text-decoration: underline; }
.field-ticker time { font: 400 10.5px/1 var(--mono); color: rgba(242,243,245,0.32); order: 3; flex-shrink: 0; min-width: 34px; text-align: right; }
.field-ticker .link { flex-shrink: 0; }
.field-legend { position: absolute; left: 22px; top: 58px; z-index: 2; display: flex; gap: 14px; font: 400 11px/1 var(--font); color: rgba(242,243,245,0.4); pointer-events: none; }
.field-legend span { display: flex; align-items: center; gap: 5px; }
.field-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.field-legend .l-work { background: #fff; }
.field-legend .l-review { background: #e9ad3c; }
.field-legend .l-red { background: none; box-shadow: 0 0 0 1.5px #f0442f; }
.field-legend .l-todo { background: #5d6370; }
.field-legend .l-agent { background: #5ccbdc; border-radius: 1px; transform: rotate(45deg); }
.field-legend .l-done { background: #62d394; }
.field-tip { position: absolute; z-index: 3; max-width: 300px; pointer-events: none; background: #f2f3f5; color: #15171b; border-radius: var(--r-sm); padding: 7px 10px; font: 500 12.5px/1.35 var(--font); box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.field-tip b { font: 600 11.5px/1 var(--mono); margin-right: 4px; }
.field-tip span { display: block; margin-top: 3px; font-size: 11.5px; color: #5a606b; }
.field-tip em { font-style: normal; color: var(--signal); font-weight: 600; }
body.field-mode #drawer { z-index: 30; }
@media (max-width: 860px) {
  .field-nav, .field-legend, .field-ticker { display: none; }
  .field-you b { font-size: 40px; }
}

/* Log in with GitHub */
.login-or { display: flex; flex-direction: column; align-items: stretch; gap: var(--s3); margin-top: var(--s2); }
.login-or[hidden] { display: none; }
.login-or > span { display: flex; align-items: center; gap: var(--s3); color: var(--faint); font-size: var(--t-sm); }
.login-or > span::before, .login-or > span::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.github-login { display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel); color: var(--text); font-weight: 600; text-decoration: none; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.github-login:hover { background: var(--panel-2); border-color: oklch(0.8 0.006 250); }
.github-login:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
