@font-face { font-family: Geist; src: url("./assets/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Geist; src: url("./assets/geist-vietnamese.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  --bg: #f5f3ee; --surface: #fffefb; --sunk: #ebe8e0; --ink: #16171b; --muted: #5b5d68; --line: #dcd8cd; --line-soft: #e8e5dc;
  --accent: #4853c4; --accent-ink: #fff; --accent-soft: #e7e8f8;
  --ok: #1d7448; --ok-soft: #e0f0e6; --warn: #9a4d00; --warn-soft: #fbecd2; --bad: #b0281f; --bad-soft: #f9e3e0;
  --shadow: 0 1px 0 #16171b0a, 0 14px 36px -14px #16171b2e;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1); --spring: cubic-bezier(.3, 1.5, .5, 1);
  color-scheme: light;
}
:root[data-theme="dark"], .source-inspector {
  --bg: #0d0e12; --surface: #17181e; --sunk: #1f2128; --ink: #edebe5; --muted: #a2a4af; --line: #2d2f39; --line-soft: #23252d;
  --accent: #97a1ff; --accent-ink: #10111a; --accent-soft: #23264a;
  --ok: #7fd3a2; --ok-soft: #17301f; --warn: #efb563; --warn-soft: #37290f; --bad: #f29b94; --bad-soft: #3a1d1b;
  --shadow: 0 1px 0 #ffffff08, 0 18px 44px -14px #000c;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 66px; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 400 15px/1.5 Geist, system-ui, sans-serif;
  background: var(--bg);
  transition: background-color .25s, color .25s;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: .87em; }
pre { overflow: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
#main { padding-block: 22px 88px; outline: 0; overflow-wrap: anywhere; }
.skip, .visually-hidden { position: absolute; }
.skip { left: 12px; top: -70px; z-index: 60; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }
.visually-hidden { width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.muted, .field-hint, .eyebrow { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.success, .success-text { --tone: var(--ok); }
.warning, .warning-text { --tone: var(--warn); }
.danger, .danger-text { --tone: var(--bad); }
.accent { --tone: var(--accent); }
.chevron { color: var(--muted); transition: rotate .22s var(--ease); }
details[open] > summary > .chevron { rotate: 90deg; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* Header and controls */
.navbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 12px 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; flex: 0 1 auto; gap: 7px; min-width: 0; margin-right: 12px; text-decoration: none; font-weight: 600; letter-spacing: -.02em; }
.brand img { flex: none; border-radius: 6px; transition: transform .35s var(--spring); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.version { overflow: hidden; color: var(--muted); font: 12px var(--mono); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.navbar .grow { flex: 1; min-width: 0; }
.navbar .ref { min-width: 0; overflow: hidden; margin-left: 4px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.navbar .pager { display: inline-flex; align-items: center; flex: none; }
.pos { margin: 0 2px 0 10px; color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.navbar .button { min-height: 30px; padding: 0 10px; font-size: 13px; }
.button, .decision-actions button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; box-shadow: 0 1px 0 var(--line); transition: transform .15s var(--ease), background-color .15s, border-color .15s, box-shadow .2s;
}
.button:hover:not(:disabled), .decision-actions button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--muted); }
.button:active:not(:disabled), .decision-actions button:active:not(:disabled) { transform: translateY(1px) scale(.98); box-shadow: none; }
.button.primary, .decision-actions button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.button.quiet:hover:not(:disabled) { background: var(--sunk); border-color: transparent; color: var(--ink); transform: none; }
button:disabled { opacity: .63; cursor: not-allowed; }
.icon-button, .ibtn { position: relative; display: inline-grid; place-items: center; flex: none; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, transform .15s; }
.icon-button { width: 36px; height: 36px; border-radius: 9px; }
.ibtn { min-width: 32px; height: 32px; border-radius: 7px; }
.ibtn.txt { padding: 0 6px; font: 600 11.5px var(--mono); }
.icon-button:hover, .ibtn:hover { background: var(--sunk); color: var(--ink); }
.icon-button:active, .ibtn:active { transform: scale(.91); }
.ibtn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.count, .update-dot { position: absolute; background: var(--accent); color: var(--accent-ink); }
.count { top: 2px; right: 1px; min-width: 16px; height: 16px; border-radius: 8px; font: 600 10px/16px var(--mono); padding-inline: 3px; }
.update-dot { top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); border: 2px solid var(--bg); }
.source-view-controls { display: inline-flex; gap: 2px; padding: 3px; max-width: 100%; border-radius: 10px; background: var(--sunk); }
.source-view-controls button { min-width: 32px; min-height: 30px; padding: 3px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .18s, color .18s, box-shadow .18s; }
.source-view-controls button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0003; }
.filters button span { display: inline-block; margin-inline-start: 5px; font: 11px var(--mono); color: var(--muted); }
.search { min-height: 36px; width: 170px; max-width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }

/* Queue: one line per work */
.q { width: min(820px, 100%); margin-inline: auto; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.workspace-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 24px; }
.tabs button { padding: 6px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; }
.tabs button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.tabs button span { margin-inline-start: 6px; font: 500 12px var(--mono); opacity: .7; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li + li { border-top: 1px solid var(--line-soft); }
.rows li { animation: rise .3s var(--ease) both; }
.rows li:nth-child(2) { animation-delay: 30ms; }
.rows li:nth-child(3) { animation-delay: 60ms; }
.rows li:nth-child(4) { animation-delay: 90ms; }
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: center; min-height: 48px; margin-inline: -10px; padding-inline: 10px; border-radius: 8px; text-decoration: none; transition: background-color .12s; }
.row:is(:hover, :focus-visible) { background: var(--sunk); }
.row .mark { display: grid; place-items: center; color: var(--tone, var(--muted)); }
.row .t { overflow: hidden; font-size: 14.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.row .why { color: var(--warn); font-size: 12.5px; white-space: nowrap; }
.row .age { color: var(--muted); font: 12px var(--mono); text-align: right; white-space: nowrap; }
.list-count { margin-top: 14px; font-size: 13px; color: var(--muted); }
.empty { display: grid; justify-items: center; gap: 7px; padding: 34px 8px; text-align: center; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; }
.back { display: inline-flex; align-items: center; flex: none; gap: 3px; padding: 5px 8px 5px 4px; border-radius: 7px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.back:hover { background: var(--sunk); color: var(--ink); }
.back .icon { width: 16px; }
.version-details { max-width: 100%; }
.version-details summary, .raw-details summary, .technical-context summary, .more > summary { display: flex; align-items: center; gap: 5px; width: fit-content; min-height: 28px; color: var(--muted); list-style: none; font-size: 13px; }
.version-details summary:hover, .raw-details summary:hover, .technical-context summary:hover, .more > summary:hover { color: var(--ink); }
.version-details .icon, .raw-details .icon, .technical-context .icon, .more > summary .icon { width: 15px; height: 15px; }
.banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 7px 12px; padding: 7px 8px 7px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; background: var(--accent-soft); font-size: 14px; animation: drop .35s var(--spring) both; }
.banner > span { display: inline-flex; align-items: center; gap: 8px; }
.error, .warning { padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); }
p.warning, .error { margin-bottom: 10px; }
.error p, .error .button { margin-top: 8px; }

/* Review: criteria left, evidence right, decision docked */
#main.review-main { padding: 0; }
.review { display: grid; grid-template: "note note" auto "list detail" minmax(0, 1fr) "dock dock" auto / minmax(320px, 430px) minmax(0, 1fr); height: calc(100dvh - 48px); min-height: 520px; background: var(--bg); }
.review > #delivery-notice { grid-area: note; }
.review > #delivery-notice:not(:empty) { padding: 8px 14px 0; }
.list { grid-area: list; min-width: 0; padding: 22px 12px 20px 18px; border-right: 1px solid var(--line-soft); overflow: auto; }
.list h1 { margin: 0 6px 9px; width: fit-content; max-width: 100%; font-size: 20px; line-height: 1.25; text-wrap: balance; }
.sum { display: flex; align-items: center; gap: 8px; margin: 0 6px; font-size: 14px; font-weight: 500; color: var(--tone, var(--ink)); }
.sum.gap, .meta .warning { --tone: var(--warn); }
.sum.bad { --tone: var(--bad); }
.sum.ok { --tone: var(--ok); }
.sum.none { --tone: var(--muted); }
.meta { display: flex; align-items: center; gap: 6px; margin: 5px 6px 0; color: var(--muted); font-size: 12.5px; }
.meta .icon { width: 13px; height: 13px; }
.list > p.warning { margin: 10px 6px 0; padding: 6px 10px; border: 1px dashed var(--line); background: none; color: var(--muted); font-size: 13px; }
#crit-list { margin-top: 14px; }
.crit-list { margin: 0; padding: 0; list-style: none; }
.crit { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 7px 8px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; transition: background-color .12s; }
.crit:hover { background: var(--sunk); }
.crit.sel { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.crit > code { color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.crit.gap > code, .crit.gap .res { color: var(--warn); }
.crit.bad > code, .crit.bad .res { color: var(--bad); }
.crit .tx { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.crit .lad { grid-column: 2; display: flex; align-items: center; gap: 12px; min-width: 0; }
.crit .res { color: var(--muted); font-size: 12px; font-weight: 500; }
.crit .names { grid-column: 2; display: flex; justify-content: space-between; width: 148px; margin-top: -3px; padding: 0 5px; color: var(--muted); font-size: 10.5px; }
.crit .names span { display: flex; justify-content: center; width: 0; white-space: nowrap; }
.ladder { display: flex; align-items: center; width: 148px; height: 14px; flex: none; }
.ladder .n { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.ladder .n.ok { background: var(--ok); }
.ladder .n.bad { background: var(--bad); }
.ladder .n.none { background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 55%, transparent); }
.ladder .n.gap { background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--warn); }
.ladder .l { flex: 1; height: 0; margin: 0 3px; border-top: 1.5px solid var(--muted); transform-origin: left; }
.ladder .l.ok { border-color: var(--ok); }
.ladder .l.bad { border-color: var(--bad); }
.ladder .l.none { border-top: 1.5px dotted color-mix(in srgb, var(--muted) 55%, transparent); }
.ladder .l.gap { border-top: 1.5px dashed var(--warn); }
.enter .ladder .n { animation: pop .42s var(--spring) both; }
.enter .ladder .n:nth-child(3) { animation-delay: .12s; }
.enter .ladder .n:nth-child(5) { animation-delay: .24s; }
.enter .ladder .n:nth-child(7) { animation-delay: .36s; }
.enter .ladder .l { animation: grow .18s var(--ease) .06s both; }
.enter .ladder .l:nth-child(4) { animation-delay: .18s; }
.enter .ladder .l:nth-child(6) { animation-delay: .3s; }
.more { margin: 14px 6px 0; }
.more > :is(details, p) { margin-top: 8px; }
.more .evidence-disclosure { margin-top: 6px; }
.detail { grid-area: detail; min-width: 0; padding: 24px clamp(18px, 3.4vw, 44px) 30px; overflow: auto; }
.evidence { max-width: 820px; animation: fade .18s var(--ease) both; }
.evidence > .id { color: var(--muted); font-size: 12px; }
.evidence > h2 { max-width: 58ch; margin: 6px 0 18px; font-size: 19px; font-weight: 500; line-height: 1.4; letter-spacing: -.012em; text-wrap: pretty; }
.gaps { margin-bottom: 14px; padding: 9px 12px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.gaps h3 { margin-bottom: 4px; font-size: 13px; }
.gaps ul { margin: 0; padding-inline-start: 18px; }
.rr { margin: 0; border-top: 1px solid var(--line); }
.rr > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rr dt { color: var(--muted); font-size: 12.5px; }
.rr dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; margin: 0; font-size: 14px; }
.rr dd .icon { align-self: center; width: 15px; height: 15px; color: var(--muted); }
.rr dd span { color: var(--muted); font-size: 13px; }
.rr q { font-style: italic; white-space: pre-wrap; }
.rr .ok .icon { color: var(--ok); }
.rr .gap :is(.icon, span, code) { color: var(--warn); }
.rr .bad :is(.icon, span, code) { color: var(--bad); }
.rr .none dd { color: var(--muted); }
.source-reference { margin-top: 16px; }
.source-reference > h3 { margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.evidence .raw-details { margin-top: 12px; }
.dock { grid-area: dock; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
/* Keep the decision buttons still between pointer down and up when the note loses focus. */
.dock textarea { height: 64px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); line-height: 1.45; resize: none; }
.dock textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.dock textarea[aria-invalid="true"] { border-color: var(--warn); }
.dock .hint { grid-column: 1 / -1; margin: 0; color: var(--warn); font-size: 12.5px; }
.dock .hint:empty { display: none; }
.dock.done { grid-template-columns: auto minmax(0, 1fr); align-items: center; font-size: 14px; animation: rise .3s var(--ease) both; }
.dock.done .icon { color: var(--muted); }
.dock.done q { display: block; max-block-size: min(8rem, 24dvh); overflow: auto; overflow-wrap: anywhere; color: var(--muted); white-space: pre-wrap; }

.evidence-disclosure, .evidence-check, .evidence-change { margin-top: 8px; padding: 0 13px; border: 1px dashed var(--line); border-radius: 13px; }
.evidence-disclosure > summary, .evidence-check > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; min-height: 41px; padding-block: 6px; list-style: none; font-size: 14px; font-weight: 500; }
.evidence-disclosure[open], .evidence-check[open] { padding-bottom: 10px; }
.evidence-disclosure :is(p, blockquote, ul), .evidence-check :is(p, ul), .evidence-change { margin-block: 6px; }
.evidence-check, .evidence-change { border-style: solid; }
.evidence-change { padding-block: 9px; }
.evidence-change > .kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; padding-block: 0; }
.evidence-change > .kv > div { display: block; }
.evidence-text, .recorded-note { white-space: pre-wrap; }
.recorded-note { padding-inline-start: 10px; border-inline-start: 2px solid var(--line); }
.raw-details pre, .version-details pre, .evidence-check pre { margin: 4px 0; max-height: 240px; padding: 10px 12px; border-radius: 8px; background: var(--sunk); font-size: 12px; }

.source-inspector { min-width: 0; margin-right: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); box-shadow: 5px 5px 0 -1px var(--sunk); }
.source-location, .source-view-toolbar, .source-version { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.source-location { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.source-location code { color: var(--ink); }
.source-view-toolbar { justify-content: space-between; padding: 5px 8px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.source-view-controls { padding: 2px; }
.source-view-controls button { min-height: 26px; color: var(--muted); }
.source-version { color: var(--muted); }
.source-version details[open] { flex-basis: 100%; }
.source-version summary { list-style: none; text-decoration: underline; text-underline-offset: 3px; padding: 3px 4px; }
.source-code { max-height: 320px; overflow: auto; padding-block: 4px; animation: reveal-source .18s var(--ease) both; }
.source-line, .diff-line { display: grid; grid-template-columns: 44px minmax(0, 1fr); width: max-content; min-width: 100%; font: 12.5px/1.7 var(--mono); }
.source-line code, .diff-line code { padding-inline: 10px; font: inherit; white-space: pre; }
.line-number, .diff-gutter { padding-inline: 5px; border-right: 1px solid var(--line-soft); color: var(--muted); text-align: right; user-select: none; }
.source-line.cited { background: var(--accent-soft); }
.source-line.cited .line-number { color: var(--accent); box-shadow: inset 2px 0 var(--accent); }
.diff-line.added { color: var(--ok); background: var(--ok-soft); }
.diff-line.removed { color: var(--bad); background: var(--bad-soft); }
.diff-line.hunk { color: var(--muted); background: var(--surface); }
.source-checkout-note, .source-truncated { padding: 5px 10px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; }
.source-unavailable, .source-loading { padding: 9px 10px; color: var(--muted); }

/* Approved documents */
.scope-reader { display: grid; gap: 16px; }
.eyebrow { margin-bottom: 5px; font: 500 11px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.document-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.document-list button { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 0 7px; min-height: 44px; padding: 6px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; transition: transform .2s var(--ease), background-color .15s; }
.document-list button:hover { transform: translateX(2px); color: var(--ink); }
.document-list button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: inset 3px 0 var(--accent); }
.document-list small { grid-column: 2; }
.context-reader { min-width: 0; }
.document-meta, .document-meta > div { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px 9px; font-size: 13px; color: var(--muted); }
.document-meta { padding: 0 0 8px; border-bottom: 1px solid var(--line-soft); }
.markdown-body, .context-raw { animation: rise .25s var(--ease) both; }
.markdown-body { padding: 14px 0; max-width: 75ch; font-size: 15px; line-height: 1.65; }
.markdown-body > * + * { margin-top: 10px; }
.markdown-body h1 { font-size: 22px; }
.markdown-body h2 { margin-top: 18px; font-size: 17px; }
.markdown-body ul, .markdown-body ol { padding-inline-start: 22px; margin-bottom: 0; }
.markdown-body code { padding: 1px 4px; border-radius: 4px; background: var(--sunk); }
.markdown-body pre { background: var(--sunk); padding: 10px 12px; border-radius: 9px; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body a { color: var(--accent); }
.markdown-body blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--accent); color: var(--muted); }
.markdown-body table { display: block; overflow: auto; border-collapse: collapse; font-size: 14px; }
.markdown-body th, .markdown-body td { padding: 5px 9px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.context-raw { margin: 0; padding: 14px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.technical-context { margin: 0 0 16px; }
.technical-context summary span { color: var(--muted); }
.technical-context > code { color: var(--muted); }
.field-hint { margin-block: 4px; font-size: 13px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.recorded-note { margin: 0; }
.kv { margin-block: 8px; font-size: 13px; }
.kv > div { display: grid; grid-template-columns: minmax(0, 155px) minmax(0, 1fr); gap: 4px 10px; margin-bottom: 4px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Local tools and confirmation */
dialog { width: min(520px, calc(100% - 26px)); max-height: calc(100dvh - 32px); padding: 0 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px #0009, 8px 8px 0 -1px var(--sunk); overflow: auto; overflow-wrap: anywhere; }
dialog[open] { animation: dialog-in .28s var(--spring) both; }
dialog::backdrop { background: #0b0c1070; backdrop-filter: blur(3px); }
dialog > header, dialog > header h2 { display: flex; align-items: center; gap: 8px; }
dialog > header { justify-content: space-between; padding: 7px 9px 6px 15px; border-bottom: 1px solid var(--line-soft); }
dialog > :not(header) { margin-inline: 15px; }
dialog > :is(p, ul) { margin-block: 8px; }
dialog > ul { padding-inline-start: 18px; }
dialog > .decision-actions { justify-content: flex-end; margin-top: 10px; }
#confirm-status { min-height: 1.5em; margin-block: 8px 0; text-align: end; }
.dialog-error { margin-top: 6px; color: var(--bad); font-size: 13px; }
.dialog-error:empty { display: none; }
.settings-body { padding-top: 4px; }
.settings-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px 9px; align-items: start; padding-block: 10px; border-bottom: 1px solid var(--line-soft); }
.settings-row:last-child { border: 0; padding-bottom: 1px; }
.settings-row > .icon { margin-top: 1px; color: var(--muted); }
.settings-row > .button, .settings-actions { align-self: center; }
.settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.settings-row p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; margin-block: 6px; }
.file-list code { grid-column: 1; grid-row: 2; }
.attention-dialog { position: fixed; inset: 52px 12px auto auto; width: min(340px, calc(100% - 26px)); max-height: calc(100dvh - 120px); margin: 0; animation-name: drop; }
.attention-dialog::backdrop { background: transparent; backdrop-filter: none; }
dialog.drawer { width: min(480px, 100%); max-width: calc(100% - 34px); height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; border-width: 0 0 0 1px; border-radius: 0; box-shadow: -24px 0 60px -28px #0009; overflow: hidden; }
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawer .26s var(--ease) both; }
.drawer > .drawer-body { flex: 1; min-height: 0; margin: 0; padding: 14px 18px 24px; overflow: auto; }
#attention-content { margin-top: 6px; }
.notice-item { display: grid; min-height: 44px; align-content: center; gap: 1px; padding: 5px 7px; border-radius: 8px; text-decoration: none; }
.notice-item:hover { background: var(--sunk); }
.notice-item small { color: var(--muted); font-size: 12.5px; }
#notice { display: none; position: fixed; z-index: 30; left: 50%; bottom: 24px; translate: -50%; width: max-content; max-width: calc(100% - 24px); padding: 8px 13px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px; animation: rise .26s var(--spring) both; }
#notice .icon { margin-inline-end: 7px; vertical-align: -4px; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: .2; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes reveal-source { from { opacity: .3; } }
@keyframes drop { from { opacity: 0; transform: translateY(-9px); } }
@keyframes drawer { from { opacity: 0; transform: translateX(40px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(13px) scale(.95); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: var(--ease); }
@media (max-width: 760px) {
  .review { grid-template: "note" auto "list" auto "detail" auto "dock" auto / minmax(0, 1fr); height: auto; min-height: 0; }
  .navbar:not(:has(.workspace-name)) .wordmark, .navbar .pager { display: none; }
  .navbar .wordmark { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .navbar { padding-inline: 12px; }
  .brand { margin-right: 2px; }
  .list { border-right: 0; overflow: visible; }
  .detail { border-top: 1px solid var(--line-soft); overflow: visible; }
  .dock { position: sticky; bottom: 0; z-index: 5; }
  .evidence-change > .kv { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .queue-head { gap: 10px; }
  .queue-head .search { flex: 1 1 135px; }
}
@media (max-width: 560px) {
  .navbar .version, .navbar .workspace-name { display: none; }
  .navbar .scope-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .row .why { grid-area: 2 / 2 / 3 / 4; }
  .dock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dock textarea { grid-column: 1 / -1; }
  .dock.done { grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 28px); }
  .navbar { gap: 0; }
  .brand { gap: 4px; }
  .brand img { width: 24px; height: 24px; }
  .version { font-size: 11px; }
  .tabs { gap: 14px; }
  .settings-row { grid-template-columns: 18px minmax(0, 1fr); }
  .settings-row > .button, .settings-actions { grid-column: 2; justify-self: start; }
  .kv > div { grid-template-columns: minmax(0, 110px) minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .button, .icon-button, .decision-actions button, .source-view-controls button, .tabs button, .back, summary, .ibtn { min-height: 44px; }
  .icon-button, .ibtn { min-width: 44px; }
  .navbar .button { min-height: 44px; }
  .search { min-height: 44px; font-size: 16px; }
  .dock textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .row:hover, .button:hover, .brand:hover img, .back:hover .icon { transform: none !important; }
}
