/* Ported from owainlewis/machinist@3943516 internal/controlplane/web/src/styles.css:1-112 (MIT, Copyright (c) 2026 Owain Lewis). Deviations: plain CSS, no Tailwind; the look is kaas.team's product UI (kaas-tasks' app shell: sidebar on the page, an inset panel with a breadcrumb, Up next rows, Activity) on tokens.css, a copy of kaas.team's :root block; ink is working, and green, red and yellow mean pass, fail and waiting on you; the factory layout (the Line, inbox, run page) is our own. Geist is SIL OFL 1.1 (fonts/LICENSE-geist.txt). */

@font-face { font-family: Geist; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

* { box-sizing: border-box; margin: 0; }
html { background: var(--page); }
body {
  min-width: 320px; min-height: 100vh;
  background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
input[type="checkbox"] { accent-color: var(--ink); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* The shell: kaas-tasks' sidebar on the grey page, the view in an inset white panel */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }
.app-sidebar { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 12px 10px 10px; overflow-y: auto; }
.ws { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px; margin-bottom: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ws-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); }
.ws-mark svg { width: 14px; height: 14px; fill: none; stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; }
.ws .ws-sub { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.app-sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font-size: 14px; color: var(--ink); text-decoration: none; text-align: left; }
.nav-item:hover { background: var(--track); }
.nav-item[aria-current="page"], .nav-item[aria-pressed="true"] { background: var(--surface); font-weight: 500; box-shadow: var(--lift); }
.nav-item svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item[aria-current="page"] svg { stroke: var(--ink); }
.nav-item .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 600; }
.count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.nav-heading { padding: 18px 8px 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.nav-spacer { flex: 1; min-height: 18px; }
.sidebar-foot { display: grid; gap: 8px; margin-top: 8px; padding: 12px 8px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.toggle { display: flex; align-items: flex-start; gap: 8px; }
.toggle input { margin-top: 2px; }

.frame { display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 8px 8px 8px 0; background: var(--surface); border-radius: 12px; box-shadow: var(--ring); overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 8px; flex: none; height: 48px; padding: 0 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--ink); }
.topbar .here { font-weight: 500; }
.topbar svg { width: 14px; height: 14px; fill: none; stroke: var(--quiet); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
main { flex: 1; min-width: 0; overflow-y: auto; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 40px 56px; }
main[data-view="task"] .page, main[data-view="inbox"] .page { max-width: 1320px; padding-top: 24px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.02em; }
.hero h1 { font-size: 30px; line-height: 36px; letter-spacing: -.025em; }
.date { margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
h2 { font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 10px; }
h3 { font-size: 13.5px; font-weight: 600; }
.lede { margin-top: 2px; color: var(--muted); font-size: 13.5px; max-width: 72ch; }
.notice { margin: -8px 0 20px; padding: 8px 12px; border-radius: 7px; background: var(--surface); box-shadow: var(--lift); font-size: 13px; max-width: 72ch; }
.relay-form { display: grid; gap: 6px; max-width: 420px; }
.relay-form .btn { justify-self: start; margin-top: 4px; }
.muted { color: var(--muted); }
.plain-list { padding: 0; list-style: none; }
.plain-list li { color: var(--muted); }
.error { color: var(--fail); }

/* Controls: kaas.team buttons, fields and the segmented filter */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); box-shadow: var(--shadow); white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-danger { color: var(--fail); }
.field-control { width: 100%; min-height: 32px; border: 0; border-radius: 7px; padding: 6px 10px; background: var(--surface); box-shadow: var(--lift); font-size: 13.5px; }
textarea.field-control { resize: vertical; min-height: 84px; padding: 8px 10px; }
.tabs { display: inline-flex; padding: 3px; margin-bottom: 16px; border-radius: 9px; background: var(--grey-bg); }
.tab { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tab[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--lift); }

/* Status glyphs, as on kaas-tasks rows: a ring while queued, half while working, a filled disc once it means something */
.glyph { width: 16px; height: 16px; flex: none; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glyph .ring { stroke: var(--quiet); }
.glyph[data-s="live"] .ring { stroke: var(--ink); }
.glyph .fill { fill: var(--ink); stroke: none; }
.glyph .disc { stroke: none; fill: var(--quiet); }
.glyph .mark { stroke: var(--surface); stroke-width: 1.8; }
.glyph[data-s="shipped"] .disc { fill: var(--pass); }
.glyph[data-s="failed"] .disc { fill: var(--fail); }
.glyph[data-s="waiting"] .disc { fill: var(--wait); }
.glyph[data-s="waiting"] .mark { stroke: var(--ink); }
.glyph[data-s="quiet"] .mark { stroke: var(--quiet); }

/* Section heads: kaas-tasks' "Up next 3 assigned to you ... View all" */
.section-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; }
.section-head .muted { font-size: 13px; }
.section-head .end { margin-left: auto; font-size: 13px; color: var(--ink); text-decoration: none; }
.section-head .end:hover { text-decoration: underline; text-underline-offset: 3px; }
.section + .section { margin-top: 36px; }

/* Line home: the issues on the left, what just happened on the right */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.line { display: grid; }
.line-row { display: grid; grid-template-columns: 16px 44px minmax(0, 1fr) 7.5rem 9.5rem 3.5rem 4.5rem; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.line-row:hover { background: var(--panel); }
.line[data-multi="false"] .line-row { grid-template-columns: 16px 44px minmax(0, 1fr) 9.5rem 3.5rem 4.5rem; }
.line[data-multi="false"] .line-repo { display: none; }
.line-id { color: var(--muted); font-size: 13px; }
.line-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-repo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.line-cost { text-align: right; color: var(--muted); font-size: 13px; }
.line-state { text-align: right; white-space: nowrap; font-size: 13px; color: var(--muted); }
.line-state[data-needs="true"] { justify-self: end; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--wait-bg); color: var(--wait-ink); font-size: 12px; font-weight: 500; }

/* The stage strip: five stages sized by how long each took; the one loud thing on the page */
.stations { display: flex; align-items: center; gap: 2px; min-width: 0; }
.station { position: relative; height: 6px; min-width: 6px; flex: 1 1 0; border-radius: 3px; background: var(--track); }
.station[data-done="true"] { background: var(--ink); }
.station[data-live="true"] { background: var(--ink); animation: working 1.6s var(--ease) infinite alternate; }
.station[data-waiting="true"] { background: var(--wait); }
.station[data-failed="true"] { background: var(--fail); }
@keyframes working { from { opacity: 1; } to { opacity: .35; } }
.station-names { display: flex; gap: 2px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.station-names span { flex: 1 1 0; min-width: 6px; overflow: hidden; }

.repo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 12px; margin-top: 14px; }
.repo-card { display: grid; gap: 10px; padding: 14px 16px; border: 0; border-radius: 10px; background: var(--surface); box-shadow: var(--lift); text-align: left; }
.repo-card:hover { box-shadow: var(--ring), var(--shadow); }
.repo-card[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--ink); }
.repo-card .top { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.repo-card svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.repo-card .top .muted { margin-left: auto; font-size: 12.5px; font-weight: 400; }
.repo-card .bar-track { height: 4px; }
.repo-card .sub { color: var(--muted); font-size: 12.5px; }

.activity { padding: 0; list-style: none; }
.activity li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; }
.activity li + li { border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); box-shadow: var(--ring); font-size: 10.5px; font-weight: 600; }
.avatar[data-bot="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
.activity .what { font-size: 13.5px; }
.activity .what strong { font-weight: 500; }
.activity .quote { margin: 6px 0 2px; padding: 6px 10px; border-radius: 6px; background: var(--panel); font-size: 13px; overflow-wrap: anywhere; }
.activity .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inbox: kaas-tasks' list beside the item */
.split { display: grid; grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); gap: 24px; align-items: start; }
.list { display: grid; gap: 2px; }
.list-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: none; text-align: left; }
.list-item .glyph { margin-top: 2px; }
.list-item:hover { background: var(--panel); }
.list-item[aria-current="true"] { background: var(--surface); box-shadow: var(--lift); }
.li-main { display: grid; gap: 2px; min-width: 0; }
.li-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { color: var(--ink); font-size: 13px; }
.li-ask { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.empty-detail { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 22rem; border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 13.5px; }
.empty-detail svg { width: 28px; height: 28px; fill: none; stroke: var(--quiet); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.panel { background: var(--surface); border-radius: 12px; box-shadow: var(--lift); }
.panel-pad { padding: 16px 18px; }
.panel > .panel-pad + .panel-pad, .panel > .panel-pad + .thread { border-top: 1px solid var(--line); }
.thread { display: grid; gap: 12px; padding: 16px 18px; max-height: 32rem; overflow: auto; background: var(--panel); border-top: 1px solid var(--line); }
.msg { max-width: 80ch; padding: 12px 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--ring); overflow-wrap: anywhere; }
.msg header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.msg header .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.composer { display: grid; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: none; }

/* A rendered GitHub comment reads like the issue page, not like source (kaas-suite .md) */
.md { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; }
.md h2, .md h3 { font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.md h4, .md h5, .md h6 { font-size: 13.5px; font-weight: 600; margin: 4px 0 0; color: var(--muted); }
.md ul, .md ol { padding-left: 20px; display: grid; gap: 4px; }
.md li ul, .md li ol { margin-top: 4px; }
.md li:has(> input[type="checkbox"]) { list-style: none; margin-left: -20px; }
.md blockquote { padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); }
.md pre { padding: 10px 12px; border-radius: 8px; background: var(--panel); box-shadow: var(--ring); overflow-x: auto; }
.md pre code { padding: 0; background: none; box-shadow: none; white-space: pre; }
.md hr { border: 0; border-top: 1px solid var(--line); }
.md table { font-size: 13px; }
code { font-size: 12.5px; padding: 1px 4px; border-radius: 4px; background: var(--panel); box-shadow: var(--ring); overflow-wrap: anywhere; }

/* Workflows and Settings */
.harness { margin-bottom: 24px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; }
.section-gap { margin-top: 32px; }

/* Tables: kaas.team HeroBoard rows */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 18px; }
th { padding: 8px 16px 8px 0; font-size: 12.5px; font-weight: 400; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; padding-right: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: var(--panel); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); }
.status[data-tone="ok"] { color: var(--pass); }
.status[data-tone="ok"]::before { background: var(--pass); }
.status[data-tone="warn"] { color: var(--wait-ink); }
.status[data-tone="warn"]::before { background: var(--wait); }
.status[data-tone="bad"] { color: var(--fail); }
.status[data-tone="bad"]::before { background: var(--fail); }
.status[data-tone="live"]::before { background: var(--ink); }

/* Analytics */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 32px; border-radius: 12px; box-shadow: var(--lift); }
.kpi { padding: 18px 20px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .value { display: block; font-size: 28px; line-height: 34px; font-weight: 500; letter-spacing: -.02em; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.bars { display: grid; gap: 10px; margin-bottom: 32px; }
.bar { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 13rem; align-items: center; gap: 12px; }
.bar-track { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--ink); }
.bar-note { text-align: right; color: var(--muted); font-size: 12px; }

/* One run: the agent's feed beside the proof */
.run-page .page-heading { margin-bottom: 16px; }
.run-page .page-heading .status { white-space: nowrap; }
.run-stations { margin-bottom: 22px; }
.run-stations .station { height: 8px; border-radius: 4px; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); gap: 24px; align-items: start; }
.feed-panel h2 { margin: 0; border-bottom: 1px solid var(--line); }
.feed { display: grid; gap: 8px; align-content: start; height: calc(100vh - 20rem); min-height: 22rem; overflow: auto; padding: 14px 18px; scroll-behavior: smooth; }
.card { max-width: 52rem; overflow-wrap: anywhere; }
.card[data-nested="true"] { margin-left: 20px; }
.card.stage { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 600; }
.card.stage::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.card.stage:first-child { margin-top: 0; }
.card.exit { font-weight: 500; }
.card.say { color: var(--ink); }
.card.say .md { gap: 6px; }
.card.tool { display: grid; gap: 6px; padding-left: 16px; position: relative; color: var(--muted); }
.card.tool::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); }
.card.tool[data-tool="Write"]::before, .card.tool[data-tool="Edit"]::before, .card.tool[data-tool="MultiEdit"]::before, .card.tool[data-tool="Bash"]::before { background: var(--ink); }
.card pre, .card-diff { padding: 8px 10px; border-radius: 8px; background: var(--panel); box-shadow: var(--ring); color: var(--ink); font-size: 12.5px; line-height: 18px; overflow-x: auto; display: grid; }
.card.result { margin-left: 16px; display: grid; gap: 6px; }
.result-head { font-weight: 500; }
details.card.result summary { cursor: pointer; color: var(--muted); font-weight: 400; font-size: 12.5px; }
details.card.result[open] summary { margin-bottom: 6px; }
[data-tone="pass"] > .result-head, p[data-tone="pass"], .card.exit[data-tone="pass"], .criteria li[data-tone="pass"] .mark { color: var(--pass); }
[data-tone="fail"] > .result-head, p[data-tone="fail"], .card.exit[data-tone="fail"], .criteria li[data-tone="fail"] .mark { color: var(--fail); }
.card pre span[data-tone="fail"], .card pre span[data-tone="pass"] { font-weight: 500; }
.card pre span[data-tone="fail"] { color: var(--fail); }
.card pre span[data-tone="pass"] { color: var(--pass); }
.card pre span[data-tone="plain"] { color: var(--muted); }
.diff-del { color: var(--fail); background: var(--fail-bg); }
.diff-add { color: var(--pass); background: var(--pass-bg); }
.diff-hunk { color: var(--muted); }
pre.log.diff span { display: block; }
.proof-col { position: sticky; top: 0; }
.proof { display: grid; gap: 16px; }
.proof-part + .proof-part { padding-top: 14px; border-top: 1px solid var(--line); }
.proof-part h3 { margin-bottom: 8px; }
.proof-part h4 { margin: 10px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.proof-part p { margin-bottom: 4px; }
.criteria { padding: 0; list-style: none; display: grid; gap: 10px; }
.criteria li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
.criteria .mark { font-weight: 600; color: var(--muted); }
.criteria .muted { font-size: 12.5px; }
.failed-tests, .findings { margin-top: 4px; padding-left: 18px; display: grid; gap: 3px; }
.failed-tests li { color: var(--fail); }
.pr-link { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pr-link a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 7px; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 500; text-decoration: none; }
.run-files { margin-top: 24px; }
.run-files summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 8px 12px; margin: 12px 0 24px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
pre.log { max-height: 22rem; overflow: auto; padding: 10px 12px; background: var(--panel); color: var(--ink); border-radius: 8px; box-shadow: var(--ring); font-size: 12.5px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.review .kv { margin: 8px 0 14px; }

/* Empty, loading and error states: a quiet panel with one line of direction */
.quiet-state { display: grid; justify-items: start; gap: 4px; padding: 24px; border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 13.5px; }
.quiet-state strong { color: var(--ink); font-weight: 500; font-size: 14px; }
.quiet-state-mark { display: none; }
.login { max-width: 22rem; margin: 6rem auto; display: grid; gap: 10px; padding: 0 16px; }

/* P7: the cockpit pieces. Same tokens as kaas.team; the run page reads like a chat with tool calls. */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 500; box-shadow: var(--lift); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--lift); }
.inbox-row { display: grid; gap: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px 40px; }
.btn.chip { height: 30px; border-radius: 15px; }
.rail-task { display: grid; gap: 2px; padding: 6px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
.rail-task:hover { background: var(--panel); }
.rail-task .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-meta { display: flex; gap: 8px; color: var(--muted); font-size: 11.5px; }
.rail-list { display: grid; gap: 1px; margin-bottom: 8px; }
.new-task { display: grid; gap: 10px; margin-bottom: 24px; }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pick { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 13px; }
.composer-status { margin: 0; color: var(--muted); font-size: 12.5px; }
.run-pane { position: sticky; top: 16px; display: grid; gap: 0; }
.pane-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 6px; border-bottom: 1px solid var(--line); }
.pane-tab { height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.pane-tab[aria-selected="true"] { color: var(--ink); background: var(--panel); }
.pane-body { padding: 14px 18px; display: grid; gap: 12px; }
.gwt { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.gwt dt { color: var(--muted); font-weight: 600; }
.gwt dd { margin: 0; }
.outcome { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.outcome li + li { border-top: 1px solid var(--line); padding-top: 12px; }
.outcome .status { margin-bottom: 6px; }
.diff-stat { display: flex; gap: 12px; font-variant-numeric: tabular-nums; }
.diff-stat [data-tone="pass"] { color: var(--pass); }
.diff-stat [data-tone="fail"] { color: var(--fail); }
.pane-diff { display: grid; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.diff-line { display: block; width: 100%; padding: 1px 8px; border: 0; background: none; color: var(--ink); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.diff-line[data-sign="add"] { background: var(--pass-bg); }
.diff-line[data-sign="del"] { background: var(--fail-bg); }
.diff-line:hover { box-shadow: inset 2px 0 0 var(--ink); }
.signals { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.fold { border-radius: 9px; }
.fold > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s var(--ease); }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold > summary:hover { background: var(--panel); color: var(--ink); }
.fold > :not(summary) { margin-left: 18px; }
.plan-card { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.plan-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-composer { display: grid; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.queued { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--wait-bg); color: var(--wait-ink); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 12px; }
.board-col { display: grid; align-content: start; gap: 8px; padding: 10px; border-radius: 12px; background: var(--grey-bg); }
.board-col h2 { display: flex; align-items: center; margin: 0 0 4px; font-size: 13px; }
.board-card { display: block; padding: 10px 12px; border-radius: 9px; background: var(--surface); box-shadow: var(--lift); color: var(--ink); text-decoration: none; font-size: 13px; }
.workflows { display: grid; gap: 16px; }
.workflow { display: grid; gap: 12px; }
.flow { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.flow li::marker { color: var(--muted); font-weight: 600; }
.flow li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tech > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.switches { display: grid; gap: 14px; }
.switch-row span { display: grid; gap: 2px; }
.settings-panel { min-height: 8rem; }

@media (max-width: 1180px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .line[data-multi] .line-row { grid-template-columns: 16px 44px minmax(0, 1fr) 9rem 4.5rem; }
  .line-repo, .line-cost { display: none; }
}

@media (max-width: 1023px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split[data-open="true"] .list-col { display: none; }
  .split[data-open="false"] .detail-col { display: none; }
  .run-grid { grid-template-columns: minmax(0, 1fr); }
  .proof-col { position: static; }
  .feed { height: auto; max-height: 70vh; }
  .back { display: inline-flex; margin-bottom: 10px; }
}

@media (max-width: 767px) {
  .app { display: block; height: auto; }
  .ws, .nav-heading, .repo-item, .nav-spacer, .sidebar-foot { display: none; }
  body { padding-bottom: calc(4.15rem + env(safe-area-inset-bottom)); }
  .app-sidebar { padding: 0; overflow: visible; }
  .app-sidebar nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(3.4rem, 1fr); gap: 0; overflow-x: auto; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
  .app-sidebar nav .nav-item { height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; font-size: 10px; text-align: center; }
  .app-sidebar nav .nav-item[aria-current="page"] { box-shadow: none; background: var(--panel); }
  .app-sidebar nav .nav-item .badge { position: absolute; top: 2px; right: 18%; margin: 0; }
  .frame { margin: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .topbar { padding: 0 16px; }
  main { overflow: visible; }
  .page, main[data-view] .page { padding: 20px 16px 32px; }
  .hero h1 { font-size: 26px; line-height: 32px; }
  .line[data-multi] .line-row { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 6px 10px; }
  .line-id { display: none; }
  .section-head .muted { display: none; }
  .line-row .stations-col { grid-column: 2 / -1; grid-row: 2; }
  .bar { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .bar-note { grid-column: 1 / -1; text-align: left; }
  .kv { grid-template-columns: 6rem minmax(0, 1fr); }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .rail-list, .rail-task { display: none; }
  .run-pane { position: static; }
  .quick { padding-left: 12px; }
  .quick .btn { height: 40px; }
  .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.risk-badge { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 12px; font-weight: 600; vertical-align: middle; border: 1px solid currentColor; }
.risk-low { color: var(--ink); }
.risk-medium, .risk-high { color: var(--surface); background: var(--ink); }
