/* Fernhill workspace. Light only (decided 2026-11-02). Neutral greys, white
   work surface, one dark primary; Fernhill green only for the mark and for
   success states. Inter for interface, JetBrains Mono for code. */

:root {
  color-scheme: light;
  --canvas: #F4F5F7;
  --surface: #FFFFFF;
  --subtle: #F8F9FA;
  --hover: #F0F2F4;
  --selected: #E4E9EF;
  --border: #E3E6EA;
  --border-strong: #CDD2D8;
  --control: #8A939E;
  --text: #16191D;
  --text-2: #46505D;
  --text-3: #5B6472;
  --primary: #1F2937;
  --primary-hover: #111827;
  --brand: #2E6B4A;
  --success: #1E6B42; --success-bg: #E6F4EC;
  --changes: #8A4B08; --changes-bg: #FDF1E3;
  --merged: #5B3FA8; --merged-bg: #EFEAFB;
  --link: #2457A6;
  --focus: #2457A6;
  --add-bg: #EAF6EE; --add-gutter: #D5EEDD; --add-ink: #1E6B42;
  --del-bg: #FCEEEE; --del-gutter: #F6DADA; --del-ink: #A12C2C;
  --hunk-bg: #EEF2F8;
  --t-kw: #6D3FB0; --t-str: #1E6B42; --t-com: #7A828E; --t-num: #9A5B00; --t-key: #2457A6;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r-control: 6px;
  --r-panel: 8px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--text); font: 400 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
p { margin: 0; }
b { font-weight: 600; }
code, pre, .mono, .src, .diff table, .path, .delta {
  font-family: var(--font-mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
code { font-size: 12.5px; background: var(--hover); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; }
.mono { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); } .small { font-size: 12px; }
.err { color: var(--del-ink); margin-top: 12px; }
.err:empty { display: none; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.spacer { flex: 1; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-control);
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 500; font-size: 13.5px; color: var(--text); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; height: 44px; font-size: 14.5px; }
.btn[aria-pressed="true"] { background: var(--selected); border-color: var(--control); }
.btn:disabled { opacity: .5; cursor: default; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--border-strong); border-radius: var(--r-control); padding: 9px 11px; background: var(--surface); line-height: 1.5; }
textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(36 87 166 / 15%); }
textarea::placeholder { color: var(--text-3); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--selected); color: var(--text-2); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; flex: none; }
.avatar.xs { width: 20px; height: 20px; font-size: 8.5px; }
.avatar.me { background: var(--selected); color: var(--text); }
.avatar.bot { border-radius: 6px; background: var(--primary); color: #fff; font-family: var(--font-mono); font-size: 10px; letter-spacing: -.5px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--hover); color: var(--text-2); }
.tag.open { background: var(--success-bg); color: var(--success); }
.tag.merged { background: var(--merged-bg); color: var(--merged); }
.tag.changes { background: var(--changes-bg); color: var(--changes); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 11.5px; font-weight: 600; }

/* ---------- start ---------- */
.start { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background: var(--canvas); }
.start-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px 40px 40px; box-shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 8px 24px rgb(16 24 40 / 6%); }
.start-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 28px; }
.start-brand .by { margin-left: auto; font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.start-card h1 { font-size: 30px; line-height: 38px; letter-spacing: -.02em; font-weight: 600; margin: 0 0 10px; }
.lede { font-size: 15px; line-height: 24px; color: var(--text-2); }
.callout { display: flex; gap: 12px; margin: 24px 0; padding: 14px 16px; background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r-panel); font-size: 13.5px; line-height: 21px; color: var(--text-2); }
.callout p + p { margin-top: 6px; }
.callout b { color: var(--text); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linecap: round; }
.mark { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-rows: 52px 32px minmax(0, 1fr); height: 100dvh; }
.top { display: flex; align-items: center; gap: 24px; padding: 0 16px 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.team { color: var(--text-3); font-weight: 400; padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--border); }
.stages { display: flex; align-items: center; list-style: none; margin: 0 0 0 auto; padding: 0; gap: 4px; }
.stages li { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 4px; border-radius: 999px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.stages li + li::before { content: ""; width: 16px; height: 1px; background: var(--border-strong); margin: 0 6px 0 -4px; }
.stages .step { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface); }
.stages .step .ic { width: 12px; height: 12px; stroke-width: 2; }
.stages li.done { color: var(--text-2); }
.stages li.done .step { background: var(--success); border-color: var(--success); color: #fff; }
.stages li.now { color: var(--text); font-weight: 600; background: var(--hover); }
.stages li.now .step { background: var(--primary); border-color: var(--primary); color: #fff; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; background: var(--subtle); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.notice b { color: var(--text); }

.panes { display: grid; grid-template-columns: 232px minmax(0, 1fr) 344px; min-height: 0; }
.panes > * { min-width: 0; min-height: 0; }

/* ---------- left nav ---------- */
.nav { display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--subtle); border-right: 1px solid var(--border); }
.nav-scroll { overflow: hidden auto; padding: 8px 8px 16px; }
.nav h3 { display: flex; align-items: baseline; gap: 8px; margin: 16px 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.nav h3 .repo { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.row-item { position: relative; width: 100%; display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 8px; border: 0; border-radius: var(--r-control); background: none; text-align: left; color: var(--text-2); }
.row-item:hover { background: var(--hover); color: var(--text); }
.row-item[aria-current="true"] { background: var(--selected); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.row-item .ic { color: var(--text-3); }
.row-item .name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.row-item.two { flex-direction: column; align-items: stretch; gap: 1px; padding: 6px 8px; }
.row-item .meta-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.row-item .title { color: var(--text); font-weight: 500; line-height: 1.35; }
.tree .dir { display: flex; align-items: center; gap: 8px; min-height: 28px; padding-right: 8px; font-size: 13px; color: var(--text-2); }
.tree .dir .ic { color: var(--text-3); }
.tree .row-item.file .name { font-size: 13px; }
.tree .tag { margin-left: auto; }
.people { border-top: 1px solid var(--border); padding: 4px 8px 10px; background: var(--subtle); }
.people h3 { margin-top: 10px; }
.row-item.person { min-height: 40px; }
.who-line { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.who-line .name { color: var(--text); font-weight: 500; }
.who-line .role { font-size: 12px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .count { background: var(--primary); color: #fff; }

/* ---------- centre ---------- */
.main { overflow: auto; background: var(--surface); }
.page { max-width: 820px; padding: 24px 32px 64px; }
.page.wide { max-width: 1120px; padding: 20px 24px 64px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.crumbs .sep { color: var(--border-strong); }
.page h1 { font-size: 24px; line-height: 32px; letter-spacing: -.015em; font-weight: 600; margin: 0 0 12px; }
.page h1 .num { color: var(--text-3); font-weight: 400; }
.page h2 { font-size: 15px; line-height: 22px; font-weight: 600; margin: 28px 0 10px; }
.props { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.props div { display: flex; align-items: center; gap: 8px; }
.props dt { color: var(--text-3); }
.props dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.select { position: relative; }
.select select { appearance: none; height: 26px; padding: 0 26px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 10px; top: 9px; width: 5px; height: 5px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); pointer-events: none; }
.prose { max-width: 70ch; font-size: 15px; line-height: 24px; color: var(--text); }
.prose > * + * { margin-top: 12px; }
.prose.md h1 { font-size: 22px; line-height: 30px; margin: 0 0 4px; }
.prose.md h2 { font-size: 16px; margin: 22px 0 0; }
.prose ul { padding-left: 20px; margin: 0; }
.prose li + li { margin-top: 4px; }
pre { background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 20px; white-space: pre; }
.criteria { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; max-width: 70ch; }
.criteria li { display: flex; gap: 12px; padding: 6px 0; font-size: 14.5px; }
.criteria li::before { content: ""; width: 16px; height: 16px; flex: none; margin-top: 3px; border: 1.5px solid var(--control); border-radius: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; display: grid; gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 13.5px; top: 28px; bottom: 6px; width: 1px; background: var(--border); }
.timeline > li { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.timeline .avatar { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--surface); }
.timeline .entry { flex: 1; min-width: 0; padding-top: 4px; }
.timeline .by { font-size: 13px; color: var(--text-2); margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.timeline .by b { color: var(--text); }
.timeline p { font-size: 14.5px; line-height: 23px; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { margin-top: 24px; display: grid; gap: 8px; }
.composer label { font-size: 13px; font-weight: 600; }

/* viewers: code, logs, diffs */
.viewer { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); margin-bottom: 12px; }
.viewer > header { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.viewer .path { font-size: 12.5px; font-weight: 500; color: var(--text); }
.meta { font-size: 13px; color: var(--text-3); }
.viewer .scroll { overflow-x: auto; overflow-y: hidden; }
.src, .diff table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 22px; }
.src tr:first-child td { padding-top: 8px; } .src tr:last-child td { padding-bottom: 8px; }
.ln { width: 1%; min-width: 48px; padding: 0 12px 0 8px; text-align: right; vertical-align: top; color: var(--text-3); font-size: 12px; user-select: none; white-space: nowrap; }
.src .ln { background: var(--subtle); border-right: 1px solid var(--border); }
.code { white-space: pre; padding: 0 16px 0 14px; color: var(--text); }
.wrap .code { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-kw { color: var(--t-kw); } .t-str { color: var(--t-str); } .t-com { color: var(--t-com); font-style: italic; } .t-num { color: var(--t-num); } .t-key { color: var(--t-key); }
.lvl { font-weight: 500; } .lvl.debug { color: var(--text-3); } .lvl.info { color: var(--link); } .lvl.warn { color: var(--changes); } .lvl.error { color: var(--del-ink); }

/* pull request */
.pr-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13.5px; color: var(--text-2); margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.state { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.state .ic { width: 14px; height: 14px; stroke-width: 1.6; }
.state.open { background: var(--success); color: #fff; }
.state.merged { background: var(--merged); color: #fff; }
.toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; height: 48px; margin: 28px -24px 12px; padding: 0 24px; background: rgb(255 255 255 / 94%); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.delta { margin-left: auto; display: flex; gap: 8px; font-size: 12px; font-weight: 500; }
.plus { color: var(--add-ink); } .minus { color: var(--del-ink); }
.diff tr.hunk td { background: var(--hunk-bg); color: var(--text-3); padding: 2px 14px; font-size: 12px; }
.diff tr.d { cursor: pointer; }
.diff tr.add td { background: var(--add-bg); } .diff tr.add td.ln { background: var(--add-gutter); }
.diff tr.del td { background: var(--del-bg); } .diff tr.del td.ln { background: var(--del-gutter); }
.diff tr.add .mk { color: var(--add-ink); } .diff tr.del .mk { color: var(--del-ink); }
.mk { position: relative; width: 24px; min-width: 24px; text-align: center; color: var(--text-3); user-select: none; }
.add-c { position: absolute; left: -12px; top: -1px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: var(--link); color: #fff; font: 600 15px/24px var(--font-ui); opacity: 0; transition: opacity .1s; }
.diff tr.d:hover .add-c, .diff tr.d:focus-within .add-c { opacity: 1; }
@media (hover: none) { .add-c { opacity: .85; } }
.diff tr.d:hover td.code { box-shadow: inset 0 0 0 9999px rgb(36 87 166 / 5%); }
.diff tr.notes td { padding: 0; background: var(--subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.notes-in { position: sticky; left: 0; max-width: 760px; padding: 12px 16px 14px; font-family: var(--font-ui); font-size: 14px; white-space: normal; display: grid; gap: 12px; }
.note { display: flex; gap: 10px; align-items: flex-start; }
.note b { font-size: 13px; }
.note p { white-space: pre-wrap; }
.composer.inline { margin: 0; }
.composer.inline label { font-weight: 500; color: var(--text-2); font-size: 12.5px; }
.review { margin-top: 24px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--subtle); display: grid; gap: 10px; }
.done-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--merged); font-weight: 500; }
.typing { color: var(--text-3); font-size: 13px; }
.typing::after { content: "…"; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* in-app confirmations and notices (no browser dialogs) */
.confirm { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--control); border-radius: var(--r-control); }
.leave-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 300px; display: grid; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: 0 8px 24px rgb(16 24 40 / 14%); font-size: 13.5px; line-height: 20px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px)); padding: 8px 8px 8px 16px; background: var(--primary); color: #fff; border-radius: var(--r-panel); font-size: 13.5px; box-shadow: 0 8px 24px rgb(16 24 40 / 20%); }
.toast .btn.ghost { color: #fff; }
.toast .btn.ghost:hover { background: rgb(255 255 255 / 14%); color: #fff; }

.day-over { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 12px 10px 18px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: 0 8px 24px rgb(16 24 40 / 14%); font-size: 13.5px; }

/* finished session */
.results-page { min-height: 100%; height: auto; overflow: auto; padding: 16px; }
.results-wait, .results-done { max-width: 860px; margin: 16px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-2); }
#last-results { margin-top: 8px; height: 36px; font-size: 13.5px; }

/* Builder at work */
.work { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.work ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.work.running { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-control); }
.work.running ol { margin: 0; }
.work li { display: flex; align-items: flex-start; gap: 8px; }
.work li .ic { width: 14px; height: 14px; margin-top: 3px; stroke-width: 1.8; color: var(--success); }
.work li.now { color: var(--text); font-weight: 500; }
.work li.now .meta { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; }
.work summary { cursor: pointer; color: var(--text-3); }
.work summary:hover { color: var(--text); }
.spin { flex: none; display: inline-block; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.working .spin { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* ---------- right: colleagues and Builder ---------- */
.side { display: grid; grid-template-rows: 44px minmax(0, 1fr) auto; background: var(--subtle); border-left: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs button { display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: none; padding: 0 8px; font-size: 13.5px; font-weight: 400; color: var(--text-3); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.new-pill { height: 18px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 600; display: inline-grid; place-items: center; }
.feed { overflow: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.feed-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 12px 16px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.feed-head b { display: block; font-size: 14px; line-height: 20px; }
.feed-head span:not(.avatar) { font-size: 12px; color: var(--text-3); }
.feed { gap: 18px; }
.run { display: flex; gap: 10px; align-items: flex-start; }
.run .avatar { width: 26px; height: 26px; margin-top: 1px; }
.run-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.run .by { font-size: 13px; font-weight: 600; color: var(--text); line-height: 20px; }
.msg { font-size: 14px; line-height: 22px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.artifact { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 4px 10px; width: 100%; margin-top: 8px; padding: 10px 12px; text-align: left; white-space: normal;
  border: 1px solid var(--border-strong); border-radius: var(--r-panel); background: var(--surface); transition: border-color .12s, background .12s; }
.artifact:hover { border-color: var(--control); background: var(--subtle); }
.artifact > span:nth-child(2) { display: grid; line-height: 1.35; }
.artifact .small { color: var(--text-3); }
.artifact b { font-size: 13.5px; }
.artifact .ic { margin-top: 2px; }
.artifact .go { pointer-events: none; grid-column: 2; justify-self: start; margin-top: 6px; }
.empty { color: var(--text-3); font-size: 13.5px; margin-top: 12px; }
.compose { padding: 12px; background: var(--subtle); border-top: 1px solid var(--border); }
.compose-box { border: 1px solid var(--border-strong); border-radius: var(--r-panel); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.compose-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(36 87 166 / 15%); }
.compose-box textarea { border: 0; box-shadow: none; resize: none; min-height: 56px; padding: 10px 12px 4px; }
.compose-box textarea:focus { box-shadow: none; }
.compose .row { justify-content: flex-end; padding: 0 8px 8px 12px; }
.compose .hint { margin-right: auto; font-size: 11.5px; color: var(--text-3); }
.compose #busy:empty { display: none; }

/* ---------- narrower screens ---------- */
@media (max-width: 1280px) {
  .panes { grid-template-columns: 216px minmax(0, 1fr) 320px; }
  .stages li .label { display: none; }
  .stages li.now .label { display: inline; }
}
@media (max-width: 860px) {
  .app { height: auto; grid-template-rows: auto auto auto; }
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 8px 16px; }
  .stages { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  #leave { margin-left: auto; }
  .notice { white-space: normal; padding: 6px 16px; }
  .panes { grid-template-columns: 1fr; }
  .nav { border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-scroll { max-height: 50vh; }
  .side { border-left: 0; border-top: 1px solid var(--border); height: 80vh; }
  .page, .page.wide { padding: 20px 16px 40px; }
  .team, .compose .hint { display: none; }
}

/* ---------- debug drawer (internal testing) ---------- */
@media (min-width: 1201px) {
  body.debug-open .app { margin-right: 440px; grid-template-columns: minmax(0, 1fr); }
  body.debug-open .panes { grid-template-columns: 200px minmax(0, 1fr) 300px; }
  body.debug-open .top { gap: 12px; }
  body.debug-open .team, body.debug-open .stages li:not(.now) .label { display: none; }
  body.debug-open .stages li { padding-right: 4px; }
  body.debug-open .stages li.now { padding-right: 10px; }
  body.debug-open .top .btn { white-space: nowrap; padding: 0 10px; }
}
.debug-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 15; width: 440px; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -8px 0 24px rgb(16 24 40 / 8%); }
.debug-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border); }
.debug-head > div { display: grid; flex: 1; min-width: 0; line-height: 18px; }
.debug-body { overflow: auto; }
.debug-body .report { max-width: none; margin: 0; padding: 16px 16px 32px; border: 0; border-radius: 0; font-size: 13.5px; }
.debug-body .report h1 { display: none; }
.debug-body .report .r-note { margin-top: 12px; padding: 8px 10px; font-size: 12.5px; line-height: 18px; }
.debug-body .report .r-meta { font-size: 12.5px; }
.debug-body .report h2 { font-size: 15px; margin-top: 24px; flex-wrap: wrap; gap: 2px 8px; }
.debug-body .report .r-item { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
.debug-body .report .r-state { max-width: 170px; border-radius: 10px; }
.debug-body .report .r-item.changed { margin: 0 -8px; padding-left: 8px; padding-right: 8px; background: #FFF8E6; }
.debug-body .report .was { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.debug-body .report table { table-layout: fixed; }
.debug-body .report td.t { display: none; }
.debug-body .report td.a { width: 62px; }
.debug-body .report td.y { width: 118px; white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
@media (max-width: 500px) { .debug-drawer { width: 100vw; } }
