/* codeai UI. Tokens match the Figma file "codeai – App Screens". */
:root {
  --bg: #eef1f3; --surface: #ffffff; --surface-2: #f6f8f9;
  --fg: #151c22; --muted: #5d6b76; --faint: #8a969f; --line: #dce2e6;
  --accent: #0d6f78; --accent-fg: #ffffff; --accent-soft: #dff0f1;
  --ok: #1d7a46; --ok-soft: #e1f3e8; --warn: #9a5b00; --warn-soft: #fbefd9;
  --crit: #b3261e; --crit-soft: #fbe3e1; --info: #2b5ea8; --info-soft: #e2ebf8;
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1316; --surface: #151c20; --surface-2: #1b2328; --fg: #e3e9ec; --muted: #9aa8b1; --faint: #6c7a83;
    --line: #28333a; --accent: #4cb8c1; --accent-fg: #06201f; --accent-soft: #143033;
    --ok: #5cc98a; --ok-soft: #14301f; --warn: #e5a54a; --warn-soft: #33260f; --crit: #f07a70; --crit-soft: #3a1a17;
    --info: #7fa9e8; --info-soft: #172640; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-ui); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Elements with the hidden attribute stay hidden even when a class sets display (.stack, .row, ...). */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.logo { display: flex; align-items: center; gap: 8px; font: 500 15px var(--font-mono); color: var(--fg); text-decoration: none; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--accent-fg); display: inline-grid; place-items: center; font-size: 11px; }
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.switcher summary::-webkit-details-marker { display: none; }
.caret { color: var(--muted); font-size: 12px; }
.switcher-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: grid; gap: 2px; }
.switcher-menu button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.switcher-menu button:hover, .switcher-menu button.on { background: var(--accent-soft); }
.switcher-menu a { padding: 7px 10px; border-top: 1px solid var(--line); margin-top: 2px; font-size: 13px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chip b { color: var(--fg); font: 500 12px var(--font-mono); }
.spacer { flex: 1; }
.body { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: calc(100% - 53px); }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav .grp { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; }
.nav a, .nav .soon { padding: 7px 10px; border-radius: 7px; color: var(--fg); text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .soon { color: var(--faint); display: flex; justify-content: space-between; }
.nav .soon em { font-style: normal; font-size: 11px; }
.main { padding: 20px 24px 48px; min-width: 0; display: grid; gap: 16px; align-content: start; }

/* Layout */
/* one column that may shrink below its content, so a long line scrolls in its own box instead of widening the page */
.screen, .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.card .stack, .card.stack { gap: 12px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; }
.grid { display: grid; gap: 16px; min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.wrap-anywhere { min-width: 0; overflow-wrap: anywhere; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.card.flush { padding: 6px; }
.card h2 { font-size: 13px; font-weight: 600; margin: 0; }
.card h3 { font-size: 15px; font-weight: 600; margin: 0; }
.hint { margin: 0; font-size: 12px; color: var(--faint); }
.empty { padding: 20px; color: var(--muted); }
.empty.small { padding: 0; font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; }
.flash.notice { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--crit-soft); color: var(--crit); }
/* why an IDE action of the IntelliJ tool window did nothing (#207); stays in sight while the page scrolls */
.ide-problem { position: sticky; top: 60px; z-index: 6; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--crit); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; min-width: 0; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 400; min-width: 0; }
.row input { flex: 1; width: auto; }
textarea { resize: vertical; }
.checks { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.checks legend { font-size: 12.5px; font-weight: 500; margin-bottom: 6px; }
.checks label { display: flex; gap: 6px; align-items: center; }

/* Data */
.tbl { overflow-x: auto; }
.tbl th.on, .tbl td.on { background: var(--accent-soft); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin: 1px 0; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-crit { background: var(--crit-soft); color: var(--crit); }
.p-accent { background: var(--accent-soft); color: var(--accent); }
.p-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.caps { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cap { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.cap.y { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.att { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.att .bar { align-self: stretch; border-radius: 2px; background: var(--faint); min-height: 36px; }
.att .bar.ok { background: var(--ok); }
.att .bar.warn { background: var(--warn); }
.att .t { font-weight: 500; }
.att .d { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .g-2, .g-3, .g-main { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 16px; }
}

/* Knowledge base */
.small { font-size: 12px; }
.faint { color: var(--faint); }
.warn-text { color: var(--warn); }
.index-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.bar-h { width: 160px; height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-h span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stat-row b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--fg); border-color: var(--accent); font-weight: 600; }
.g-side { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.pkg-list { display: grid; gap: 4px; max-height: 520px; overflow-y: auto; }
.pkg-list .row { padding: 3px 0; flex-wrap: nowrap; }
@media (max-width: 860px) { .g-side { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .bar-h span { transition: none; } }

/* Summaries and search by meaning */
.summary { margin: 0; max-width: 90ch; }
.pkg { display: grid; gap: 2px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pkg:last-child { border-bottom: 0; }
.pkg p { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; background: var(--surface); }
.seg label + label { border-left: 1px solid var(--line); }
.seg label.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg input { accent-color: var(--accent); }
.snippet { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  font: 12px/1.55 var(--font-mono); overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto; }
.hit { gap: 8px; }

/* Tasks */
.h1 { margin: 2px 0 0; font-size: 20px; font-weight: 600; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.g-tasks { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.g-tasks-3 { grid-template-columns: 260px minmax(0, 1fr) 280px; align-items: start; }
.g-task { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
.task-list { display: grid; gap: 2px; padding: 10px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.task-list .grp { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 12px 4px 4px; }
.btn-block { justify-content: center; width: 100%; }
.titem { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.titem > * { min-width: 0; }
.titem .pill { flex-shrink: 0; }
.titem:hover { background: var(--surface-2); }
.titem.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.titem .tt { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.titem .ts { font-size: 12px; color: var(--muted); }
.nowrap { flex-wrap: nowrap; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.note { margin: 0; font-size: 13px; color: var(--warn); }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.stages div { font-size: 11.5px; color: var(--faint); padding-top: 7px; border-top: 3px solid var(--line); }
.stages .done { color: var(--muted); border-color: var(--ok); }
.stages .now { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.stages .next { color: var(--muted); border-color: var(--accent-soft); }
.thread { gap: 18px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.msg.sys { opacity: .85; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); }
.av.ai { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.msg-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.who { font-size: 12.5px; color: var(--muted); }
.who b { color: var(--fg); margin-right: 6px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.plan { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 14px; display: grid; gap: 10px; }
.plan.old { opacity: .7; }
.plan p { margin: 0; }
.plan ul, .plan ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 3px; }
.questions { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 0 6px 6px 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 12px; color: var(--fg); text-decoration: none; max-width: 100%; }
.chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; }
.reply { border-top: 1px solid var(--line); padding-top: 14px; }
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.file-list:empty { display: none; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.ref-field { position: relative; }
.suggest-box { position: absolute; left: 0; top: 100%; z-index: 10; min-width: 280px; max-width: 100%; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; }
.suggestions { display: grid; }
.suggestion { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; }
.suggestion:hover, .suggestion:focus-visible { background: var(--accent-soft); }
fieldset.seg { padding: 0; margin: 0; }
.kv.narrow { grid-template-columns: 80px minmax(0, 1fr); }
.big { font-size: 24px; font-weight: 600; }
.calls { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.crit-text { color: var(--crit); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (max-width: 1100px) { .g-tasks-3 { grid-template-columns: 240px minmax(0, 1fr); } .g-tasks-3 > :last-child { grid-column: 2; } }
@media (max-width: 860px) {
  .g-tasks, .g-tasks-3, .g-task { grid-template-columns: minmax(0, 1fr); }
  .g-tasks-3 > :last-child { grid-column: auto; }
  .task-list { position: static; max-height: none; }
}
.task-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.task-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--fg); text-decoration: none; background: var(--surface); min-width: 0; }
/* a long title is cut with an ellipsis instead of pushing the card wider */
.task-card > * { min-width: 0; }
.task-card .pill { flex-shrink: 0; }
.task-card:hover { border-color: var(--accent); }
.task-card b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.p-info { background: var(--info-soft); color: var(--info); }
.error-card { max-width: 640px; }

/* Implementation: steps and diffs */
.steps { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 2px; }
.ok-text { color: var(--ok); }
.diff { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.diff summary { cursor: pointer; padding: 8px 10px; background: var(--surface-2); list-style: none; }
.diff summary::-webkit-details-marker { display: none; }
/* a changed file's path keeps the line; its status and the IDE buttons go under it when the line is narrow (#207) */
.diff summary.nowrap { flex-wrap: wrap; }
.diff summary .diff-path { flex: 1 1 240px; min-width: 0; }
.diff-body { margin: 0; padding: 6px 0; overflow-x: auto; font: 12px/1.45 var(--font-mono); background: var(--surface); }
.dl { display: block; padding: 0 10px; white-space: pre; min-width: max-content; }
.dl.add { background: var(--ok-soft); color: var(--ok); }
.dl.del { background: var(--crit-soft); color: var(--crit); }
.dl.hunk { color: var(--info); background: var(--info-soft); }
.run summary { cursor: pointer; list-style: none; }
.run summary::-webkit-details-marker { display: none; }
.run[open] { display: grid; gap: 6px; }

/* Tests */
.log { margin: 0; padding: 8px 10px; max-height: 260px; overflow: auto; font: 11.5px/1.45 var(--font-mono);
       background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; white-space: pre; }
.problems { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.problem summary { cursor: pointer; font-size: 13px; }
.spacer-left { margin-left: auto; }

/* Chat with the advisor */
.msg.chat .msg-body { border-left: 2px solid var(--info-soft); padding-left: 10px; }
.advisor-busy { padding: 8px 10px; border-radius: 8px; background: var(--info-soft); }

/* Task page: the message box and its buttons on top, then tabs for the conversation and the changes */
.task-tabs { margin-top: -4px; flex-wrap: nowrap; scrollbar-width: thin; }
.task-tabs button { border: 0; background: none; padding: 8px 12px; color: var(--muted); font: inherit; cursor: pointer;
                    border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center;
                    white-space: nowrap; flex: none; }
.task-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.task-tabs .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.order-switch a { padding: 2px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.order-switch a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tbl-title { padding: 10px 10px 0; }

/* Earlier test runs: one compact line each */
.history summary { cursor: pointer; }
.history-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; }
.history-list li { display: grid; grid-template-columns: 10px 96px 92px 1fr auto; gap: 8px; align-items: center;
                   padding: 3px 6px; border-radius: 6px; }
.history-list li:hover { background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.d-ok { background: var(--ok); } .dot.d-crit { background: var(--crit); } .dot.d-warn { background: var(--warn); }
.dot.d-accent { background: var(--accent); } .dot.d-neutral { background: var(--faint); }
.h-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sources on the project edit page */
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.source-list > li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.source-edit summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.source-edit[open] { display: grid; gap: 10px; }
.source-edit[open] summary { margin-bottom: 2px; }

/* Connectors on the task page */
.connector-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.connector-list > li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.connector-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.connector-location { overflow-wrap: anywhere; }
.connector-add summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.connector-add[open] { display: grid; gap: 10px; }

/* Plan tab */
.plan-ref .questions { margin-top: 4px; }
.plan-versions { margin-top: 10px; }

/* Folder picker */
.path-input { display: flex; gap: 6px; align-items: center; min-width: 0; }
.path-input input { flex: 1; min-width: 0; }
.folder-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 720px); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; background: var(--surface); color: var(--fg); }
.folder-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.folder-dialog h2 { margin: 0; font-size: 15px; }
.folder-path input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: 12.5px; }
.folder-roots { gap: 6px; }
.folder-roots .chip { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); }
.folder-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px;
  overflow-y: auto; max-height: 42vh; display: grid; gap: 1px; }
.folder-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font-size: 13px; }
.folder-item:hover { background: var(--surface-2); }
.folder-item .folder-name::before { content: ""; display: inline-block; width: 11px; height: 8px; margin-right: 8px;
  border: 1.5px solid var(--muted); border-radius: 2px; vertical-align: 0; }
.index-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Questions tab */
.task-tabs .count.count-warn { background: var(--warn-soft); color: var(--warn); }
.question-list { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.question-list li::marker { color: var(--muted); font-weight: 600; }
.question-text { font-size: 13.5px; font-weight: 500; color: var(--fg); line-height: 1.45; }

/* Plan check */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.check-list li > span:last-child { display: grid; gap: 2px; }
.check-list .check-mark { font-weight: 700; text-align: center; }
.check-list li.done .check-mark { color: var(--ok); }
.check-list li.open .check-mark { color: var(--warn); }

/* Review */
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.finding p { margin: 0; }
.finding.closed { opacity: .6; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }

/* Live AI spend while agents work */
.spend { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.spend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.spend-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* Plan steps marked while the implementer works */
.plan-live { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.check-list li.partial .check-mark { color: var(--info); }
.step-mark { font-size: 12px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
li.step-done .step-mark { color: var(--ok); }
li.step-partial .step-mark { color: var(--info); }

/* Plan progress bar: done steps solid, partly done ones lighter */
.progress { display: flex; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress-done { background: var(--ok); transition: width .4s ease; }
.progress-partial { background: var(--info); opacity: .55; transition: width .4s ease; }
.plan-bar { display: grid; gap: 4px; }

/* Round progress: phases and tool calls used */
.round-live { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.phases li { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.phases li.past { color: var(--ok); }
.phases li.now { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.progress.thin { height: 5px; }
.progress-used { background: var(--accent); transition: width .4s ease; }

.marked-steps .step-icon { display: inline-block; width: 1.2em; font-weight: 700; color: var(--faint); }
.marked-steps li.step-done .step-icon { color: var(--ok); }
.marked-steps li.step-partial .step-icon { color: var(--info); }
.marked-steps li.step-done > span:not(.step-icon):not(.step-mark) { color: var(--muted); }

/* Generated user guide in the Docs tab */
.doc-body { font-size: 14px; line-height: 1.6; max-width: 860px; overflow-wrap: anywhere; }
.doc-body h1 { font-size: 22px; margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc-body h2 { font-size: 18px; margin: 22px 0 8px; }
.doc-body h3 { font-size: 15px; margin: 16px 0 6px; }
.doc-body p, .doc-body ul, .doc-body ol { margin: 0 0 10px; }
.doc-body code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.doc-body pre { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line);
                border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.doc-body pre code { background: none; padding: 0; }
.doc-body table { border-collapse: collapse; margin: 6px 0 14px; font-size: 13px; display: block; overflow-x: auto; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-body th { background: var(--surface-2); }
.doc-body blockquote { margin: 8px 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--muted); }

/* Messages in the conversation, rendered from Markdown: readable line length, clear headings, lists and code */
.text.md { white-space: normal; line-height: 1.6; font-size: 14px; max-width: 900px; overflow-wrap: anywhere; }
.text.md > :first-child { margin-top: 0; }
.text.md > :last-child { margin-bottom: 0; }
.text.md p, .text.md ul, .text.md ol, .text.md blockquote, .text.md pre, .text.md table { margin: 0 0 10px; }
.text.md ul, .text.md ol { padding-left: 22px; }
.text.md li { margin: 3px 0; }
.text.md li > ul, .text.md li > ol { margin: 4px 0 2px; }
.text.md li::marker { color: var(--faint); }
.text.md ol > li::marker { font-weight: 600; color: var(--muted); }
.text.md h1, .text.md h2, .text.md h3, .text.md h4 { margin: 16px 0 6px; line-height: 1.3; color: var(--fg); font-weight: 650; }
.text.md h1 { font-size: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.text.md h2 { font-size: 16px; }
.text.md h3 { font-size: 14.5px; }
.text.md h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 14px; }
.text.md strong { font-weight: 650; color: var(--fg); }
.text.md code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px;
                border: 1px solid var(--line); border-radius: 4px; }
.text.md pre { position: relative; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.45;
               background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
               overflow: auto; max-height: 520px; white-space: pre; }
.text.md pre code { background: none; padding: 0; border: none; }
.text.md pre .copy-code { position: sticky; float: right; top: 0; margin: -4px -6px 0 8px; opacity: 0; transition: opacity .15s; }
.text.md pre:hover .copy-code, .text.md pre .copy-code:focus { opacity: 1; }
.text.md table { border-collapse: collapse; font-size: 13px; display: block; max-width: 100%; overflow-x: auto; width: max-content; }
.text.md th, .text.md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top;
                           white-space: normal; min-width: 60px; max-width: 420px; overflow-wrap: anywhere; }
.text.md th { background: var(--surface-2); color: var(--fg); font-weight: 600; font-size: 12.5px; }
.text.md tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.text.md blockquote { padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface-2);
                      border-radius: 0 6px 6px 0; color: var(--muted); }
.text.md hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.text.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* the first line of an agent's or codeai's message is its headline (a round's summary starts with one) */
.msg .av.ai + .msg-body .text.md > p:first-child, .msg.sys .text.md > p:first-child { font-weight: 600; color: var(--fg); }
/* the developer's own messages stand out from the agents' */
.msg.mine .text.md { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); border-radius: 10px;
                     padding: 10px 14px; width: fit-content; max-width: min(900px, 100%); }
.thread-messages > .msg + .msg, [data-panel="conversation"] .msg + .msg { padding-top: 12px; border-top: 1px solid var(--line); }
.msg-images { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-images img { width: 168px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
                  background: var(--surface-2); display: block; }
.msg-images a:hover img { border-color: var(--accent); }
.file-list .chip-thumb { width: 36px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

/* Task history on the Knowledge base page */
.digest { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.digest details summary { cursor: pointer; color: var(--muted); }
.digest textarea { width: 100%; }

/* The task's outcome at the top of its page */
.btn-lg { padding: 10px 18px; font-size: 14.5px; font-weight: 600; }
.accept-panel { border-left: 3px solid var(--line); }
.accept-panel.ready { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 35%, var(--surface)); }
.accept-panel h2 { margin: 0 0 2px; }
.main-panel { border-left: 3px solid var(--line); }
.main-panel.conflict { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 35%, var(--surface)); }
.main-panel h2 { margin: 0 0 2px; }
.main-conflicts { margin: 0; padding-left: 18px; overflow-wrap: anywhere; }

/* The project's mode on the AI per stage page */
.ai-mode { border-left: 3px solid var(--line); }
.ai-mode.prompt { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface)); }
.ai-mode h2 { margin: 0 0 4px; }
.muted-block { opacity: .55; }

/* History page: every task with its summary and conversation */
.history-search { margin-bottom: 4px; }
.history-search input[type=search] { flex: 1; min-width: 0; }
.history-entry .conversation-toggle summary { cursor: pointer; color: var(--muted); }
.history-thread { max-height: 640px; overflow-y: auto; padding: 8px 4px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.earlier-tasks > summary { cursor: pointer; }
.earlier-tasks .digest .text { max-height: 220px; overflow-y: auto; }
.ai-mode .inline-field { margin: 0; }
.ai-mode .inline-field input { min-width: 260px; }

/* Phones: the menu slides in from the left, the top bar keeps what matters, controls are big enough to tap */
.menu-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--fg); font-size: 18px; cursor: pointer; flex: none; }
.nav-signout { margin-top: auto; padding-top: 12px; }
.nav-signout button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px;
  color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.nav-signout button:hover { background: var(--surface-2); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login { width: min(420px, 100%); display: grid; gap: 14px; }
.login-logo { justify-content: center; font-size: 18px; }
.steps-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; width: 38px; height: 38px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .chip { display: none; }
  .logo { font-size: 0; gap: 0; }
  .logo .mark { font-size: 11px; }
  .switcher { min-width: 0; }
  .switcher summary { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .switcher-menu { position: fixed; left: 12px; right: 12px; top: 54px; min-width: 0; }
  .nav { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(290px, 84vw); padding: 16px 12px;
    overflow-y: auto; border-right: 1px solid var(--line); box-shadow: 0 0 32px rgba(0,0,0,.25);
    transform: translateX(-105%); transition: transform .2s ease; }
  .nav a, .nav .soon, .nav-signout button { padding: 10px 12px; font-size: 15px; }
  body.nav-open .nav { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .main { padding: 12px 12px 40px; gap: 12px; }
  .page-head h1 { font-size: 19px; }
  .card { padding: 14px 12px; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 38px; }
  .btn.btn-sm { min-height: 34px; }
  .task-tabs { position: sticky; top: 54px; z-index: 4; background: var(--bg); }
  .tbl table { min-width: 560px; }
  .seg { display: flex; flex-wrap: wrap; width: auto; }
  .seg label { flex: 1 1 30%; justify-content: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
  .seg label + label { border-left: 0; }
  .stages div { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .task-tabs button { padding: 8px 9px; }
  select { max-width: 100%; }
  .login .logo { font-size: 18px; gap: 8px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .nav { transition: none; } }

.push-devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.usage-tiles .big { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Advisor chat */
.chat-list { gap: 4px; max-height: 70vh; overflow-y: auto; }
.chat-list .btn { margin-bottom: 8px; }
.chat-link { display: grid; gap: 2px; padding: 7px 9px; border-radius: 7px; color: var(--fg); text-decoration: none; }
.chat-link:hover { background: var(--surface-2); }
.chat-link.on { background: var(--accent-soft); }
.chat-link .chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.chat-steps { margin: 0; padding-left: 22px; display: grid; gap: 2px; }
@media (max-width: 860px) { .chat-list { max-height: 220px; order: 1; } }
/* newest first: the advisor's progress comes before the messages */
.chat-main.newest-first .thread-head { order: -2; }
.chat-main.newest-first #answer { order: -1; }

/* Collapsible menu and side lists: the menu button hides the main menu on wide screens; a side list shrinks to its button */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.side-toggle { width: 26px; height: 26px; display: inline-grid; place-items: center; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.side-toggle:hover { color: var(--fg); }
html.side-chats-collapsed .chat-list > :not(.side-head),
html.side-tasks-collapsed .task-list > :not(.side-head),
html.side-task-collapsed .task-side > :not(.side-head),
html.side-chats-collapsed .chat-list .side-label,
html.side-tasks-collapsed .task-list .side-label,
html.side-task-collapsed .task-side .side-label { display: none; }
html.side-chats-collapsed .chat-list, html.side-tasks-collapsed .task-list { padding: 8px; }
@media (min-width: 861px) {
  html.nav-collapsed .body { grid-template-columns: minmax(0, 1fr); }
  html.nav-collapsed .nav { display: none; }
  html.side-chats-collapsed .chat-page { --chats-w: 44px !important; }
  html.side-chats-collapsed .chats-resize { display: none; }
  html.side-tasks-collapsed .g-tasks { grid-template-columns: 44px minmax(0, 1fr); }
  html.side-task-collapsed .g-task { grid-template-columns: minmax(0, 1fr) 30px; }
}
.msg-edit > summary { list-style: none; width: max-content; }
.msg-edit > summary::-webkit-details-marker { display: none; }
.msg-edit[open] > summary { display: none; }
.msg-edit form { margin-top: 4px; }
/* Continue automatically */
.auto-continue { gap: 6px; }
.auto-countdown { padding: 8px 10px; border-radius: 8px; background: var(--info-soft); }
.btn.counting { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Your actions: what the implementer asks the developer to do */
.needs-you { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px;
  background: var(--warn-soft, #fdf1e3); color: var(--warn); text-decoration: none; border: 1px solid currentColor; }
.needs-you.pending { background: transparent; color: var(--muted); border-style: dashed; }
.task-tabs .tab-alert { color: var(--warn); font-weight: 600; }
.task-tabs .tab-alert[aria-selected="true"] { border-color: var(--warn); }
.manual-action { display: grid; grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.manual-action.open { border-left: 4px solid var(--warn); }
.manual-action.closed { opacity: .75; }
.manual-action h3 { margin: 0; font-size: 15px; }
.manual-action p { margin: 0; }
.hand-back > summary { list-style: none; }
.hand-back > summary::-webkit-details-marker { display: none; }
.hand-back[open] > summary { display: none; }

/* Advisor chat: what its advisor may do with tasks, and the tasks it created */
.chat-tasks { gap: 8px; }
.chat-task-list { list-style: none; margin: 0; padding: 0; gap: 6px; }
.chat-task-list li { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.chat-task-list a { color: var(--fg); text-decoration: none; }

/* Open tasks of all projects: each project has a color, so a task shows where it belongs */
.nav-count { float: right; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2);
             border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 18px; }
.nav a.active .nav-count { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.ot-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ot-filters, .ot-views { display: flex; flex-wrap: wrap; gap: 6px; }
.ot-filters a, .ot-views a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
                            color: var(--fg); text-decoration: none; font-size: 13px; }
.ot-filters a b { margin-left: 4px; font-weight: 650; color: var(--muted); }
.ot-filters a b.ot-you { color: var(--warn); }
.ot-filters a b.ot-working { color: var(--accent); }
.ot-filters a.on, .ot-views a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ot-project { border-left: 4px solid var(--project); margin-bottom: 14px; }
.ot-project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px;
                   border-bottom: 1px solid var(--line); }
.ot-project-head h2 { margin: 0; font-size: 15.5px; }
.ot-counts { margin-left: auto; }
.ot-you-text { color: var(--warn); }
.ot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--project); flex: none; display: inline-block; }
.ot-list { list-style: none; margin: 0; padding: 0; }
.ot-task + .ot-task { border-top: 1px solid var(--line); }
.ot-task { display: flex; align-items: center; }
.ot-task a { flex: 1; min-width: 0; }
.os-change { padding: 10px 16px; gap: 12px; width: 100%; }
.ot-auto { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px 10px 4px; white-space: nowrap;
           color: var(--muted); cursor: pointer; }
.ot-task a { display: flex; gap: 12px; align-items: center; padding: 10px 16px; color: var(--fg); text-decoration: none; }
.ot-task a:hover { background: var(--surface-2); }
.ot-task.you a { box-shadow: inset 3px 0 0 var(--warn); }
.ot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ot-title { overflow-wrap: anywhere; }
.ot-key { color: var(--project); margin-right: 2px; }
.ot-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-side { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: flex-end; text-align: right; }
.ot-meta { white-space: nowrap; }
.ot-project-tag { display: inline-flex; align-items: center; gap: 6px; flex: none; width: 150px; font-weight: 600;
                  font-size: 13px; color: var(--project); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .ot-task a { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px; }
  .ot-side { justify-content: flex-start; text-align: left; }
  .ot-project-tag { width: auto; }
  .ot-counts { margin-left: 0; width: 100%; }
  .ot-note { white-space: normal; }
}
@media (prefers-color-scheme: dark) { .ot-key, .ot-project-tag { filter: brightness(1.45); } }

/* A decision the implementer asks for: one button per answer, labelled with what happens */
.decision-options { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.decision-option { justify-content: space-between; text-align: left; white-space: normal; line-height: 1.35;
                   padding: 10px 14px; height: auto; display: flex; gap: 10px; align-items: center; }
.decision-tag { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.decision textarea { min-height: 36px; }

/* OpenSpec: the Specs page and a change's page */
.os-tabs { margin-bottom: 14px; }
.os-link { color: var(--fg); text-decoration: none; }
.os-link:hover b { color: var(--accent); text-decoration: underline; }
.os-archived { margin-top: 10px; }
.os-archived summary { cursor: pointer; color: var(--muted); }
.os-archive-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.os-search { gap: 8px; margin-bottom: 14px; }
.os-search input { flex: 1; min-width: 0; max-width: 480px; }
.os-specs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.os-caps { display: grid; gap: 2px; position: sticky; top: 64px; }
.os-cap { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--fg); text-decoration: none; }
.os-cap:hover { background: var(--surface-2); }
.os-cap.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.os-cap.faint { color: var(--faint); }
.os-cap .count { font-size: 11.5px; color: var(--muted); }
.os-cap-head h2 { margin: 6px 0 2px; font-size: 16px; }
.os-cap-head p { margin: 0 0 4px; }
.os-reqs { gap: 12px; }
.os-req { scroll-margin-top: 70px; }
.os-req:target, .os-item:target { box-shadow: 0 0 0 2px var(--accent); }
.os-req-name { margin: 0 0 6px; font-size: 15px; }
.os-scenarios { display: grid; gap: 8px; margin-top: 10px; }
.os-scenario { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface-2); }
.os-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.os-steps li { display: flex; gap: 8px; align-items: baseline; }
.os-kw { font: 600 11px var(--font-mono); padding: 1px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); flex: none; min-width: 44px; text-align: center; }
.os-kw-when, .os-kw-given { color: var(--info); background: var(--info-soft); border-color: transparent; }
.os-kw-then { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.os-origin { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.os-authors { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.os-actions { gap: 8px; flex-wrap: wrap; }
.os-stats { gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.os-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 14px; max-width: 480px; }
.os-progress span { display: block; height: 100%; background: var(--ok); }
.os-validation { margin-bottom: 14px; }
.os-validation.ok { border-color: var(--ok); background: var(--ok-soft); }
.os-validation.bad { border-color: var(--crit); }
.os-validation ul { margin: 8px 0 0; padding-left: 18px; }
#os-validation:empty { display: none; }
.os-delta { margin-top: 14px; }
.os-delta h2 { margin: 0; font-size: 15px; }
.os-item { border-top: 1px solid var(--line); padding-top: 10px; scroll-margin-top: 70px; border-radius: 4px; }
.os-item-head { gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.os-op { font: 600 11px var(--font-mono); padding: 1px 6px; border-radius: 4px; }
.os-op-added { color: var(--ok); background: var(--ok-soft); }
.os-op-modified { color: var(--info); background: var(--info-soft); }
.os-op-removed { color: var(--crit); background: var(--crit-soft); }
.os-op-renamed { color: var(--warn); background: var(--warn-soft); }
.os-diff { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.os-line { display: flex; gap: 8px; padding: 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.os-line.add { background: var(--ok-soft); }
.os-line.del { background: var(--crit-soft); }
.os-sign { color: var(--faint); flex: none; width: 10px; user-select: none; }
.tabs + .card, .tabs + .os-delta { margin-top: 14px; }
@media (max-width: 760px) {
  .os-specs { grid-template-columns: 1fr; }
  .os-caps { position: static; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
.page-head h1 .mono { font-size: inherit; }
.empty form { margin-top: 10px; }
/* OpenSpec: a capability's requirements listed under it in the left navigation */
.os-nav { max-height: calc(100vh - 90px); overflow-y: auto; align-content: start; }
.os-cap-reqs { list-style: none; margin: 0 0 6px; padding: 0 0 0 10px; display: grid; gap: 1px; }
.os-cap-reqs a { display: flex; gap: 6px; align-items: baseline; padding: 3px 8px; border-radius: 6px; font-size: 12.5px;
                 color: var(--muted); text-decoration: none; line-height: 1.35; }
.os-cap-reqs a:hover { background: var(--surface-2); color: var(--fg); }
.os-op-dot { flex: none; font: 600 10px var(--font-mono); width: 16px; height: 16px; border-radius: 4px; display: inline-grid; place-items: center; }
.os-cap-head, .os-delta { scroll-margin-top: 70px; }
.os-reqs > .os-delta:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .os-nav { max-height: none; display: block; }
  .os-cap-reqs { display: none; }
}
.os-doc { margin-top: 14px; }
.os-toc { padding: 4px 0; }
.os-toc .os-toc-3 a, .os-toc .os-toc-4 a { padding-left: 20px; }
.os-doc .md h1, .os-doc .md h2, .os-doc .md h3, .os-doc .md h4 { scroll-margin-top: 70px; }
@media (max-width: 760px) { .os-doc .os-cap-reqs { display: grid; } }
/* OpenSpec: the list on the left always in view, the section on screen marked */
.os-nav { position: sticky; top: 64px; z-index: 2; }
.os-nav-title { display: block; padding: 6px 10px 4px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.os-nav a.here { background: var(--accent-soft); color: var(--accent); }
.os-nav .os-cap-reqs a.here { font-weight: 600; }
/* OpenSpec: tasks.md as groups of items with their status */
.os-task-summary { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 12px 20px; margin-top: 14px; }
.os-task-total { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.os-task-total b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.os-task-total span { color: var(--muted); }
.os-task-split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 2px; }
.os-task-split span { flex-basis: 0; min-width: 0; }
.os-task-split .done { background: var(--ok); }
.os-task-split .partial { background: var(--info); }
.os-task-split .todo { background: var(--line); }
.os-task-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.os-task-filter button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 32px; border-radius: 999px;
                         border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 12.5px; cursor: pointer; }
.os-task-filter button span { color: var(--muted); font-variant-numeric: tabular-nums; }
.os-task-filter button.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.os-task-filter button.on span { color: inherit; }
.os-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.os-dot.done { background: var(--ok); }
.os-dot.partial { background: var(--info); }
.os-dot.todo { border: 1.5px solid var(--faint); width: 6px; height: 6px; }
.os-task-source { grid-column: 1 / -1; }
.os-task-empty { margin: 0; padding: 10px 16px; }
.os-task-group { padding: 0; overflow: hidden; scroll-margin-top: 70px; }
.os-task-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.os-task-head h2 { margin: 0; font-size: 15px; flex: 1; min-width: 0; }
.os-task-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.os-ring { --p: 0; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
           background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); }
.os-ring span { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
                font-size: 9.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.os-task-items { list-style: none; margin: -1px 0 0; padding: 0; }
.os-task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 16px; }
.os-task { border-top: 1px solid var(--line); }
.os-task:hover { background: var(--surface-2); }
.os-task-mark { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--faint);
                display: inline-grid; place-items: center; color: var(--accent-fg); box-sizing: border-box; }
.os-task-done .os-task-mark { background: var(--ok); border-color: var(--ok); }
.os-task-partial .os-task-mark { border-color: var(--info); background: conic-gradient(var(--info) 50%, transparent 0); }
.os-task-num { flex: none; min-width: 30px; margin-top: 1px; color: var(--faint); font-size: 12px; }
.os-task-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.os-task-text { overflow-wrap: anywhere; }
.os-task-done .os-task-text { color: var(--muted); }
.os-task-partial .os-task-text { font-weight: 500; }
.os-task-note { font-size: 12px; color: var(--muted); }
.os-task-status { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px;
                  border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.os-task-done .os-task-status { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.os-task-partial .os-task-status { background: var(--info-soft); color: var(--info); border-color: transparent; }
[data-task-list][data-filter="todo"] .os-task:not([data-status="todo"]),
[data-task-list][data-filter="partial"] .os-task:not([data-status="partial"]),
[data-task-list][data-filter="done"] .os-task:not([data-status="done"]) { display: none; }
@media (max-width: 760px) {
  .os-nav { position: static; }
  .os-task-summary { grid-template-columns: 1fr; }
  .os-task { flex-wrap: wrap; }
  .os-task-status { margin-left: 28px; }
}

/* OpenSpec: writing changes, activity and overlaps */
.pill-info { color: var(--info); background: var(--info-soft); }
.os-new-row { gap: 10px; flex-wrap: wrap; align-items: center; }
.os-kind { width: auto; }
.os-label { font-weight: 600; font-size: 13px; }
.os-id { width: 280px; max-width: 100%; }
.os-ok { color: var(--ok); }
.os-bad { color: var(--warn); }
.os-drafting { gap: 10px; align-items: center; color: var(--muted); }
.os-preview { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.os-preview-head { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.os-preview-text { margin: 0; padding: 10px 12px; font: 12.5px/1.6 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
                   max-height: 360px; overflow-y: auto; background: var(--surface); }
.os-checks-inline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.os-checks-inline li { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; }
.os-check-ok { color: var(--ok); background: var(--ok-soft); }
.os-check-warn { color: var(--warn); background: var(--warn-soft); }
.os-check-error { color: var(--crit); background: var(--crit-soft); }
.os-actions-end { gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.os-empty-change summary { cursor: pointer; color: var(--muted); }
.os-empty-change[open] summary { margin-bottom: 12px; }
.os-where { padding: 10px 14px; font-size: 13px; color: var(--muted); }
.os-add-cap { display: flex; gap: 6px; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.os-add-cap input { min-width: 0; font-size: 12.5px; padding: 5px 8px; }
.os-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.os-textarea { min-height: 420px; font: 12.5px/1.6 var(--font-mono); resize: vertical; tab-size: 2; }
.os-checks-side { display: grid; gap: 8px; position: sticky; top: 70px; }
.os-checks-side h2 { margin: 0; color: var(--muted); font-weight: 600; }
.os-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.os-checks li { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.os-format summary { cursor: pointer; color: var(--muted); }
.os-format pre { margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
                 font: 11.5px/1.5 var(--font-mono); white-space: pre-wrap; }
.os-overlap-banner { gap: 8px; }
.os-overlap { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft);
              color: var(--fg); text-decoration: none; font-size: 13.5px; }
.os-overlap:hover { box-shadow: 0 0 0 1px var(--warn); }
.os-overlap-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: var(--surface);
                   display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; }
.os-overlap-sides { align-items: start; }
.os-feed { list-style: none; margin: 0; padding: 0; }
.os-event { display: flex; gap: 12px; padding: 10px 14px; align-items: flex-start; }
.os-event + .os-event { border-top: 1px solid var(--line); }
.os-event.fresh { background: var(--info-soft); }
.os-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600;
             font-size: 12px; background: var(--info-soft); color: var(--info); text-transform: uppercase; }
.os-avatar.you { background: var(--accent-soft); color: var(--accent); }
.os-event.fresh .os-avatar { background: var(--surface); }
.os-event-body { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.os-fresh { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.os-warnings { margin: 8px 0 0; padding-left: 18px; color: var(--warn); }
@media (max-width: 860px) {
  .os-editor-grid { grid-template-columns: 1fr; }
  .os-checks-side { position: static; }
  .os-textarea { min-height: 300px; }
}
/* OpenSpec: versions and starting again */
.os-save-version { gap: 8px; align-items: center; }
.os-save-version input { flex: 1; min-width: 0; }
.os-versions { list-style: none; margin: 0; padding: 0; }
.os-version { display: flex; gap: 12px; align-items: center; padding: 10px 14px; }
.os-version + .os-version { border-top: 1px solid var(--line); }
.os-version-mark { flex: none; width: 18px; text-align: center; color: var(--faint); }
.os-version.manual .os-version-mark { color: var(--warn); }
.os-version-body { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.os-h2 { margin: 0; font-size: 15px; }
.os-danger { border-color: var(--crit-soft); }
.os-danger-row { gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.os-danger-row input[type=text] { width: 260px; max-width: 100%; }
.os-delete { position: relative; }
.os-delete summary { list-style: none; }
.os-delete[open] form { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; z-index: 3; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.os-event-action { margin-left: auto; flex: none; }
.os-file-name { overflow-wrap: anywhere; min-width: 0; font-size: 12px; }

/* OpenSpec workflow: explore → propose → apply → verify → archive */
.os-flow { padding: 18px 16px 14px; }
.os-steps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.os-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.os-step-line { position: absolute; top: 19px; left: calc(50% + 26px); right: calc(-50% + 26px); height: 3px; border-radius: 2px; background: var(--line); }
.os-step-line.done { background: var(--ok); }
.os-step-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; box-sizing: border-box;
               border: 2px solid var(--line); color: var(--faint); background: var(--surface); }
.os-step-done .os-step-dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.os-step-current .os-step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 5px var(--accent-soft); }
.os-step-problem .os-step-dot { background: var(--warn); border-color: var(--warn); color: var(--surface); box-shadow: 0 0 0 5px var(--warn-soft); }
.os-step-title { font-size: 13.5px; margin-top: 4px; }
.os-step-todo .os-step-title { color: var(--muted); font-weight: 500; }
.os-step-current .os-step-title { color: var(--accent); }
.os-step-problem .os-step-title { color: var(--warn); }
.os-step-cmd { font: 12px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.os-step-detail { font-size: 12px; color: var(--faint); }
.os-step-current .os-step-detail { color: var(--accent); font-weight: 600; }
.os-step-problem .os-step-detail { color: var(--warn); font-weight: 600; }
.os-step-done .os-step-detail { color: var(--muted); }
.os-step-card { border-color: var(--accent); display: grid; gap: 12px; }
.os-step-card.problem { border-color: var(--warn); }
.os-step-head { gap: 12px; flex-wrap: wrap; align-items: center; }
.os-step-label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.os-step-card.problem .os-step-label { color: var(--warn); }
.os-step-why { margin: 2px 0 0; font-size: 15px; font-weight: 500; }
.os-side-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.os-side-actions .stack { gap: 6px; align-content: start; }
.os-side-actions .btn { justify-self: start; }
.os-verified { display: grid; gap: 6px; }
.os-verified ul { margin: 0; padding-left: 18px; }
.os-row-flow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.os-mini { display: inline-flex; align-items: center; gap: 3px; }
.os-mini-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700;
               box-sizing: border-box; border: 2px solid var(--line); color: var(--faint); background: var(--surface); }
.os-mini-dot.os-step-done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.os-mini-dot.os-step-current { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 3px var(--accent-soft); }
.os-mini-dot.os-step-problem { background: var(--warn); border-color: var(--warn); color: var(--surface); box-shadow: 0 0 0 3px var(--warn-soft); }
.os-mini-line { width: 10px; height: 2px; background: var(--line); }
.os-mini-line.done { background: var(--ok); }
.os-mini-label { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.os-mini-label.os-step-current { color: var(--accent); }
.os-mini-label.os-step-problem { color: var(--warn); }
.opsx-menu { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.14);
             overflow: hidden; margin-top: 6px; }
.opsx-menu-head { padding: 7px 12px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.opsx-item { display: grid; grid-template-columns: 24px 250px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 7px 12px;
             border: 0; background: none; text-align: left; font: inherit; color: var(--fg); cursor: pointer; }
.opsx-item:hover, .opsx-item.on { background: var(--accent-soft); }
.opsx-item + .opsx-sep { border-top: 1px solid var(--line); }
.opsx-num { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
            background: var(--muted); color: var(--surface); }
.opsx-item.on .opsx-num { background: var(--accent); }
.opsx-num.any { background: none; color: var(--faint); }
.opsx-cmd { font: 600 13px var(--font-mono); overflow-wrap: anywhere; }
.opsx-desc { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .os-steps-row { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .os-step-cmd, .os-step-detail { display: none; }
  .os-step-dot { width: 32px; height: 32px; }
  .os-step-line { top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); }
  .os-side-actions { grid-template-columns: 1fr; }
  .opsx-item { grid-template-columns: 24px minmax(0, 1fr); }
  .opsx-desc { grid-column: 2; }
}
.os-sync-ok { color: var(--ok); }
.os-sync-behind { color: var(--warn); font-weight: 600; }
.os-problem { gap: 8px; }

/* OpenSpec split */
.os-split-order { flex-wrap: wrap; gap: 8px; align-items: center; }
.os-split-chip { padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.os-split-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.os-split-part { gap: 8px; }
.os-split-head { gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.os-split-head .os-id { width: 100%; }
.os-split-after { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.os-split-after legend { color: var(--muted); padding: 0; margin-bottom: 2px; }
.os-split-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.os-split-row select { font-size: 12px; padding: 2px 4px; }
.os-split-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.os-split-checks li { padding: 5px 10px; border-radius: 7px; font-size: 13px; }
.os-big { background: var(--warn-soft); border-color: var(--warn); display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.os-big-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--warn); color: var(--surface); display: grid; place-items: center; font-weight: 700; }
.os-big-text { flex: 1; min-width: 260px; display: grid; gap: 4px; }
.os-big-text span { color: var(--warn); font-size: 13px; }
.os-waits { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.os-part-head { padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.os-part-of { color: var(--info); }
/* changes on origin (#36) */
.os-remote { margin-top: 10px; }
.os-remote-head { padding: 9px 16px; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.os-remote-empty, .os-remote-problems { margin: 0; padding: 9px 16px; }
.os-remote-problems { padding-left: 34px; }
.os-source { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.os-split-start { align-items: center; flex-wrap: wrap; }
.os-split-start select { width: auto; }
.os-mini-label.os-mini-waits { color: var(--muted); }
.os-split-id { gap: 4px; align-items: center; flex-wrap: nowrap; }
.os-split-id .os-id { flex: 1; min-width: 0; }

/* Diagnostics */
.nav-count-warn { background: var(--warn); color: var(--surface); }
.dg .tabs + .card, .dg .tabs + .row { margin-top: 14px; }
.dg-count { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; }
.dg-list { padding: 0; overflow: hidden; }
.dg-row > .btn, .dg-row > .pill { justify-self: end; }
.dg-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 130px auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.dg-row:last-child, .dg-check:last-child { border-bottom: 0; }
.dg-main { display: grid; gap: 2px; min-width: 0; }
.dg-main > * { overflow-wrap: anywhere; }
.dg-title { font-weight: 600; color: var(--fg); text-decoration: none; }
.dg-title:hover { text-decoration: underline; }
.dg-kind { justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.dg-kind-error { background: var(--crit-soft); color: var(--crit); }
.dg-kind-back { background: var(--crit); color: var(--surface); }
.dg-kind-check { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dg-group { padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.dg-check { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.dg-mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--surface); }
.dg-mark-ok { background: var(--ok); }
.dg-mark-info { background: var(--info); }
.dg-mark-warn { background: var(--warn); }
.dg-mark-error { background: var(--crit); }
.dg-section-gap { margin-top: 14px; }
.dg .card + .card, .dg section + section { margin-top: 14px; }
.dg-h1 { overflow-wrap: anywhere; }
.dg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dg-stats .card { display: grid; gap: 2px; padding: 10px 14px; margin-top: 0; }
.dg-pre { margin: 0; font: 12.5px/1.55 var(--font-mono); white-space: pre; overflow-x: auto; max-height: 480px; }
.dg-report[open] { display: grid; gap: 8px; }
.dg-report summary { list-style: none; width: fit-content; }
.dg-report textarea { width: 100%; font-size: 12px; }
@media (max-width: 720px) {
  .dg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dg-row .dg-kind { grid-column: 1 / -1; }
  .dg-row > .btn, .dg-row > .pill { justify-self: start; }
}
.dg-kind-agent { background: var(--info-soft); color: var(--info); }
.dg-guard { margin-top: 14px; }
.dg-guard-row { gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13.5px; }
.dg-guard-row input { width: 72px; }
.dg .dg-stats .card { margin-top: 0; }
.dg .dg-guard-row input { width: 80px; flex: none; }
.dg-kind { white-space: nowrap; }
.dg-table-wrap { overflow-x: auto; }
.dg-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.dg-table th, .dg-table td { padding: 8px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dg-table th { font-size: 12px; font-weight: 500; color: var(--muted); }
.dg-table tr:last-child td { border-bottom: 0; }
.dg-bad { color: var(--warn); font-weight: 600; }
.dg-kind-safety { background: var(--warn-soft); color: var(--warn); }
.dg-fix-row { gap: 8px; flex-wrap: wrap; align-items: center; }
.dg-fix-row select { width: auto; }
.dg .dg-fix { margin-top: 14px; }
.dg-sub { margin-left: 8px; font-weight: 400; }
.dg-quality-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dg-quality-row label { gap: 8px; align-items: center; font-size: 13.5px; }
.dg-quality-row .btn { margin-left: auto; }
.dg-symbols { font: 12px var(--font-mono); color: var(--muted); }
.dg-check-label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.dg-check-label input { width: auto; flex: none; margin: 0; }
.os-requests summary { cursor: pointer; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.os-requests[open] { display: grid; gap: 10px; }
.os-request { border-top: 1px solid var(--line); padding-top: 8px; }
.os-request p { margin: 0; }
.os-request-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Product overview */
.right { text-align: right; }
form.inline { display: inline; }
.seg-links a { display: flex; align-items: center; padding: 6px 12px; font-size: 13px; color: var(--muted); text-decoration: none; background: var(--surface); }
.seg-links a + a { border-left: 1px solid var(--line); }
.seg-links a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.flow-filter { width: 280px; max-width: 100%; }
tr.gone td { opacity: .7; }
.banner-warn { border-left: 3px solid var(--warn); }
.flow-view { display: grid; gap: 8px; }
.flow-canvas { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); }
.flow-canvas svg { display: block; margin: 0 auto; height: auto; }
.row input.flow-filter { flex: 0 1 280px; }
.map-parts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.map-part { scroll-margin: 80px; }
.map-part.flash { animation: part-flash 1.6s ease-out; }
@keyframes part-flash { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
.map-part .links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.toc { position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow-y: auto; gap: 4px; font-size: 13px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc a.sub { padding-left: 12px; font-size: 12.5px; }
.doc-body h2, .doc-body h3 { scroll-margin-top: 16px; }
a.flow-ref code { text-decoration: underline dotted; }

/* Files */
.files { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.files-tree { position: sticky; top: 12px; max-height: calc(100vh - 110px); overflow: auto; gap: 8px; }
.files-viewer { min-width: 0; }
@media (max-width: 860px) { .files { grid-template-columns: minmax(0, 1fr); } .files-tree { position: static; max-height: 50vh; } }
.tree { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tree .tree { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 5px; }
.tree li { margin: 1px 0; }
.tree summary { cursor: pointer; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree summary:hover, .tree-file:hover { background: var(--surface-2); }
.tree-root > summary { display: flex; gap: 6px; align-items: center; }
.tree-file { display: block; padding: 2px 4px 2px 18px; border-radius: 4px; color: var(--fg); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-file.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree-file::before { content: "·"; display: inline-block; width: 12px; margin-left: -14px; color: var(--faint); }
.tree-file.k-markdown::before { content: "M"; color: var(--accent); font-size: 10px; font-weight: 700; }
.tree-file.k-pdf::before { content: "P"; color: var(--crit); font-size: 10px; font-weight: 700; }
.tree-file.k-docx::before { content: "W"; color: var(--info, var(--accent)); font-size: 10px; font-weight: 700; }
.tree-file.k-image::before { content: "▣"; color: var(--ok); }
.tree-file.k-diagram::before { content: "◇"; color: var(--warn); }
.tree-file.k-code::before { content: "‹›"; font-size: 10px; }
.tree-gone { padding: 2px 4px; opacity: .7; }
.tree.found { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tree.found a { display: block; padding: 3px 4px 3px 18px; text-decoration: none; white-space: normal; }
.tree.found .faint { display: block; }
.viewer-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; overflow-wrap: anywhere; }
.pdf-view { width: 100%; height: calc(100vh - 200px); min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.image-view { text-align: center; background: repeating-conic-gradient(var(--surface-2) 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: 8px; padding: 12px; }
.image-view img { max-width: 100%; height: auto; }
.code-view { margin: 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: calc(100vh - 220px); font: 12.5px/1.55 var(--font-mono); white-space: pre; tab-size: 4; }
.code-view code { background: none; padding: 0; font: inherit; }
.code-view code.hljs { background: none; padding: 0; }
.md-diagram { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; text-align: center; }
.docx-view table { border-collapse: collapse; }
.docx-view td, .docx-view th { border: 1px solid var(--line); padding: 4px 8px; }
.docx-view img { max-width: 100%; height: auto; }
.tree-root > summary { list-style: none; }
.tree-root > summary::-webkit-details-marker { display: none; }
.tree-root > summary::before { content: "▸"; color: var(--muted); width: 10px; }
.tree-root[open] > summary::before { content: "▾"; }
.tree-file.k-plantuml::before { content: "◇"; color: var(--info); }
.plantuml-img { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; background: #fff; border-radius: 6px; }

/* Advisor chat threads */
.grid.chat-page { grid-template-columns: var(--chats-w, 300px) minmax(0, 1fr); }
.grid.chat-page.with-thread { grid-template-columns: var(--chats-w, 240px) minmax(0, 1fr) var(--thread-w, 440px); }
.chat-main { position: relative; }
.chats-resize { position: absolute; left: -14px; top: 0; bottom: 0; width: 12px; cursor: col-resize; z-index: 2; touch-action: none; }
.chats-resize::after { content: ""; position: absolute; left: 5px; top: 120px; width: 2px; height: 36px;
  border-radius: 2px; background: var(--line); transition: background .15s, height .15s; }
.chats-resize:hover::after, .chats-resize:focus-visible::after, .thread-resizing .chats-resize::after { background: var(--accent); height: 64px; }
.chats-resize:focus-visible { outline: none; }
.thread-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border-color: var(--accent); gap: 12px; }
.thread-panel-head { gap: 8px; align-items: flex-start; }
.thread-panel-head .grow { flex: 1; min-width: 0; }
.thread-panel-head h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.thread-back { display: none; }
@media (max-width: 1200px) {
  .grid.chat-page.with-thread { grid-template-columns: var(--chats-w, 240px) minmax(0, 1fr); }
  .thread-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(100%, var(--thread-w, 480px)); max-height: none; z-index: 40;
    border-radius: 0; box-shadow: -12px 0 32px rgba(0, 0, 0, .18); }
}
@media (max-width: 860px) {
  .grid.chat-page, .grid.chat-page.with-thread { grid-template-columns: minmax(0, 1fr); }
  .chats-resize { display: none; }
  .thread-panel { width: 100%; }
  .thread-back { display: inline-flex; }
  .thread-resize, .thread-wide { display: none; }
}
.thread-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 8px 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.thread-line.on { border-color: var(--accent); background: var(--accent-soft); }
.thread-line-title { color: var(--fg); text-decoration: none; }
.thread-line-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.thread-start { opacity: .0; transition: opacity .15s; }
.msg:hover .thread-start, .thread-start:focus-within { opacity: 1; }
@media (hover: none) { .thread-start { opacity: 1; } }
.msg.from-thread .msg-body { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px 12px; }
.from-thread-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.from-thread-head b { color: var(--accent); }
.unsent-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 500; }
.composer-hint { margin: 0; font-size: 12.5px; color: var(--warn); }
.sync-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; padding: 7px 8px 7px 10px;
  border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 500; }
.sync-bar.ok { background: var(--ok-soft); color: var(--ok); }
.sent-marker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 11.5px; font-weight: 500; }
.sent-marker::before, .sent-marker::after { content: ""; flex: 1; height: 1px; background: var(--accent); }
.thread-root > summary { cursor: pointer; }
.thread-root[open] + .thread-root-preview { display: none; }
.thread-root .text { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.thread-root-preview { margin: -6px 0 0; }
.send-preview { border-color: var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.send-preview textarea { font-size: 13px; }
.quote-button { position: absolute; z-index: 50; }
.threads-menu { position: relative; }
.threads-menu .menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 260px; display: grid; gap: 2px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.threads-menu .menu-list a { padding: 6px 8px; border-radius: 6px; color: var(--fg); text-decoration: none; gap: 8px; }
.threads-menu .menu-list a:hover { background: var(--surface-2); }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.thread-panel details.menu { position: relative; }
.thread-panel details.menu form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
#thread-send:empty { display: none; }
#thread-send-wait { display: none; margin: 0; }
#thread-send-wait.htmx-request { display: block; }
.thread-resize { position: absolute; left: -6px; top: 0; bottom: 0; width: 12px; cursor: col-resize; z-index: 2; touch-action: none; }
.thread-resize::after { content: ""; position: absolute; left: 5px; top: 50%; width: 2px; height: 36px; margin-top: -18px;
  border-radius: 2px; background: var(--line); transition: background .15s, height .15s; }
.thread-resize:hover::after, .thread-resize:focus-visible::after, .thread-resizing .thread-resize::after { background: var(--accent); height: 64px; margin-top: -32px; }
.thread-resize:focus-visible { outline: none; }
.thread-resizing, .thread-resizing * { cursor: col-resize !important; user-select: none !important; }
.thread-wide[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Diagrams drawn from ```mermaid and ```plantuml blocks */
.diagram-block { margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.diagram-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); }
.diagram-tools > span { margin-right: auto; }
.diagram-canvas { padding: 12px; overflow: auto; text-align: center; max-height: 70vh; }
.diagram-canvas svg { max-width: 100%; height: auto; }
.diagram-canvas .plantuml-img { background: #fff; }
.diagram-block > pre { margin: 0; border: 0; border-radius: 0; }
.diagram-error { margin: 6px 0 2px; color: var(--warn); }

/* Files of a message shown under it */
.file-view > summary { list-style: none; width: max-content; }
.file-view > summary::-webkit-details-marker { display: none; }
.file-view[open] > summary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.file-view-body { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface);
  max-height: 70vh; overflow: auto; }
.file-view-md { font-size: 14px; }
.file-view-text pre { margin: 0; }
.file-view-pdf iframe { width: 100%; height: 70vh; border: 0; background: #fff; }

/* Thread messages, newest first (the default): the reply box and the progress move above the messages. */
.thread-newest > .thread-composer { order: 1; }
.thread-newest > #thread-answer { order: 2; }
.thread-newest > .thread-own { order: 3; display: flex; flex-direction: column-reverse; gap: 12px; }
.thread-newest .thread-messages > .msg + .msg { padding-top: 0; border-top: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.thread-order { gap: 8px; }

/* The branch a task's work goes into: a choice of the folder's branch, a new one or an existing one. */
.wb-choice { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.wb-choice legend { padding: 0 4px; }
.wb-opt { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.wb-more { display: none; gap: 8px; align-items: center; flex-wrap: wrap; padding-left: 24px; }
.wb-more input[name="branchName"] { flex: 1 1 220px; min-width: 0; }
.wb-choice:has(input[value="new"]:checked) .wb-new,
.wb-choice:has(input[value="existing"]:checked) .wb-existing { display: flex; }
.wb-choice .hint { margin: 2px 0 0; }
.wb-card { gap: 8px; }
.wb-line { gap: 8px; align-items: baseline; flex-wrap: wrap; }
.wb-edit > summary { width: fit-content; }
.wb-edit[open] > summary { margin-bottom: 8px; }
.os-take { margin-top: 12px; }
.wb-more label { display: flex; gap: 6px; align-items: center; margin: 0; }
.wb-more select { width: auto; max-width: min(100%, 340px); }

/* Publish as a series of commits: one editable message per commit. */
.series { margin: 0; padding-left: 20px; gap: 10px; }
.series-commit { gap: 4px; }
.series-commit .row { gap: 10px; flex-wrap: wrap; }
.commit-dates > summary { cursor: pointer; }
.commit-dates[open] > summary { margin-bottom: 6px; }
.commit-dates-range { gap: 8px; align-items: center; flex-wrap: wrap; padding-left: 24px; }

/* OpenSpec: changes checked against the code. */
.change-findings { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.change-findings li { display: block; }
.change-findings .pill, .change-findings .mono { margin-right: 6px; }
.os-actions form, .ot-side form { display: inline; }

/* Review remarks on an OpenSpec change. */
.remark-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.remark-list li.done .remark-text { color: var(--muted); }
.remark-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.change-remarks .row form { display: inline; }
.change-remarks input[name="author"] { flex: 1 1 200px; min-width: 0; }
.change-findings li > input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.change-findings .btn-link { background: none; border: 0; padding: 0 4px; color: var(--muted); text-decoration: underline; cursor: pointer; }

.coverage-docs { max-height: 220px; overflow-y: auto; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.coverage-docs label { min-width: 0; }
.coverage-docs .mono { overflow-wrap: anywhere; }
details.review-remarks > summary { cursor: pointer; list-style: none; }
details.review-remarks > summary::-webkit-details-marker { display: none; }
details.review-remarks > summary > span > b::before { content: "▸ "; color: var(--muted); }
details.review-remarks[open] > summary > span > b::before { content: "▾ "; }
details.review-remarks[open] > summary { margin-bottom: 8px; }
.requirement-list details > summary { cursor: pointer; list-style: none; }
.requirement-list details > summary::-webkit-details-marker { display: none; }
.requirement-list textarea, #requirements form.row > textarea { flex: 1 1 260px; min-width: 0; }

/* the documents to draw requirements from: grouped by where they are, filterable */
.doc-picker { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.doc-picker-bar { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-picker-bar .doc-filter { flex: 1 1 auto; min-width: 0; max-width: 360px; }
.doc-picker-bar .doc-count { margin-left: auto; white-space: nowrap; }
.doc-picker-list { max-height: 320px; overflow-y: auto; padding: 4px 6px 8px; }
.doc-group + .doc-group { margin-top: 6px; }
.doc-group-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; align-items: baseline;
    padding: 8px 6px 4px; background: var(--surface); }
.doc-item { display: grid; grid-template-columns: 16px minmax(0, max-content) minmax(0, 1fr); gap: 10px;
    align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.doc-item:hover { background: var(--bg); }
.doc-item:has(input:checked) { background: var(--accent-soft); }
.doc-item[hidden], .doc-group[hidden] { display: none; }
.doc-item input { width: 16px; height: 16px; margin: 0; flex: none; }
.doc-item .doc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .doc-folder { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
    .doc-item { grid-template-columns: 16px minmax(0, 1fr); row-gap: 0; }
    .doc-item .doc-folder { grid-column: 2; }
}

.code-scope { gap: 10px; }
.code-scope label { display: flex; gap: 6px; align-items: center; }
.code-scope select { max-width: 240px; }

/* the Deployment tab: one line per step, details on a click */
.deploy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.deploy-list > li { border-radius: 6px; }
.deploy-list > li:hover { background: var(--bg); }
.deploy-list > li.done .deploy-name { color: var(--muted); }
.deploy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 6px 8px; cursor: pointer; list-style: none; }
.deploy-row::-webkit-details-marker { display: none; }
.deploy-name { font-weight: 600; overflow-wrap: anywhere; }
.deploy-why { flex: 1 1 240px; min-width: 0; }
.deploy-details { padding: 4px 8px 10px 16px; border-left: 2px solid var(--line); margin-left: 8px; }
#deployment input[type=text] { min-width: 0; }
.pr-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pr-items label { align-items: flex-start; gap: 10px; }
.pr-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* IntelliJ: opening task worktrees automatically (#281) */
.ide-auto-open { border-top: 1px solid var(--line); padding-top: 12px; }
.ide-auto-open .row { gap: 8px; align-items: center; }
.ide-auto-open input[type=number] { width: 72px; flex: none; }
.ide-badge { text-decoration: none; white-space: nowrap; }
.ide-chip { font-size: 12px; white-space: nowrap; }
.task-pills { justify-content: flex-end; gap: 6px; }
