/* The visual system, after Plane: a neutral grey scale, Plane's blue (#3F76FF), white pages on a
   light grey frame, thin borders instead of shadows. Dark mode follows Plane's near-black greys. */
:root {
  --canvas: #F5F5F5;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F5F5F5; --surface-3: #FAFAFA;
  --border: #E5E5E5; --border-soft: #F0F0F0;
  --text: #171717; --text-2: #404040; --muted: #636363; --faint: #737373;
  --accent: #3F76FF; --accent-hover: #2F63E6; --accent-text: #FFFFFF; --accent-soft: #ECF1FF; --accent-ink: #1F4FCC;
  --success: #16A34A; --success-text: #FFFFFF;
  --danger: #DC2626; --danger-soft: #FEECEC; --danger-ink: #991B1B; --danger-line: #FBCACA; --danger-text: #FFFFFF; --toast-ok: #86EFAC;
  --warn-soft: #FFF7E6; --warn-line: #FCD9A0; --warn-ink: #8A4B00;
  --code-bg: #171717; --code-text: #EDEDED; --code-muted: #A3A3A3; --code-chip: #262626;
  --shadow: 0 1px 2px rgb(0 0 0 / 4%);
  --shadow-pop: 0 10px 30px rgb(0 0 0 / 12%);
  --st-draft-bg: #F5F5F5; --st-draft: #525252;
  --st-analyzed-bg: #ECF1FF; --st-analyzed: #2F63E6;
  --st-in_progress-bg: #FEF3E2; --st-in_progress: #B45309;
  --st-blocked-bg: #FEECEC; --st-blocked: #DC2626;
  --st-review-bg: #F3EEFF; --st-review: #7C3AED;
  --st-done-bg: #E8F7EE; --st-done: #15803D;
  --st-cancelled-bg: #F5F5F5; --st-cancelled: #737373;
  --st-deferred-bg: #EEF2F7; --st-deferred: #475569;
  --r-btn: 6px; --r-card: 8px; --r-panel: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #121212;
    --bg: #191919; --surface: #1C1C1C; --surface-2: #262626; --surface-3: #1F1F1F;
    --border: #2E2E2E; --border-soft: #262626;
    --text: #EDEDED; --text-2: #C7C7C7; --muted: #A3A3A3; --faint: #8F8F8F;
    --accent: #3F76FF; --accent-hover: #5A8AFF; --accent-text: #FFFFFF; --accent-soft: #1B2A4D; --accent-ink: #A9C2FF;
    --success: #4ADE80; --success-text: #0F0F0F;
    --danger: #F87171; --danger-soft: #3B1A1A; --danger-ink: #FCA5A5; --danger-line: #5C2626; --danger-text: #0F0F0F; --toast-ok: #15803D;
    --warn-soft: #33260F; --warn-line: #5C4618; --warn-ink: #FBBF6A;
    --code-bg: #0F0F0F; --code-text: #EDEDED; --code-muted: #A3A3A3; --code-chip: #262626;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-pop: 0 12px 32px rgb(0 0 0 / 55%);
    --st-draft-bg: #262626; --st-draft: #C7C7C7;
    --st-analyzed-bg: #1B2A4D; --st-analyzed: #8FB0FF;
    --st-in_progress-bg: #3A2A10; --st-in_progress: #FBBF6A;
    --st-blocked-bg: #3B1A1A; --st-blocked: #FCA5A5;
    --st-review-bg: #2B2142; --st-review: #C4B5FD;
    --st-done-bg: #14301F; --st-done: #86EFAC;
    --st-cancelled-bg: #232323; --st-cancelled: #A3A3A3;
    --st-deferred-bg: #1E2633; --st-deferred: #A5B8D0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #121212;
  --bg: #191919; --surface: #1C1C1C; --surface-2: #262626; --surface-3: #1F1F1F;
  --border: #2E2E2E; --border-soft: #262626;
  --text: #EDEDED; --text-2: #C7C7C7; --muted: #A3A3A3; --faint: #8F8F8F;
  --accent: #3F76FF; --accent-hover: #5A8AFF; --accent-text: #FFFFFF; --accent-soft: #1B2A4D; --accent-ink: #A9C2FF;
  --success: #4ADE80; --success-text: #0F0F0F;
  --danger: #F87171; --danger-soft: #3B1A1A; --danger-ink: #FCA5A5; --danger-line: #5C2626; --danger-text: #0F0F0F; --toast-ok: #15803D;
  --warn-soft: #33260F; --warn-line: #5C4618; --warn-ink: #FBBF6A;
  --code-bg: #0F0F0F; --code-text: #EDEDED; --code-muted: #A3A3A3; --code-chip: #262626;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-pop: 0 12px 32px rgb(0 0 0 / 55%);
  --st-draft-bg: #262626; --st-draft: #C7C7C7;
  --st-analyzed-bg: #1B2A4D; --st-analyzed: #8FB0FF;
  --st-in_progress-bg: #3A2A10; --st-in_progress: #FBBF6A;
  --st-blocked-bg: #3B1A1A; --st-blocked: #FCA5A5;
  --st-review-bg: #2B2142; --st-review: #C4B5FD;
  --st-done-bg: #14301F; --st-done: #86EFAC;
  --st-cancelled-bg: #232323; --st-cancelled: #A3A3A3;
  --st-deferred-bg: #1E2633; --st-deferred: #A5B8D0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.6 "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.35; }
button { font: inherit; }
[hidden] { display: none !important; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: isolate; }
.en { unicode-bidi: plaintext; text-align: right; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .menu-item, .navlink { transition: background-color .12s, border-color .12s, color .12s; }
}

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; white-space: nowrap; }
.ws-switch { height: 30px; padding: 0 10px; gap: 6px; font-size: 13px; max-width: 180px; }
.ws-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 4px; }
.navlink { padding: 6px 12px; border-radius: var(--r-btn); color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.search { position: relative; flex: 1; max-width: 420px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 11px; color: var(--muted); }
.search input { width: 100%; height: 38px; padding: 0 40px 0 36px; padding-inline-start: 38px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.search kbd { position: absolute; inset-inline-end: 10px; top: 9px; font: 11px "IBM Plex Mono", monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--surface); }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.live-pill:hover, .live-pill[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.live-pill.busy .dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.live-pill.fail .dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.live-pill .num { display: none; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .live-pill { padding: 0 10px; }
  .live-pill .txt { display: none; }
  .live-pill .num { display: inline; }
  .live-pill .num:empty { display: none; }
}

.view { padding: 24px 32px 48px; max-width: 1600px; margin: 0 auto; }
.view.narrow { max-width: 1180px; }

/* buttons: sm 32, md 38, lg 44 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-btn); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn.icon { width: 34px; padding: 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn.success { background: var(--success); border-color: var(--success); color: var(--success-text); font-weight: 600; }
.btn.success:hover { filter: brightness(1.06); color: var(--success-text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); font-weight: 600; }
.btn.danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.avatar { width: 30px; height: 30px; font-size: 13px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 700; cursor: pointer; }

/* form controls */
.ctl, .input, textarea.input { height: 34px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; padding: 0 10px; }
.input { width: 100%; height: 38px; border-radius: var(--r-btn); padding: 0 12px; font-size: 14px; }
textarea.input { height: auto; min-height: 150px; padding: 12px; line-height: 1.8; resize: vertical; }
.input:focus, .ctl:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.error, .input.error:focus { border-color: var(--danger); }
.input.error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 600; }
.label-sm { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); }
.err-text { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: center; }
.toggle { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); font-size: 14px; cursor: pointer; }
.toggle input, .check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); font-size: 14px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg label:focus-within { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: var(--r-card); padding: 3px; gap: 2px; }
.tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; }
.chip.lg { height: 26px; padding: 0 10px; font-size: 13px; }
.chip.route { background: var(--accent-soft); color: var(--accent); }
.chip.hot { background: var(--danger-soft); color: var(--danger); }
.chip.risk { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.chip.ok { background: var(--st-done-bg); color: var(--st-done); }
.chip.dark { background: var(--text); color: var(--bg); }
.chip.st-draft { background: var(--st-draft-bg); color: var(--st-draft); }
.chip.st-analyzed { background: var(--st-analyzed-bg); color: var(--st-analyzed); }
.chip.st-in_progress { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.chip.st-blocked { background: var(--st-blocked-bg); color: var(--st-blocked); }
.chip.st-review { background: var(--st-review-bg); color: var(--st-review); }
.chip.st-done { background: var(--st-done-bg); color: var(--st-done); }
.chip.st-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.chip.st-deferred { background: var(--st-deferred-bg); color: var(--st-deferred); }

/* page header */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.page-head .tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 20px 22px; }
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cmd { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-btn); padding: 6px 6px 6px 12px; }
.cmd code { flex: 1; font-size: 12.5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd.dark { background: var(--code-chip); border-color: transparent; }
.cmd.dark code { color: #fff; }
.next-step { background: var(--code-bg); color: var(--code-text); border-radius: var(--r-panel); padding: 18px 20px; }
.next-step h2 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.next-step p { margin: 0 0 12px; font-size: 13px; color: var(--code-muted); }
.next-step .btn { background: #6D8FF0; border-color: #6D8FF0; color: #0F1218; font-weight: 600; }

/* decision strip */
.decide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.decide a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text); }
.decide a:hover { color: var(--text); border-color: var(--accent); }
.decide .ico { width: 40px; height: 40px; border-radius: var(--r-card); display: flex; align-items: center; justify-content: center; flex: none; }
.decide strong { display: block; font-size: 15px; }
.decide small { font-size: 13px; color: var(--muted); }
.decide .go { font-size: 14px; font-weight: 600; white-space: nowrap; }
.decide .blocked { border-color: var(--danger-line); }
.decide .blocked .ico { background: var(--st-blocked-bg); color: var(--st-blocked); }
.decide .blocked .go { color: var(--st-blocked); }
.decide .review .ico { background: var(--st-review-bg); color: var(--st-review); }
.decide .review .go { color: var(--st-review); }
.decide .quiet { color: var(--muted); }

/* board */
.board { display: grid; grid-template-columns: repeat(var(--cols), minmax(248px, 1fr)) var(--rail, 56px); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--surface-2); border-radius: var(--r-panel); padding: 10px; min-height: 420px; }
.column h2 { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; font-size: 14px; font-weight: 600; }
.column h2 .n { color: var(--muted); font-weight: 500; }
.column .list { display: flex; flex-direction: column; gap: 8px; }
/* done tasks, a page at a time */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-start: 10px; }
.pager-at { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.column .empty { color: var(--muted); font-size: 13px; padding: 6px 4px; }
.rail { background: var(--surface-2); border: 0; border-radius: var(--r-panel); min-height: 420px; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; color: var(--text-2); }
.rail:hover { background: var(--border-soft); }
.rail span { writing-mode: vertical-rl; font-size: 14px; font-weight: 600; }

.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.card:hover { border-color: var(--accent); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.card-top .card-title { flex: 1; min-width: 0; }
.card-proj { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.card-proj i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.card-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 14px; line-height: 1.45; color: var(--text); unicode-bidi: plaintext; text-align: right; }
.card-title:hover { color: var(--accent); }
.card-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.card .kebab, .card .chips a, .card .note a, .card .parent a, .card .kids { position: relative; z-index: 1; }
/* a parent's subtasks inside its card: progress in the summary, the list folded until opened */
.card .kids { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface-3); font-size: 12.5px; }
.card .kids > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; color: var(--text-2); }
.card .kids > summary::-webkit-details-marker { display: none; }
.card .kids > summary::before { content: '◂'; color: var(--muted); font-size: 11px; transition: transform .15s; }
.card .kids[open] > summary::before { transform: rotate(90deg); }
.kids-bar { flex: 1; min-width: 30px; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.kids-bar i { display: block; height: 100%; background: var(--st-done); border-radius: 99px; }
.card .kids .kids-count { margin-inline-start: 0; }
.card .kids ul { list-style: none; margin: 0; padding: 2px 8px 8px; display: grid; gap: 4px; border-top: 1px solid var(--border); padding-top: 6px; }
.card .kids li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card .kids li.off a { text-decoration: line-through; color: var(--muted); }
.card .kids li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); unicode-bidi: plaintext; }
.card .kids li a:hover { color: var(--accent); }
.kid-st { display: inline-flex; flex: none; }
.kid-proj { flex: none; font-size: 11px; color: var(--muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .parent { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.note-box { margin-top: 8px; padding: 8px 9px; border-radius: var(--r-btn); font-size: 12.5px; line-height: 1.55; display: flex; gap: 6px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.note-box.q { background: var(--danger-soft); color: var(--danger-ink);
  /* a long question stays inside its card: words break, four lines show, the rest is on the task page */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.note-box.wait { background: var(--st-in_progress-bg); color: var(--warn-ink); }
.note-box.waits .wait-list { min-width: 0; flex: 1; }
.note-box.waits ul { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.note-box.waits a { position: relative; z-index: 1; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.note-box.waits .wait-st { opacity: .85; }
.note-box.waits .wait-why { color: var(--text); opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-box.checks { background: var(--st-review-bg); color: var(--st-review); }
/* in review: the link to its pull request, and the green mark once it is merged and only waits for the owner */
.note-box.pr-open, .note-box.merged { flex-direction: column; gap: 8px; }
.note-box.pr-open .row, .note-box.merged .row { display: flex; gap: 6px; align-items: center; }
.note-box .pr-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface); color: var(--st-review); border: 1px solid color-mix(in srgb, var(--st-review) 35%, transparent); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.note-box .pr-link:hover { background: var(--st-review); color: var(--surface); }
.card.merged { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); border-inline-start: 4px solid var(--success); background: color-mix(in srgb, var(--st-done-bg) 35%, var(--surface)); }
.card.merged:hover { border-color: var(--success); }
.merged-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 10px; margin-bottom: 8px; border-radius: 999px; background: var(--success); color: var(--success-text); font-size: 12px; font-weight: 600; }
.note-box.merged { background: var(--st-done-bg); color: var(--st-done); }
.note-box.merged a { position: relative; z-index: 1; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.note-box.merged .why { font-size: 12px; opacity: .9; }
.note-box.merged .btn { position: relative; z-index: 1; align-self: stretch; }
.column h2 .ready { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--st-done-bg); color: var(--st-done); font-size: 12px; font-weight: 600; }
button.ready { border: 0; cursor: pointer; font-family: inherit; }
button.ready:hover { background: var(--st-done); color: var(--surface); }
.card .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); }
.card .foot span { display: inline-flex; align-items: center; gap: 5px; }
.kebab { width: 32px; height: 32px; margin: -6px; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.kebab:hover { background: var(--surface-2); color: var(--text); }

/* menu */
.menu { position: absolute; z-index: 40; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 6px; }
.menu .label-row { font-size: 11.5px; color: var(--muted); padding: 4px 10px 2px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 13.5px; text-align: start; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--border-soft); margin: 4px 0; }

/* banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-card); font-size: 14px; margin-bottom: 16px; }
.banner.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner.ok { background: var(--st-done-bg); color: var(--st-done); }
.banner.claim { background: var(--st-in_progress-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.banner .grow { flex: 1; }

/* task page */
.task-head { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 18px; }
.task-head .main { flex: 1; min-width: 0; }
.task-head .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.task-head h1 { margin: 0; font-size: 26px; font-weight: 700; }
.task-head .meta { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.task-head .actions { display: flex; gap: 8px; flex: none; padding-top: 30px; }
/* the task's path: draft → analyzed → in progress → review → done, and whose move it is */
.status-path { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; margin-top: 14px; }
.status-path ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.status-path li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.status-path .sp-bar { width: 36px; height: 2px; border-radius: 1px; background: var(--border); margin-inline: 6px; }
.status-path .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.status-path li.done { color: var(--text-2); }
.status-path li.done .dot { background: var(--st-done); border-color: var(--st-done); color: var(--surface); }
.status-path li.done .sp-bar, .status-path li.now .sp-bar, .status-path li.blocked .sp-bar { background: var(--st-done); }
.status-path li.now { color: var(--text); font-weight: 600; }
.status-path li.now .dot { border: 5px solid var(--accent); }
.status-path li.blocked { color: var(--st-blocked); font-weight: 600; }
.status-path li.blocked .dot { background: var(--st-blocked-bg); border-color: var(--st-blocked); color: var(--st-blocked); }
.status-path.off ol { opacity: .5; }
.status-path .turn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.status-path .turn.you { background: var(--accent-soft); color: var(--accent-ink); }
.status-path .turn.agent { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.status-path .turn .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) { .status-path .turn .pulse { animation: pm-pulse 1.8s ease-in-out infinite; } }
@keyframes pm-pulse { 50% { opacity: .35; } }
@media (max-width: 860px) {
  .task-head .main { width: 100%; }
  .status-path li:not(.now):not(.blocked) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .status-path .sp-bar { width: 10px; margin-inline: 4px; }
}

.body-text { margin: 0; line-height: 1.9; white-space: pre-wrap; }
.criteria { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.criteria li { display: flex; gap: 10px; align-items: flex-start; }
.criteria .box { width: 20px; height: 20px; border-radius: 6px; flex: none; margin-top: 2px; display: flex; align-items: center; justify-content: center; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); }
.criteria .box.done { background: var(--success); border-color: var(--success); color: var(--success-text); }
.criteria .proof { display: block; font-size: 12px; color: var(--muted); text-align: right; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress div { height: 100%; background: var(--success); }
.files { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.timeline .badge { width: 30px; height: 30px; border-radius: var(--r-btn); flex: none; display: flex; align-items: center; justify-content: center; }
.timeline .what { font-size: 14px; }
.timeline .quote { font-size: 13.5px; color: var(--text-2); background: var(--bg); border-radius: var(--r-btn); padding: 8px 10px; margin-top: 6px; white-space: pre-wrap; }
.timeline time { font-size: 12.5px; color: var(--muted); flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.why { margin-top: 14px; padding: 12px; background: var(--accent-soft); border-radius: var(--r-btn); font-size: 13px; color: var(--accent-ink); line-height: 1.7; }
.inline-add { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-add input { flex: 1; }

/* blocked */
.questions { background: var(--surface); border: 1px solid var(--danger-line); border-radius: var(--r-panel); overflow: hidden; margin-bottom: 18px; }
.questions .head { background: var(--danger-soft); color: var(--danger-ink); padding: 14px 22px; display: flex; align-items: center; gap: 10px; }
.questions .head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.questions .head span { margin-inline-start: auto; font-size: 13px; }
.questions .body { padding: 22px; display: flex; flex-direction: column; gap: 26px; }
.questions fieldset { border: 0; margin: 0; padding: 0; }
.questions legend { font-weight: 600; font-size: 15.5px; padding: 0; margin-bottom: 10px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 10px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); font-size: 14px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.opt input { margin: 0; accent-color: var(--accent); }
.questions .foot { border-top: 1px solid var(--border-soft); padding: 16px 22px; display: flex; align-items: center; gap: 10px; background: var(--surface-3); flex-wrap: wrap; }
.questions .foot p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; min-width: 220px; }

/* review */
.decision { background: var(--surface); border: 1px solid var(--st-review-bg); border-color: color-mix(in srgb, var(--st-review) 30%, transparent); border-radius: var(--r-panel); padding: 18px 22px; display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.decision .evidence { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.file-row .path { flex: 1; text-align: right; }
.add { color: var(--success); } .del { color: var(--danger); }

/* form */
.form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 28px 30px; display: flex; flex-direction: column; gap: 24px; }
.form fieldset { border: 0; margin: 0; padding: 0; }
.form legend { padding: 0; margin-bottom: 6px; }
.form details { border: 1px solid var(--border-soft); border-radius: var(--r-card); padding: 12px 14px; background: var(--surface-3); }
.form summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.form .advanced { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--border-soft); padding-top: 20px; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; }
.steps .num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.steps .num.on { background: var(--accent); color: var(--accent-text); }
.tips { background: var(--accent-soft); border-radius: var(--r-panel); padding: 16px 18px; font-size: 13.5px; color: var(--accent-ink); line-height: 1.8; }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-3); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: var(--surface-3); }
.bar { display: flex; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 120px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* family + epic */
.family-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.epic-card { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text); }
.epic-card:hover { border-color: var(--accent); color: var(--text); }
.segs { display: flex; gap: 4px; margin-top: 10px; }
.segs i { height: 8px; border-radius: 99px; flex: 1; background: var(--border); }
.level-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--border); }
.unit-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-btn); background: var(--bg); border: 1px solid var(--border); font-size: 13px; }
.layers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.layer { border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; }
.layer.new { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px; }
.steps-tree { list-style: none; margin: 0; padding: 0; }
.steps-tree > li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
.steps-tree .rail-col { display: flex; flex-direction: column; align-items: center; }
.steps-tree .dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.steps-tree .dot.active { background: var(--st-in_progress); color: var(--surface); }
.steps-tree .dot.done { background: var(--success); color: var(--success-text); }
.steps-tree .line { flex: 1; width: 2px; background: var(--border); margin: 4px 0; }
.steps-tree .step { border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 14px; background: var(--surface); }

/* login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 36px 34px; box-shadow: var(--shadow-pop); }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login > p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.pw { position: relative; }
.pw input { padding-inline-start: 44px; direction: ltr; text-align: left; }
.pw button { position: absolute; inset-inline-start: 6px; top: 5px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.login .help { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--muted); line-height: 1.8; }

/* empty, skeleton, dialog, toast */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 64px 16px; }
.empty-state .ico { width: 56px; height: 56px; border-radius: var(--r-panel); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.empty-state h2 { margin: 0; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 14px; max-width: 360px; }
.sk { background: linear-gradient(90deg, var(--border-soft), var(--surface-2)); border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: pulse 1.4s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .55; } }
.sk-card { background: var(--surface); border-radius: var(--r-btn); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
dialog { border: 1px solid var(--border); border-radius: var(--r-panel); padding: 22px; width: min(440px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgb(22 26 34 / 40%); }
dialog h2 { margin: 0 0 8px; font-size: 17px; }
dialog p { margin: 0 0 14px; font-size: 14px; color: var(--text-2); }
dialog .row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toasts { position: fixed; inset-inline: 16px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-card); font-size: 14px; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-pop); max-width: 100%; }
.toast-ok { display: inline-flex; color: var(--toast-ok); }
.toast.error { background: var(--danger); color: var(--danger-text); }
.toast-action { margin-inline-start: 6px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.toast-action:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* mobile */
.mobile-only { display: none; }
@media (max-width: 860px) {
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .topbar .nav, .topbar .search, .topbar .hide-sm { display: none; }
  .mobile-only { display: flex; }
  .view { padding: 16px 16px 96px; }
  .split, .form-wrap, .family-grid, .decide { grid-template-columns: minmax(0, 1fr); }
  .layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-head { flex-direction: column; gap: 12px; }
  .task-head .actions { padding-top: 0; flex-wrap: wrap; }
  .task-head h1 { font-size: 21px; }
  .page-head .tools { margin-inline-start: 0; width: 100%; }
  .page-head .tools > * { flex: 1 1 140px; }
  .ctl { width: 100%; }
  .board { display: none; }
  .status-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; }
  .status-tabs button { flex: none; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; cursor: pointer; }
  .status-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
  .mobile-list { display: flex; flex-direction: column; gap: 10px; }
  .action-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; gap: 10px; padding: 12px 16px 20px; background: var(--surface); border-top: 1px solid var(--border); }
  .action-bar .btn { flex: 1; height: 44px; }
  .btn, .kebab { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .options { grid-template-columns: 1fr; }
  .decision { flex-direction: column; align-items: stretch; }
  .form { padding: 20px 18px; }
  .form .advanced { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .status-tabs, .mobile-list, .action-bar-spacer { display: none; } }

/* searchable picker */
.combo { position: relative; }
.combo > svg { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo-input { width: 100%; padding-inline-end: 30px; cursor: text; }
.combo .input.combo-input { height: 42px; }
.combo-list { position: absolute; z-index: 45; top: calc(100% + 4px); inset-inline: 0; min-width: 260px; max-height: 340px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.combo-group { font-size: 11.5px; color: var(--muted); padding: 8px 10px 2px; }
.combo-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.combo-option.active, .combo-option:hover { background: var(--surface-2); }
.combo-option[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.combo-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.combo-hint.has { color: var(--text-2); font-weight: 600; }
.combo-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* quick project filters */
.quick { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.quick-label { font-size: 13px; color: var(--muted); margin-inline-end: 2px; }
.quick-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding-block: 0; padding-inline: 14px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow); }
.quick-btn:hover { border-color: var(--accent); color: var(--accent); }
.quick-btn .mono { font-size: 12.5px; }
.quick-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.quick-n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.quick-btn[aria-pressed="true"] .quick-n { background: rgb(255 255 255 / 25%); color: inherit; }
@media (max-width: 860px) { .quick-btn { height: 40px; } }

/* rendered descriptions: each block keeps its own language's direction */
.md { line-height: 1.85; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md-table-wrap { margin: 0 0 12px; text-align: start; }
.md-h { margin: 18px 0 8px; font-size: 15px; font-weight: 700; text-align: start; }
h3.md-h { font-size: 17px; }
.md-list { padding-inline-start: 22px; }
.md-list li { margin-bottom: 4px; }
.md-task { list-style: none; }
.md-task input { margin: 0; margin-inline-end: 4px; vertical-align: middle; }
.md-quote { border-inline-start: 3px solid var(--border); padding: 2px 12px; color: var(--text-2); }
.md-code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .86em; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.md-pre { background: var(--surface-2); border-radius: var(--r-btn); padding: 12px 14px; overflow-x: auto; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.6; text-align: left; }
.md-details { margin: 6px 0; border: 1px solid var(--border); border-radius: var(--r-btn); padding: 6px 10px; }
.md-details > summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.md-details[open] > summary { margin-bottom: 6px; }
.md-hr { border: 0; height: 1px; background: var(--border-soft); margin: 16px 0; }
.md-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-btn); }
.md-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.6; }
.md-table th, .md-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); text-align: start; vertical-align: top; }
.md-table th { background: var(--surface-3); font-weight: 600; color: var(--text-2); }
.md-table tr:last-child td { border-bottom: 0; }
.md-url { word-break: break-all; }

/* analysis costs — token colours validated for colour-blind separation in both modes */
:root { --tok-write: #C77700; --tok-read: #6B3FC4; --tok-output: #008F9C; --tok-fresh: #2E4FC7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tok-write: #B87812; --tok-read: #8E6BE0; --tok-output: #1A9BA8; --tok-fresh: #5B7FE8; } }
:root[data-theme="dark"] { --tok-write: #B87812; --tok-read: #8E6BE0; --tok-output: #1A9BA8; --tok-fresh: #5B7FE8; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 18px; }
.tile.featured { border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .v .of { font-size: 18px; color: var(--muted); font-weight: 500; }
.tile .n { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.costs-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.run-bars { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 24px; --who: 170px; --amount: 70px; }
.run-bars .cap-line { position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--who) + (100% - var(--who) - var(--amount)) * var(--cap)); border-inline-start: 2px dashed var(--faint); }
.run-bars .cap-label { position: absolute; top: 0; inset-inline-start: calc(var(--who) + (100% - var(--who) - var(--amount)) * var(--cap) / 100% + 6px); font-size: 12px; color: var(--muted); }
.run-row { display: grid; grid-template-columns: var(--who) minmax(0, 1fr) var(--amount); align-items: center; }
.run-row .who { padding-inline-end: 12px; min-width: 0; }
.run-row .who a { font-size: 12px; color: var(--text-2); display: block; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.run-row .track { height: 22px; background: var(--surface-2); border-radius: 4px; position: relative; }
.run-row .amount { font-size: 13px; text-align: left; padding-inline-start: 10px; font-weight: 600; }
.fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; display: block; }
.fill.ok { background: var(--success); }
.fill.fail { background: var(--danger); }
.fill.stale { background: var(--st-in_progress); }
.fill.run { background: repeating-linear-gradient(135deg, var(--faint) 0 4px, var(--border) 4px 8px); }
.legend i.fill { position: static; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tok-bar { display: flex; gap: 2px; border-radius: 4px; overflow: hidden; }
.tok-bar span { display: block; height: 100%; }
.tok-write { background: var(--tok-write); } .tok-read { background: var(--tok-read); } .tok-output { background: var(--tok-output); } .tok-fresh { background: var(--tok-fresh); }
.tok-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.tok-list li { display: flex; align-items: center; gap: 8px; }
.tok-list i, .legend i[class^="tok-"] { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.tok-list .grow { flex: 1; }
.chip.out-ok { background: var(--st-done-bg); color: var(--st-done); }
.chip.out-fail { background: var(--st-blocked-bg); color: var(--st-blocked); }
.chip.out-run, .chip.out-stale { background: var(--surface-2); color: var(--text-2); }
.progress.cap { height: 8px; margin: 8px 0 4px; }
.progress.cap div { background: var(--accent); }
.progress.cap div.warn { background: var(--st-in_progress); }
.cap-warn { font-size: 12.5px; color: var(--st-in_progress); display: flex; gap: 6px; align-items: center; }
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .costs-grid { grid-template-columns: 1fr; }
  .run-bars { --who: 120px; --amount: 56px; }
}

/* settings */
.settings { display: flex; flex-direction: column; gap: 18px; max-width: 1180px; }
.set-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.set-head p { margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.set-head-row { display: flex; align-items: flex-start; gap: 16px; }
.set-head-row .set-head { flex: 1; min-width: 0; }
.set-head-row > .btn { margin-top: 4px; }
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.set-nav-group { display: flex; flex-direction: column; gap: 2px; }
.set-nav-title { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 10px 4px; }
.set-nav-item { padding: 7px 10px; border-radius: var(--r-btn); color: var(--text-2); font-size: 14px; text-decoration: none; }
.set-nav-item:hover { background: var(--surface-2); color: var(--text); }
.set-nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.set-nav-item:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.set-nav-menu { display: none; width: 100%; }
.set-content { min-width: 0; }
.set-crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 860px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set-nav { display: none; }
  .set-nav-menu { display: block; height: 42px; }
}
.set-card h2 { margin: 0; font-size: 16px; font-weight: 700; }
.set-card .sub { margin: 2px 0 14px; color: var(--muted); font-size: 13.5px; }
.set-table tbody tr { cursor: default; }
.set-table tbody tr:hover td { background: transparent; }
.sel { height: 36px; min-width: 110px; padding: 0 10px; border-radius: var(--r-btn); font-size: 14px; }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.level { border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-3); }
.level .sel { width: 100%; }
.level-k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.rules { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.sw-gap { width: 40px; flex: none; }
.preview { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-btn); background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; }
.sw { position: relative; width: 40px; height: 24px; border-radius: 99px; border: 0; padding: 0; background: var(--faint); flex: none; cursor: pointer; }
.sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"]::after { inset-inline-start: 19px; }
.sw:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.sw:disabled { opacity: .5; cursor: not-allowed; }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); }
.ok-text { color: var(--success); }
.warn-text { color: var(--warn-ink); }
.adv-list { padding: 0; overflow: hidden; }
.adv-row { display: grid; grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1fr) 160px 150px auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.adv-row:last-child { border-bottom: 0; }
.adv-badge { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.adv-focus { font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.adv-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.adv-actions { display: flex; align-items: center; gap: 8px; }
.adv-form { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.adv-form h2 { margin-bottom: 14px; }
.adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.adv-grid .sel { width: 100%; height: 42px; }
@media (max-width: 860px) {
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adv-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .adv-row > :nth-child(3), .adv-row > :nth-child(4), .adv-row > :nth-child(5) { grid-column: 2 / -1; }
  .adv-row > .adv-actions { grid-column: 3; grid-row: 1; align-self: start; }
  .adv-grid { grid-template-columns: 1fr; }
  .adv-grid > * { grid-column: auto !important; }
  .set-head-row { flex-direction: column; }
}

/* analysis dialog — "anz-", not "ad-": ad blockers hide .ad-head and .ad-body */
/* plain block flow: the dialog itself scrolls and the actions stay pinned, so no browser can
   shrink the header or the options away */
dialog.anz-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow-y: auto; }
.anz-dialog form { display: block; }
.anz-head { padding: 20px 22px 4px; }
.anz-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.anz-body { padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.anz-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anz-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.anz-set legend, .anz-legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.anz-legend-note { font-weight: 400; color: var(--muted); font-size: 13px; }
.anz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anz-list { display: flex; flex-direction: column; gap: 8px; }
.anz-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); font-size: 14px; cursor: pointer; }
.anz-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.anz-opt small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.anz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.anz-opt.off { opacity: .65; cursor: not-allowed; }
.anz-opt .grow { flex: 1; }
.anz-cost { background: var(--surface-2); border-radius: var(--r-card); padding: 12px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; }
.anz-line { display: flex; justify-content: space-between; gap: 12px; }
.anz-line.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; font-weight: 700; }
.anz-foot { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-3); }
@media (max-width: 560px) { .anz-grid { grid-template-columns: 1fr; } }

/* advanced analysis report */
.adv-panel .kv-chips, .adv-sum .kv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adv-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.adv-tabs button { height: 40px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font-size: 14.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.adv-tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.adv-content { padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.adv-content h3 { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.adv-content ul, .adv-content ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.adv-content .banner { margin-bottom: 0; }
.decisions { display: flex; flex-direction: column; }
.dec { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.dec:first-child { border-top: 0; }
.chip.part { background: var(--warn-soft); color: var(--warn-ink); }
.note-card { border: 1px solid var(--border-soft); border-radius: var(--r-card); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-3); }
.note-top { display: flex; gap: 6px; align-items: center; }
.evidence { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }

/* code map page */
.map-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.map-tiles .v { font-size: 24px; }
.map-owns { margin: 12px 0; font-size: 14px; line-height: 1.8; }
.map-list { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.map-h3 { margin: 12px 0 6px; font-size: 14px; font-weight: 600; }
.map-json { font-size: 12px; max-height: 420px; overflow: auto; text-align: left; white-space: pre; }
.build-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border-soft); }
/* GitHub settings */
.gh-app { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.gh-badge { width: 48px; height: 48px; border-radius: 12px; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.gh-head { display: flex; align-items: flex-end; gap: 12px; padding: 18px 20px 12px; flex-wrap: wrap; }
.gh-head h2 { margin: 0; font-size: 16px; }
.gh-row { display: grid; grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border-soft); }
@media (max-width: 860px) {
  .map-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh-app { grid-template-columns: 48px minmax(0, 1fr); }
  .gh-app > a { grid-column: 1 / -1; }
  .gh-row { grid-template-columns: 40px minmax(0, 1fr); }
  .gh-row > :nth-child(n+3) { grid-column: 2; }
}

/* project removal */
dialog.rm-dialog { width: min(520px, calc(100% - 24px)); }
dialog.mem-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.mem-warn { color: var(--warn-ink); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mem-keep { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; }
.mem-keep[hidden] { display: none; }
.rm-list { margin: 0 0 14px; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* project page */
.pp-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.pp-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; text-transform: lowercase; }
.pp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-title h1 { margin: 0; font-size: 24px; font-weight: 700; }
.pp-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.pp-tabs { margin-bottom: 16px; }
.pp-tabs a { height: 42px; display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.pp-tabs a[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.pp-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pp-tiles .v { font-size: 24px; }
.pp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.pp-row:first-of-type { border-top: 0; }
aside .pp-row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 860px) {
  .pp-head { flex-wrap: wrap; }
  .pp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* analysis page */
.ap-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: 12.5px; text-align: right; }
a.ap-run { color: var(--text); text-decoration: none; border-radius: 8px; padding-inline: 6px; }
a.ap-run:hover { background: var(--surface-3); }
a.ap-run.on { background: var(--accent-soft); }
@media (max-width: 860px) { .ap-files { grid-template-columns: 1fr; } }

/* execution outside the owner's machine (boards 25–28) */
.exec-dialog form { max-width: 620px; }
.exec-chs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.exec-ch { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.exec-ch:has(input:checked) { border-color: var(--accent); background: var(--st-analyzed-bg); }
.exec-ch.off { opacity: .6; cursor: not-allowed; }
.exec-ch input { margin-top: 4px; }
.exec-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.exec-steps li { display: flex; gap: 10px; align-items: flex-start; }
.exec-steps .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--st-done-bg); color: var(--st-done); margin-top: 2px; }
.exec-steps li.now .dot { background: var(--st-analyzed-bg); color: var(--st-analyzed); }
.exec-steps li.now { font-weight: 600; }
.exec-proofs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.exec-proofs li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.exec-proofs li:first-child { border-top: 0; }
.exec-proofs .chip { flex: none; }
.exec-proofs .grow { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .exec-proofs li { flex-wrap: wrap; } }
.exec-pr { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 12px; border-color: color-mix(in srgb, var(--st-review) 35%, transparent); }
.exec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.exec-evidence { margin: 0 0 18px; font-size: 13.5px; }
.exec-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) {
  .exec-pr { grid-template-columns: 1fr; }
  .exec-pr .gh-badge { display: none; }
  .exec-cards { grid-template-columns: 1fr; }
}

/* the executor's changes, file by file */
.diff-file { border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; overflow: hidden; }
.diff-file > summary { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; font-size: 13px; background: var(--surface-2); list-style: none; }
.diff-file > summary::-webkit-details-marker { display: none; }
.diff-file .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-wrap { overflow-x: auto; max-height: 560px; overflow-y: auto; }
.diff { border-collapse: collapse; width: 100%; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.55; }
.diff td { padding: 0 8px; white-space: pre; vertical-align: top; }
.diff td.ln { width: 1%; color: var(--muted); text-align: right; user-select: none; border-inline-end: 1px solid var(--border); }
.diff tr.add td.code { background: color-mix(in srgb, var(--st-done) 14%, transparent); }
.diff tr.add td.ln { background: color-mix(in srgb, var(--st-done) 20%, transparent); }
.diff tr.del td.code { background: color-mix(in srgb, var(--danger, #B42318) 12%, transparent); }
.diff tr.del td.ln { background: color-mix(in srgb, var(--danger, #B42318) 18%, transparent); }
.diff tr.hunk td { background: var(--st-analyzed-bg); color: var(--st-analyzed); padding: 2px 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }

/* the assistant (board 29): bottom-left button, side panel over the page */
.as-fab { position: fixed; left: 22px; bottom: 22px; z-index: 60; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); font-size: 22px; cursor: pointer; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.as-fab:hover { background: var(--accent-hover); }
/* a page with a bottom action bar on the phone: the assistant button sits above it */
@media (max-width: 860px) { body:has(.action-bar.mobile-only) .as-fab { bottom: 92px; } }
.as-panel { position: fixed; left: 20px; top: 76px; bottom: 20px; width: min(420px, calc(100vw - 40px)); z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; }
.as-panel[hidden], .as-fab[hidden] { display: none; }
.as-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.as-head .grow { flex: 1; min-width: 0; }
.as-seen { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.as-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.as-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.as-msg.me { align-self: flex-start; background: var(--surface-2); border-start-end-radius: 4px; white-space: pre-wrap; }
.as-msg.bot { align-self: flex-end; background: var(--st-analyzed-bg); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-end-start-radius: 4px; }
.as-msg.bot.hint { background: none; border: 0; display: flex; gap: 6px; align-items: center; }
.as-msg.done { align-self: flex-end; background: var(--st-done-bg); font-size: 13.5px; }
.as-msg.md > :first-child { margin-top: 0; }
.as-msg.md > :last-child { margin-bottom: 0; }
.as-msg.md ul, .as-msg.md ol { margin: 4px 0; padding-inline-start: 18px; }
.as-msg.md p { margin: 4px 0; }
.as-plan { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--warn-ink, #B42318); border-color: color-mix(in srgb, var(--danger, #B42318) 35%, transparent); }
.as-plan ol { margin: 4px 0 8px; padding-inline-start: 18px; font-size: 13.5px; }
.as-plan .row, .as-foot .row { display: flex; gap: 8px; align-items: flex-end; }
.as-foot { padding: 8px 10px 10px; border-top: 1px solid var(--border); }
.as-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.as-chip { cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); }
.as-input { flex: 1; resize: none; min-height: 38px; max-height: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
@media (max-width: 560px) { .as-panel { left: 8px; right: 8px; width: auto; top: 64px; bottom: 8px; } .as-fab { left: 14px; bottom: 14px; } }

/* the audit before merging (boards 30–31) */
.audit-lenses { display: flex; flex-direction: column; gap: 6px; }
.audit-lens { display: grid; grid-template-columns: 22px minmax(0, 1fr) 110px; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; }
.audit-lens.on { border-color: var(--accent); background: var(--st-analyzed-bg); }
.audit-verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 10px 0; }
.audit-verdict { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.audit-verdict.hot { border-color: color-mix(in srgb, var(--danger, #B42318) 45%, transparent); }
.audit-verdict.ok { border-color: color-mix(in srgb, var(--st-done) 45%, transparent); }
.panel.audit-hot { border-color: color-mix(in srgb, var(--danger, #B42318) 40%, transparent); }

/* settings → auditors (board 32) */
.aud-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 70px 60px minmax(0, 1fr) 90px auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 14px; }
.aud-row.off { opacity: .6; }
.aud-prompt pre, .aud-shared { direction: ltr; text-align: left; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12px; margin: 6px 0 0; max-height: 320px; overflow: auto; }
.aud-prompt summary { cursor: pointer; }
@media (max-width: 860px) { .aud-row { grid-template-columns: 1fr auto; } .aud-row > :nth-child(n+2):not(:last-child) { display: none; } }

/* attachments (board 33) */
.att-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.att-drop.over { border-color: var(--accent); background: var(--st-analyzed-bg); }
.att-drop .grow { flex: 1; min-width: 200px; }
.att-rec .dot { color: var(--danger, #B42318); }
.att-rec.on { border-color: var(--danger, #B42318); color: var(--danger, #B42318); }
.att-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.att-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.att-ico { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 18px; }
.att-ico img { width: 100%; height: 100%; object-fit: cover; }
.att-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; text-align: right; }
.att-row audio { height: 32px; max-width: 220px; }
@media (max-width: 560px) { .att-row { grid-template-columns: 40px minmax(0, 1fr) auto; } .att-row audio { grid-column: 1 / -1; max-width: 100%; } }

/* users, permissions, team, the responsible person (boards 34–37) */
.perm-dialog form { max-width: 760px; }
.perm-top { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.perm-head, .perm-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px 36px; gap: 10px; align-items: center; }
.perm-head { padding: 0 10px 6px; font-size: 12.5px; }
.perm-row { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: var(--surface); }
.perm-add { border-style: dashed; background: var(--surface-2); grid-template-columns: minmax(0, 1fr) 150px 140px; position: sticky; top: 0; z-index: 1; }
.perm-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; margin-top: 8px; padding-inline-end: 2px; }
.perm-legend { margin-top: 12px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.perm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-chip { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; }
.owner-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin: 8px 0; }
.owner-opt { text-align: start; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.owner-opt:hover, .owner-opt.on { background: var(--st-analyzed-bg); }
.owner-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--st-analyzed-bg); color: var(--st-analyzed); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
@media (max-width: 640px) { .perm-head { display: none; } .perm-row, .perm-add { grid-template-columns: 1fr 1fr; } }
dialog.perm-dialog { width: min(780px, calc(100vw - 32px)); max-width: none; }
dialog.perm-dialog form { max-width: none; }
.as-tray { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.as-tray:empty { display: none; }
.as-x { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; color: inherit; }
.as-files { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.as-panel.over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.as-head .btn.icon.on { background: var(--st-analyzed-bg); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.as-warn { padding: 6px 12px; border-top: 1px solid var(--danger-line); background: var(--danger-soft); color: var(--danger-ink); font-size: 12.5px; }
.as-warn:empty { display: none; }
.as-hist { display: flex; flex-direction: column; gap: 4px; }
.as-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.as-hist-head .btn { display: inline-flex; align-items: center; gap: 4px; }
.as-hist-empty { margin: 8px 4px; display: flex; gap: 6px; align-items: center; }
.as-hist-item { display: flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 10px; padding-inline-end: 6px; }
.as-hist-item:hover { background: var(--surface-2); }
.as-hist-item.on { background: var(--st-analyzed-bg); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.as-hist-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; border-radius: 10px; }
.as-hist-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.as-hist-open .hint { font-size: 12px; }
.as-hist-del { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.as-hist-del:hover { background: var(--danger-soft); color: var(--danger-ink); }
.as-hist-del.sure { padding-inline: 8px; background: var(--danger); color: var(--danger-text); font-size: 12.5px; font-weight: 600; }
@media (max-width: 560px) { .as-hist-del { min-width: 36px; height: 36px; } .as-hist-open { padding-block: 10px; } }

/* ---- milestones (boards 39–41) ---------------------------------------------------------- */
.ms-bar { display: flex; gap: 2px; border-radius: 6px; overflow: hidden; background: var(--border); margin: 12px 0 8px; }
.ms-bar > span { display: block; min-width: 3px; }
.ms-legend-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ms-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ms-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 5px; vertical-align: 0; }
.ms-legend strong { color: var(--text); }
.ms-card-head { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.ms-card-head h2 { margin: 0; font-size: 16px; }
.ms-attn { display: block; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13.5px; }
.ms-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ms-card { margin-bottom: 12px; }
.ms-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; margin-top: 10px; }
@media (max-width: 900px) { .ms-page { grid-template-columns: minmax(0, 1fr); } }
.ms-big { font-size: 28px; font-weight: 700; line-height: 1.1; }
.ms-desc { font-size: 14.5px; }
.ms-table { width: 100%; border-collapse: collapse; }
.ms-table td, .ms-table th { padding: 9px 12px; text-align: start; border-top: 1px solid var(--border); }
.ms-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ms-group td { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 6px 12px; }
.ms-group.attn td { background: var(--warn-soft); color: var(--warn-ink); }
.ms-ul { margin: 0 0 8px; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 3px; }
.ms-agents { border-color: var(--accent-soft); }
.ms-dialog { width: min(680px, calc(100vw - 32px)); }
.ms-dialog form { display: flex; flex-direction: column; gap: 12px; }
.ms-dialog textarea { min-height: 150px; padding: 10px 12px; line-height: 1.6; height: auto; }
.ms-chip { border: 1px dashed var(--faint); background: transparent; color: var(--text); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 20px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkish.muted { color: var(--muted); }
.linkish:hover { text-decoration: underline; }

/* a milestone's tasks folded into one card on the board, closed by default */
.ms-fold { background: var(--surface); border: 1px dashed var(--faint); border-radius: 12px; }
.ms-fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.ms-fold > summary::-webkit-details-marker { display: none; }
.ms-fold > summary::before { content: '▸'; color: var(--muted); font-size: 12px; transition: transform .15s; }
[dir="rtl"] .ms-fold > summary::before { content: '◂'; }
.ms-fold[open] > summary::before { transform: rotate(-90deg); }
[dir="rtl"] .ms-fold[open] > summary::before { transform: rotate(90deg); }
.ms-fold-ico { color: var(--accent); }
.ms-fold-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-fold .n { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg, #fff); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.ms-fold-proj { font-size: 11px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ms-fold-link { color: var(--muted); padding: 0 2px; }
.ms-fold > .list { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }

/* ---- the analysis as a conversation (board 42) ------------------------------------------ */
.cx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .cx-wrap { grid-template-columns: minmax(0, 1fr); } }
.cx-main { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; height: calc(100vh - 130px); min-height: 520px; }
.cx-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cx-feed { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.cx-bub { max-width: 80%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.7; }
.cx-bub.wide { max-width: 92%; }
.cx-bub.me { align-self: flex-start; background: var(--accent-soft); border-start-start-radius: 4px; }
.cx-bub.ai { align-self: flex-end; background: var(--surface); border: 1px solid var(--border); border-start-end-radius: 4px; }
.cx-who { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cx-text { white-space: pre-wrap; }
.cx-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.cx-sys { align-self: center; font-size: 12.5px; color: var(--muted); background: var(--surface-2, #EEF0F3); border-radius: 999px; padding: 4px 12px; text-align: center; }
.cx-sys.err { color: var(--danger); background: var(--danger-soft); }
.cx-fold { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin-top: 8px; font-size: 13.5px; }
.cx-fold summary { cursor: pointer; font-weight: 600; }
.cx-fold ol { margin: 6px 0 2px; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 3px; }
.cx-changes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cx-chg { font-size: 12px; border-radius: 6px; padding: 1px 7px; background: var(--surface-2, #EEF0F3); }
.cx-chg.add { background: var(--st-done-bg); color: var(--st-done); }
.cx-chg.del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.cx-q { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 12px; padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.cx-q-one { display: flex; flex-direction: column; gap: 6px; }
.cx-opt { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%; text-align: start; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; cursor: pointer; }
.cx-opt.rec { border-color: var(--accent); }
.cx-opt.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cx-opt:disabled { cursor: default; opacity: .75; }
.cx-q-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cx-comp { border-top: 1px solid var(--border); padding: 10px 14px; background: var(--surface); }
.cx-sugg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cx-sug { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; background: var(--surface); cursor: pointer; }
.cx-row { display: flex; gap: 8px; align-items: flex-end; }
textarea.input.cx-input { flex: 1; height: 46px; min-height: 46px; max-height: 160px; resize: vertical; padding: 10px 12px; line-height: 1.6; }
.cx-foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cx-mode { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cx-mode button { border: 0; background: transparent; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.cx-mode button.on { background: var(--accent); color: var(--accent-text); }
.cx-mode button:disabled { opacity: .45; cursor: not-allowed; }
.cx-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.cx-versions li { display: flex; gap: 8px; align-items: center; }
.cx-bub.typing .dots { letter-spacing: 2px; animation: cx-blink 1.2s infinite; margin-inline-start: 6px; }
@keyframes cx-blink { 50% { opacity: .3; } }
.cx-chg.mix { background: var(--accent-soft); color: var(--accent-text); }
.cx-chg.del-sum { background: var(--danger-soft); color: var(--danger); }
.cx-diff { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.cx-diff li.add { color: var(--st-done); }
.cx-diff li.del { color: var(--danger); text-decoration: line-through; }

/* ---- the queue (board 43) ---------------------------------------------------------------- */
.qk { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.k-an { background: var(--accent-soft); color: var(--accent); }
.k-map { background: var(--st-review-bg); color: var(--st-review); }
.k-au { background: var(--warn-soft); color: var(--warn-ink); }
.k-ch { background: var(--st-done-bg); color: var(--st-done); }
.q-lane { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.q-lane h2 { margin: 0; }
.q-slots { display: inline-flex; gap: 4px; }
.q-slots i { width: 22px; height: 8px; border-radius: 4px; background: var(--border); display: inline-block; }
.q-slots i.on { background: var(--accent); }
.q-why { font-size: 12.5px; color: var(--warn-ink); }
.q-pos { width: 36px; text-align: center; }
.q-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: q-turn 1s linear infinite; }
@keyframes q-turn { to { transform: rotate(360deg); } }
.q-acts { display: inline-flex; gap: 4px; }
.q-acts button { height: 28px; min-width: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.q-acts button:hover { border-color: var(--accent); }
.q-acts button.x { color: var(--danger); border-color: var(--danger-line); }
.q-table td { vertical-align: middle; }
.ms-sub td:first-child { padding-inline-start: 34px; }
.ms-sub-mark { color: var(--muted); margin-inline-end: 6px; }
.ms-kids { margin-inline-start: 8px; font-size: 11.5px; }
.kids-count { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--surface-2); border-radius: 99px; padding: 0 7px; }

/* task categories */
.cat-chip { border: 1px solid var(--faint); background: transparent; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 20px; }
.cat-add { margin-bottom: 12px; }
.cat-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-add-row .input { flex: 1 1 180px; min-width: 0; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.cat-row:first-child { border-top: 0; }

/* request a review: wide, the header and the actions stay pinned, the body scrolls */
dialog.au-dialog { width: min(980px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; }
dialog.au-dialog[open] { display: flex; }
.au-dialog form { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: none; }
.au-head { display: flex; align-items: flex-start; gap: 16px; padding: 28px 40px 22px; border-bottom: 1px solid var(--border); }
.au-head .grow { flex: 1; min-width: 0; }
.au-head h2 { margin: 0; font-size: 22px; }
.au-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-body { padding: 28px 40px 36px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 32px; background: var(--bg, var(--surface)); }
.au-pane { display: flex; flex-direction: column; gap: 32px; }
.au-pane[hidden] { display: none; }
.au-body section { display: flex; flex-direction: column; gap: 14px; }
.au-sec-head { display: flex; align-items: baseline; gap: 12px; }
.au-sec-head h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.au-tools { display: inline-flex; align-items: baseline; gap: 12px; font-size: 13px; }
.au-count { color: var(--muted); }
p.au-note { margin: -4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

.au-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.au-picks.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.au-pick { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.au-pick:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.au-pick > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.au-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.au-pick:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.au-pick-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.au-pick:has(input:checked) .au-pick-icon { background: var(--accent); color: #fff; }
.au-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au-pick-text strong { font-size: 15px; }
.au-pick-text small, .au-src small, .au-paste small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.au-pick-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); color: transparent; }
.au-pick:has(input:checked) .au-pick-mark { background: var(--accent); border-color: var(--accent); color: #fff; }

.au-src { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.au-src .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au-paste { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 12px; background: var(--surface); }
.au-paste label { font-weight: 600; font-size: 14px; }

.au-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.au-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .15s, background .15s; }
.au-card.on { border-color: var(--accent); background: var(--accent-soft); }
.au-card-top { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.au-card-top input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.au-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.au-card-text strong { font-size: 15px; }
.au-card-text small { font-size: 13px; color: var(--muted); line-height: 1.65; }
.au-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-inline-start: 28px; font-size: 12px; flex-wrap: wrap; min-width: 0; }
.au-models { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); gap: 2px; }
.au-models label { position: relative; padding: 4px 12px; border-radius: 6px; font: 500 12px/1.4 "IBM Plex Mono", ui-monospace, monospace; color: var(--text-2); cursor: pointer; }
.au-models input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.au-models label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 40 / 14%); }
.au-models label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.au-card:not(.on) .au-card-foot { opacity: .55; }
.au-checks { display: flex; gap: 28px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.au-cmd { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 10px; }
.au-cmd code { flex: 1; direction: ltr; text-align: left; font-size: 14px; overflow-x: auto; white-space: nowrap; }

.au-foot { display: flex; align-items: center; gap: 12px; padding: 18px 40px; border-top: 1px solid var(--border); background: var(--surface); }
.au-foot .grow { flex: 1; }
.au-total { font-size: 14px; }
@media (max-width: 760px) { .au-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  dialog.au-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .au-head, .au-body { padding-inline: 20px; }
  .au-picks, .au-picks.three { grid-template-columns: 1fr; }
  .au-grid { grid-template-columns: 1fr; }
  .au-foot { padding-inline: 20px; flex-wrap: wrap; }
  .au-total { width: 100%; }
  .au-foot .grow { display: none; }
  .au-foot .btn { flex: 1; }
}
.au-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.au-link:hover { text-decoration: underline; }
.au-card-foot > .mono { white-space: nowrap; }

/* «اليوم»: what waits on you, settled in place */
.navlink .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-inline-start: 6px; padding: 0 5px; border-radius: 999px; background: var(--st-blocked); color: var(--surface); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.navlink .badge:empty { display: none; }
.td-group { display: flex; flex-direction: column; gap: 10px; }
.td-group > h2 { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.td-item { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); border-inline-start: 4px solid var(--tone, var(--border)); }
.td-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; min-width: 0; }
.td-title { color: var(--text); font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.td-title:hover { color: var(--accent); }
.td-proj { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 40%; font-size: 12px; color: var(--muted); }
.td-proj i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.td-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-q { display: flex; flex-direction: column; gap: 8px; }
.td-q-text { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text); }
.td-rule { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.td-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.td-opt { min-height: 36px; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.td-opt:hover { background: var(--surface-2); }
.td-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); font-weight: 600; }
.td-other { height: 38px; font-size: 14px; }
.td-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.td-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-meta-txt { font-size: 12.5px; color: var(--muted); }
.td-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.td-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); }
.td-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 10px 16px; }
.td-row + .td-row { border-top: 1px solid var(--border); }
.td-row .td-proj { max-width: 200px; }
.td-row .td-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-note { margin: 0; font-size: 13px; color: var(--muted); }
.td-end { display: flex; justify-content: flex-end; }
.td-more { font-size: 13px; color: var(--accent); }
.td-side h2 { margin-bottom: 10px; }
.td-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.td-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.td-running { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.td-running li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.td-running a, .td-running span:first-child { color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.td-empty { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.td-spend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.td-spend > div { display: flex; flex-direction: column; gap: 2px; }
.td-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.td-side .td-note { margin-bottom: 8px; }
@media (max-width: 860px) {
  .td-item { padding: 14px 16px; }
  .td-head { flex-direction: column; gap: 4px; }
  .td-proj { max-width: 100%; }
  .td-row { grid-template-columns: minmax(0, 1fr) auto; }
  .td-row .td-proj, .td-row .td-meta-txt { display: none; }
  .td-acts { margin-inline-start: 0; width: 100%; }
  .td-acts .btn { flex: 1; }
}

/* project memory */
.mem-intro { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.mem-intro .btn { flex: none; }
.mem-intro + .banner, .mem-intro ~ .panel { margin-bottom: 12px; }
.mem-entry { align-items: flex-start; }
.mem-title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mem-title strong { font-weight: 600; }
.mem-body { margin: 4px 0 2px; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.mem-scope-line { margin: 2px 0; }
.mem-gone { color: var(--danger); text-decoration: line-through; }
.mem-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mem-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.mem-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mem-scope { border: 1px solid var(--border-soft); border-radius: var(--r-card); padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.mem-scope legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; }
.mem-units { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-unit { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.mem-unit:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.mem-unit.warn { border-color: var(--warn-line); }
.mem-help { font-size: 12px; }
.mem-fold > summary { cursor: pointer; list-style: none; }
.mem-fold > summary::-webkit-details-marker { display: none; }
.mem-fold > summary h2 { display: inline; margin: 0; }
.mem-preview-out { margin-top: 10px; }
@media (max-width: 640px) {
  .mem-intro { flex-direction: column; }
  .mem-row3 { grid-template-columns: 1fr; }
}
.mem-form .row-end { display: flex; gap: 8px; justify-content: flex-end; }

/* a question's recommended answer, and «أعترض على السؤال» under it */
.q-rec { margin: 0 0 10px; padding: 8px 12px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; font-size: 14px; line-height: 1.7; color: var(--text); }
.q-rec strong { color: var(--accent-ink); }
.q-objection { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; align-items: flex-start; }
.q-objection .input { width: 100%; }
.q-object[aria-pressed="true"] { border-color: var(--danger-line); color: var(--danger-ink); background: var(--danger-soft); }

/* ---- task page v2: «دورك الآن», the bar of stages, the stages in order, the details ---- */
.task-head .tp-id { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.task-head .tp-id:hover { color: var(--accent); }
.task-head .actions { padding-top: 0; align-items: center; }
.tp-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "now now" "nav nav" "main side"; gap: 16px; align-items: start; }
.tp-shell > .tp-now { grid-area: now; }
.tp-shell > .tp-nav { grid-area: nav; }
.tp-shell > .tp-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tp-shell > .tp-side { grid-area: side; }

.tp-now { background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: var(--r-panel); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.tp-now.agent, .tp-now.wait { border-color: color-mix(in srgb, var(--st-in_progress) 35%, var(--border)); }
.tp-now.none { border-color: var(--border); }
.tp-now.review { border-color: color-mix(in srgb, var(--st-review) 40%, var(--border)); }
.tp-now.blocked { border-color: var(--danger-line); padding: 0; overflow: hidden; gap: 0; }
.tp-now-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tp-now.blocked .tp-now-top { background: var(--danger-soft); color: var(--danger-ink); padding: 14px 20px; }
.tp-now-text { flex: 1; min-width: 280px; }
.tp-now-label { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.tp-now.agent .tp-now-label, .tp-now.wait .tp-now-label { color: var(--st-in_progress); }
.tp-now.none .tp-now-label { color: var(--muted); }
.tp-now.review .tp-now-label { color: var(--st-review); }
.tp-now.blocked .tp-now-label, .tp-now.blocked h2 { color: var(--danger-ink); }
.tp-now h2 { margin: 2px 0 0; font-size: 19px; font-weight: 700; line-height: 1.45; }
.tp-now h2:focus { outline: none; }
.tp-now-detail { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); }
.tp-now-ev { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tp-ev { cursor: pointer; font: inherit; font-size: 13px; }
.tp-ev:hover { border-color: currentColor; }
.tp-now-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tp-now-actions .btn { height: 44px; }
.tp-now-count { font-size: 13px; }
.tp-now .progress { margin: 0; height: 8px; }
.tp-q-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; }
.tp-q-body fieldset { border: 0; margin: 0; padding: 0; }
.tp-q-body legend { font-weight: 600; font-size: 15.5px; padding: 0; margin-bottom: 10px; }
.tp-q-foot { border-top: 1px solid var(--border-soft); background: var(--surface-3); padding: 14px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tp-q-foot p { margin: 0; flex: 1; min-width: 260px; font-size: 13px; color: var(--muted); }

.tp-nav { position: sticky; top: calc(var(--topbar-h, 56px) + 10px); z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; box-shadow: var(--shadow); }
.tp-nav::before { content: ''; position: absolute; inset-inline: -2px; bottom: 100%; height: 12px; background: var(--bg); pointer-events: none; }
.tp-nav-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 7px 12px; border: 0; border-radius: var(--r-card); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; min-width: 0; }
.tp-nav-item:hover { background: var(--surface-2); }
.tp-nav-item strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tp-nav-sum { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tp-nav-item.done strong { color: var(--st-done); }
.tp-nav-item.now { background: var(--accent-soft); }
.tp-nav-item.now strong, .tp-nav-now { color: var(--accent-ink); }
.tp-nav-item.blocked { background: var(--danger-soft); }
.tp-nav-item.blocked strong, .tp-nav-item.blocked .tp-nav-now { color: var(--danger); }
.tp-nav-item.off { cursor: default; color: var(--muted); }
.tp-nav-item.off strong { color: var(--muted); font-weight: 500; }
.tp-nav-item.off:hover { background: none; }
.tp-nav-item.reading { box-shadow: inset 0 -2px 0 var(--accent); }

.tp-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 20px; scroll-margin-top: calc(var(--topbar-h, 56px) + 96px); }
.tp-stage.now { border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.tp-stage.blocked { border: 1.5px solid var(--danger-line); }
.tp-stage-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
summary.tp-stage-head { cursor: pointer; list-style: none; }
summary.tp-stage-head::-webkit-details-marker, .tp-fold > summary::-webkit-details-marker, .tp-aside > summary::-webkit-details-marker { display: none; }
.tp-stage-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.tp-stage-head h2:focus { outline: none; }
.tp-num { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text-2); }
.tp-num.done { background: var(--st-done-bg); color: var(--st-done); }
.tp-num.now { background: var(--accent); color: var(--accent-text); }
.tp-num.blocked { background: var(--danger); color: var(--danger-text); }
.tp-now-tag { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.tp-now-tag.hot { color: var(--danger); }
.tp-meta { font-size: 12.5px; color: var(--muted); }
.tp-stage-head > .tp-meta, .tp-stage-head > .tp-preview { flex: 1; min-width: 160px; }
.tp-preview { color: var(--text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-open { color: var(--muted); display: inline-flex; transition: transform .15s; }
details[open] > summary .tp-open { transform: rotate(180deg); }
.tp-stage-sub { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 10px; }
.tp-stage-body { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.tp-fold:not([open]) > .tp-stage-body { margin: 0; }
.tp-stage-body > :empty { display: none; }
.tp-stage-body .panel { border: 0; padding: 0; background: none; border-radius: 0; }
.tp-stage-body .panel h2 { font-size: 14px; margin-bottom: 8px; }
.tp-stage-body .panel-head { margin-bottom: 8px; }
.tp-stage-body .banner { margin: 0; }
.tp-body { line-height: 1.85; overflow-wrap: anywhere; }
.tp-body > :first-child { margin-top: 0; }
.tp-body > :last-child { margin-bottom: 0; }
.tp-lead { margin: 0; font-size: 15px; line-height: 1.85; white-space: pre-wrap; }
.tp-why { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.tp-why .chip { vertical-align: middle; }
.tp-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.tp-grid3 h3, .tp-sub h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.tp-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tp-files { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; text-align: left; }
.tp-files li { overflow-wrap: anywhere; }
.tp-sub { border: 1px solid var(--border-soft); background: var(--surface-3); border-radius: var(--r-card); padding: 12px 14px; }
.tp-sub-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.tp-sub-head h3 { margin: 0; }
.tp-round + .tp-round { border-top: 1px solid var(--border-soft); margin-top: 10px; padding-top: 10px; }
.tp-round-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.tp-qa { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tp-qa dt { font-weight: 600; }
.tp-qa dd { margin: 0 0 6px; color: var(--text-2); white-space: pre-wrap; }
.tp-fold > summary.tp-mini { cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.tp-fold > summary.tp-mini::before { content: '▸ '; }
.tp-fold[open] > summary.tp-mini::before { content: '▾ '; }
.tp-fold > summary.tp-mini + * { margin-top: 10px; }
.tp-claim { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-card); background: var(--st-in_progress-bg); color: var(--warn-ink); font-size: 13.5px; flex-wrap: wrap; }
.tp-claim .grow { flex: 1; min-width: 200px; }
.tp-attempt { border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; }
.tp-attempt.latest { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.tp-attempt-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
summary.tp-attempt-head { cursor: pointer; list-style: none; }
.tp-attempt-head .tp-meta { flex: 1; min-width: 180px; }
.tp-attempt-body { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.tp-attempt-body .panel { border: 0; padding: 0; background: none; }
.tp-attempt-body .exec-evidence { margin: 0; }
.tp-pr { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.tp-matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tp-matrix th, .tp-matrix td { padding: 8px 10px; border-top: 1px solid var(--border-soft); text-align: start; vertical-align: top; }
.tp-matrix thead th { border-top: 0; font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--surface-3); }
.tp-matrix td:first-child { min-width: 200px; }
.tp-cell-test { display: block; margin-top: 3px; text-align: start; overflow-wrap: anywhere; }
.tp-sub .table-wrap { border-radius: var(--r-btn); }
.tp-audit { border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; scroll-margin-top: 150px; }
.tp-audit.hot { border-color: var(--danger-line); }
.tp-audit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
summary.tp-audit-head { cursor: pointer; list-style: none; }
.tp-audit-head .tp-meta { flex: 1; min-width: 160px; }
.tp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-pick { display: flex; gap: 10px; align-items: flex-start; flex: 1; cursor: pointer; }
.tp-pick input { margin-top: 5px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.tp-rounds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tp-rounds li { display: flex; flex-direction: column; gap: 4px; }
.tp-rounds li > div:first-child { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tp-rounds li.open strong { color: var(--st-review); }
.tp-quote { font-size: 13.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-btn); padding: 8px 10px; white-space: pre-wrap; }
.tp-segs { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.tp-seg { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 32px; }
.tp-seg[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tp-seg[aria-pressed="true"] .muted { color: inherit; opacity: .75; }
.tp-log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.tp-log-side time { font-size: 12.5px; color: var(--muted); }
.tp-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.tp-link:hover { text-decoration: underline; }
.tp-kept { margin: 0; font-size: 13.5px; color: var(--muted); }
.tp-pending { margin: 0; padding: 12px 20px; border: 1px dashed var(--border); border-radius: var(--r-panel); color: var(--muted); font-size: 13.5px; }

.tp-aside { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 18px; }
.tp-aside > summary { display: flex; gap: 10px; align-items: center; list-style: none; cursor: default; pointer-events: none; }
.tp-aside > summary h2 { margin: 0; font-size: 15px; font-weight: 700; }
.tp-aside > summary .tp-preview, .tp-aside > summary .tp-open { display: none; }
.tp-kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); row-gap: 10px; column-gap: 10px; margin: 12px 0 0; font-size: 13.5px; }
.tp-kv dt { color: var(--muted); }
.tp-kv dd { margin: 0; min-width: 0; }
.tp-field-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: start; }
.tp-field-btn:hover { text-decoration: underline; }
.tp-pickf { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-pickf .tp-field-btn { font-size: 12.5px; }
.tp-deps { display: flex; flex-direction: column; gap: 2px; }
.tp-break { overflow-wrap: anywhere; font-size: 12px; }
.tp-cost { display: block; font-size: 12px; }
.tp-cmd { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: var(--r-btn); padding: 3px 8px; font-size: 12px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.tp-cmd:hover { border-color: var(--accent); }
.tp-epic-bar { display: flex; flex-direction: column; gap: 6px; }
.tp-epic-bar .progress { margin: 0; height: 8px; }

@media (max-width: 860px) {
  .tp-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "now" "side" "nav" "main"; gap: 12px; }
  .tp-now { padding: 16px; }
  .tp-now-text { min-width: 0; }
  .tp-now h2 { font-size: 17px; }
  /* on the phone the actions live in the bottom bar; blocked keeps its form */
  .tp-now:not(.blocked) .tp-now-actions { display: none; }
  .tp-nav { top: 56px; margin: 0 -16px; border-radius: 0; border-inline: 0; display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px 12px; }
  .tp-nav-item { flex: none; max-width: 200px; }
  .tp-stage { padding: 14px 16px; scroll-margin-top: 120px; }
  .tp-stage-head > .tp-preview { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tp-aside > summary { pointer-events: auto; cursor: pointer; }
  .tp-aside > summary .tp-preview { display: block; flex: 1; min-width: 0; font-size: 12.5px; }
  .tp-aside > summary .tp-open { display: inline-flex; }
  .tp-matrix td:first-child { min-width: 160px; }
  .tp-q-body, .tp-q-foot, .tp-now.blocked .tp-now-top { padding-inline: 16px; }
  .tp-bar { flex-direction: column; gap: 8px; padding: 10px 16px 16px; }
  .tp-bar > .btn { width: 100%; height: 48px; }
  .tp-bar-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
  .tp-bar-link { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
  .tp-bar-link.danger { color: var(--danger); }
  .view:has(.tp-bar) { padding-bottom: 150px; }
  body:has(.action-bar.tp-bar) .as-fab { bottom: 132px; }
}

/* a parent's delivery (board 44): its runs and its subtasks in one pull request */
.dv-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dv-run { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--r-btn); font-size: 13px; }
.dv-run-what { min-width: 0; overflow-wrap: anywhere; }
.dv-run-meta { font-size: 12px; white-space: nowrap; }
.dv-mark { font-weight: 700; text-align: center; }
.dv-run.ok .dv-mark, td.dv-mark.ok { color: var(--st-done); }
.dv-run.live .dv-mark, td.dv-mark.live { color: var(--st-in_progress); }
.dv-run.bad .dv-mark, td.dv-mark.bad { color: var(--danger); }
td.dv-mark.wait { color: var(--muted); }
.dv-items tbody tr { cursor: default; }
.dv-items td { font-size: 13px; padding: 9px 12px; }
.dv-items td:first-child { width: 28px; }
.dv-ends li.ok { color: var(--st-done); }
@media (max-width: 620px) {
  .dv-run { grid-template-columns: 22px auto minmax(0, 1fr); }
  .dv-run-meta { grid-column: 2 / -1; white-space: normal; }
  /* the phone keeps the subtask, its commit and its criteria; the cost stays in the runs above */
  .dv-items th:nth-child(5), .dv-items td:nth-child(5) { display: none; }
  .dv-items td, .dv-items th { padding: 8px 6px; white-space: normal; }
  .dv-items td:first-child { width: 18px; }
}
.design-fig { margin: 8px 0 14px; }
.design-shot { display: block; width: 100%; max-width: 900px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-2); min-height: 120px; }
.design-frame { display: block; width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--r-card); background: #fff; }

/* the models page: testing a model in place */
.model-test-row > td { background: var(--surface-2); padding: 12px 14px; }
.model-test { display: flex; flex-direction: column; gap: 10px; text-align: right; position: sticky; right: 0; width: min(880px, calc(100vw - 96px)); }
.model-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.model-test-ask { display: flex; gap: 8px; align-items: center; }
.model-test-ask .input { flex: 1; min-width: 0; }
.model-test-answer { white-space: pre-wrap; line-height: 1.7; font-size: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); max-width: 760px; }
.model-test-fig { margin: 0; }
.model-test-img { display: block; width: 100%; max-width: 320px; border: 1px solid var(--border); border-radius: var(--r-card); background: #fff; }
.btn.on { border-color: var(--accent); color: var(--accent); }

/* «المحرر»: projects on the right, the conversation, the thread on the left */
body.editor-page .as-fab, body.editor-page #assistant-fab { display: none; }
.view.ed-view { padding: 0; max-width: none; }
.ed-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr) 460px; height: calc(100vh - 64px); height: calc(100dvh - 64px); }
.ed-side { border-inline-end: 1px solid var(--border); background: var(--surface); padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ed-find { height: 34px; font-size: 13.5px; }
.ed-plist { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.ed-sec { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 8px 4px; }
.ed-sec .btn { height: 24px; padding: 0 6px; font-size: 12px; }
.ed-pr { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-btn); font-size: 14px; color: var(--text-2); text-decoration: none; }
.ed-pr:hover { background: var(--surface-2); }
.ed-pr[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ed-pi { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--text-2); flex: none; }
.ed-pr[aria-current] .ed-pi { background: var(--accent); color: var(--accent-text); }
.ed-nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-cnt { font-size: 11.5px; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.ed-cnt.w { background: var(--warn-soft); color: var(--warn-ink); font-weight: 700; }
.ed-cnt.r { background: var(--st-done-bg); color: var(--st-done); }
.ed-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.ed-ch { display: flex; align-items: center; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--border-soft, var(--border)); background: var(--bg); flex-wrap: wrap; }
.ed-proj { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.ed-pdot { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.ed-projs { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-end { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.ed-menu { display: none; }
.ed-tl { flex: 1; overflow-y: auto; padding: 20px 0 10px; min-height: 0; }
.ed-tl-in { max-width: 820px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 12px; }
.ed-own { align-self: flex-start; max-width: 78%; background: var(--accent-soft); color: var(--text); padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.75; }
.ed-own .ed-text { white-space: pre-wrap; }
.ed-sent { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.ed-cl { font-size: 15px; line-height: 1.8; color: var(--text); }
.ed-cl > :first-child { margin-top: 0; } .ed-cl > :last-child { margin-bottom: 0; }
.ed-cl.err { color: var(--danger); }
.ed-cl.typing { color: var(--muted); }
.ed-cl.typing .dots { letter-spacing: 2px; animation: cx-blink 1.2s infinite; }
.ed-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.ed-tc { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; min-width: 0; }
.ed-tc:hover { border-color: var(--accent); }
.ed-tc.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ed-tc b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.ed-ln { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ed-kind { font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; flex: none; }
.ed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.ed-dot.run { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent); }
.ed-dot.wait { background: #D97706; box-shadow: 0 0 0 4px color-mix(in srgb, #D97706 22%, transparent); }
.ed-dot.done { background: var(--accent); }
.ed-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; flex: none; white-space: nowrap; text-decoration: none; font-weight: 600; }
.ed-pill.pr { background: var(--st-review-bg); color: var(--st-review); }
.ed-pill.wait { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.ed-plan { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px 14px; }
.ed-plan-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ed-plan ol { margin: 8px 0; padding-inline-start: 20px; font-size: 14px; line-height: 1.8; }
.ed-plan li.ok::marker { color: var(--success); } .ed-plan li.bad { color: var(--danger); }
.ed-plan-a { display: flex; gap: 8px; justify-content: flex-end; }
.ed-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.ed-empty h2 { color: var(--text); margin: 10px 0 6px; }
.ed-empty-i { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; }
.ed-composer { padding: 8px 24px 16px; }
.ed-comp { max-width: 820px; margin: 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.ed-input { border: 0; background: transparent; resize: none; width: 100%; font-size: 15px; line-height: 1.6; padding: 4px 2px; min-height: 30px; box-shadow: none; }
.ed-input:focus { outline: none; box-shadow: none; }
.ed-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
/* the thread, or the list of threads */
.ed-panel { border-inline-start: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-sh { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft, var(--border)); }
.ed-crumb { font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.ed-crumb a { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.ed-crumb b { color: var(--text); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-back { display: none; }
.ed-sb { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ed-path { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ed-path span { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.ed-path span.d { background: var(--st-done-bg); color: var(--st-done); }
.ed-path span.c { background: var(--st-in_progress-bg); color: var(--st-in_progress); font-weight: 600; }
.ed-path span.b { background: var(--st-blocked-bg); color: var(--st-blocked); font-weight: 600; }
.ed-turn { font-size: 14px; font-weight: 600; }
.ed-turn.you { color: var(--warn-ink); } .ed-turn.agent { color: var(--success); }
.ed-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-body summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.ed-body .md { font-size: 14px; line-height: 1.75; }
.ed-msg { font-size: 14px; line-height: 1.8; }
.ed-msg.own { background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; }
.ed-msg .md > :first-child { margin-top: 0; } .ed-msg .md > :last-child { margin-bottom: 0; }
.ed-who { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.ed-meta2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.ed-sys { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ed-sys.err { color: var(--danger); }
.ed-ec { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-3); display: flex; flex-direction: column; gap: 8px; }
.ed-ec h4 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.ed-subh { display: flex; align-items: center; justify-content: space-between; }
.ed-subh .btn { height: 26px; font-size: 12.5px; }
.ed-q { display: flex; flex-direction: column; gap: 6px; }
.ed-q strong { font-size: 14.5px; line-height: 1.7; }
.ed-opt { display: flex; width: 100%; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 13.5px; background: var(--surface); color: var(--text); cursor: pointer; text-align: start; }
.ed-opt.on { border-color: var(--success); background: var(--st-done-bg); }
.ed-q-a { display: flex; justify-content: space-between; gap: 8px; }
.ed-chk { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.ed-chk > div { display: flex; gap: 10px; align-items: center; }
.ed-chk .now { font-weight: 600; }
.ed-ci { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; }
.ed-ci.d { background: var(--text-2); color: var(--surface); }
.ed-ci.r { border: 2px solid var(--surface-2); border-top-color: var(--accent); animation: ed-spin 1s linear infinite; }
@keyframes ed-spin { to { transform: rotate(360deg); } }
.ed-sub { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border-soft, var(--border)); font-size: 13.5px; color: var(--text); text-decoration: none; }
.ed-sub:first-of-type { border-top: 0; }
.ed-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-sc { padding: 10px 16px 14px; border-top: 1px solid var(--border-soft, var(--border)); }
.ed-box { border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; }
.ed-seg { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.ed-seg button { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.ed-seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.ed-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-tabs button { border: 1px solid var(--border); background: var(--surface); height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.ed-tabs button.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.ed-trow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border-soft, var(--border)); color: var(--text); text-decoration: none; }
.ed-trow:hover { background: var(--surface-3); }
.ed-trow .ed-dot { margin-top: 8px; }
.ed-x { flex: 1; min-width: 0; }
.ed-trow b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-r { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ed-picks { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; margin: 10px 0; }
.ed-pick { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ed-pick .hint { margin-inline-start: auto; }
.ed-acct { height: 30px; font-size: 12.5px; max-width: 200px; padding: 0 8px; }
.ed-acct[hidden] { display: none; }
.ed-pick[hidden] { display: none; }
@media (max-width: 1240px) {
  .ed-grid { grid-template-columns: 220px minmax(0, 1fr) 400px; }
}
@media (max-width: 1080px) {
  .ed-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .ed-panel { display: none; }
  .ed-grid.has-thread .ed-panel, .ed-grid.has-list .ed-panel { display: flex; position: fixed; inset-block: 64px 0; left: 0; width: min(460px, 100vw); z-index: 30; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
}
@media (max-width: 760px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-side { display: none; }
  .ed-grid.side-open .ed-side { display: flex; position: fixed; inset-block: 64px 0; right: 0; width: min(300px, 86vw); z-index: 31; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
  .ed-menu { display: inline-flex; }
  .ed-ch { padding: 8px 12px; }
  .ed-tl-in { padding: 0 12px; }
  .ed-composer { padding: 6px 10px 10px; }
  .ed-own { max-width: 88%; }
  .ed-tc { flex-wrap: wrap; row-gap: 6px; }
  .ed-tc b { max-width: none; flex: 1; }
  .ed-tc .ed-ln { flex-basis: 100%; order: 3; }
  .ed-grid.has-thread .ed-panel, .ed-grid.has-list .ed-panel { width: 100vw; }
  .ed-back { display: inline-flex; }
  .ed-x-btn { display: none; }
  .ed-projs { display: none; }
}
textarea.input.ed-input { height: 44px; min-height: 0; max-height: 200px; border: 0; padding: 6px 4px; resize: none; background: transparent; }
textarea.input.ed-input:focus { box-shadow: none; }
.ed-sc textarea.input.ed-input { height: 52px; }
.ed-comp { position: relative; }
.ed-slash { position: absolute; inset-inline: 0; bottom: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px; display: flex; flex-direction: column; z-index: 5; }
.ed-slash[hidden] { display: none; }
.ed-slash button { display: flex; gap: 10px; align-items: baseline; text-align: start; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font: inherit; font-size: 14px; }
.ed-slash button:hover, .ed-slash button:focus { background: var(--surface-2); outline: none; }
.ed-slash .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-skill { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.ed-skill.off { opacity: .6; }
.ed-skill-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-skill-h .btn { height: 26px; padding: 0 8px; font-size: 12.5px; }
.ed-skill details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.ed-skill .md { font-size: 13.5px; line-height: 1.7; }
textarea.input.ed-skill-body { min-height: 160px; }
.btn.primary .hint { color: inherit; opacity: .8; }

/* the editor's own list: add with +, reorder by dragging or with the arrows, hide with × */
.ed-pr { position: relative; }
.ed-pr .ed-tools, .ed-pr .ed-pin { display: none; gap: 2px; margin-inline-start: auto; }
.ed-pr .ed-tools { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); background: var(--surface-2); border-radius: var(--r-btn); padding: 2px; }
.ed-pr:hover .ed-tools, .ed-pr:focus-within .ed-tools { display: inline-flex; }
.ed-pr .ed-pin { display: inline-flex; }
.ed-pr .ed-tools .btn, .ed-pr .ed-pin { width: 24px; height: 24px; min-width: 24px; padding: 0; font-size: 12px; }
.ed-pr[draggable="true"] { cursor: grab; }
.ed-pr.drag { opacity: .45; }
.ed-pr.drop { box-shadow: inset 0 2px 0 var(--accent); }
.ed-none { margin: 8px 10px; font-size: 13px; }
@media (hover: none) { .ed-pr .ed-tools { display: inline-flex; position: static; transform: none; background: none; } }

/* files in the editor's composers and messages */
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.att-chips[hidden] { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 240px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 3px 4px; }
.att-open { display: inline-flex; align-items: center; gap: 8px; min-width: 0; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.att-open:disabled { cursor: default; }
.att-chip .att-ico { width: 36px; height: 36px; font-size: 16px; flex: none; }
.att-chip.k-image .att-ico { width: 52px; height: 40px; }
.att-cn { display: flex; flex-direction: column; min-width: 0; }
.att-cn .att-name { font-size: 12px; max-width: 150px; }
.att-cn .hint { font-size: 11px; }
.att-clip { font-size: 15px; }
.ed-comp.over, .ed-box.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.ed-own .att-chips { justify-content: flex-start; margin-bottom: 4px; }

/* Claude Code on the owner's computer, in a thread */
.ed-tool { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--muted); padding: 2px 10px; border-inline-start: 2px solid var(--border); margin-inline-start: 6px; min-width: 0; }
.ed-tool b { color: var(--text-2); font-weight: 600; flex: none; }
.ed-tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-cc { color: var(--text-2); }
.ed-dev { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 6px; }
.ed-live { display: flex; align-items: center; gap: 8px; }
.ed-live .btn { margin-inline-start: auto; }
.ed-appr { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.ed-appr.open { border-color: var(--warn-ink, #B54708); box-shadow: 0 0 0 3px var(--warn-soft, #FEF0C7); }
.ed-appr-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.ed-appr.ok .ed-appr-h { color: var(--st-done); }
.ed-appr.no .ed-appr-h { color: var(--danger, #B42318); }
.ed-appr pre { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; text-align: left; }
.ed-appr-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-appr-a .input { flex: 1; min-width: 160px; height: 32px; font-size: 13px; }

.ed-shot { display: block; max-width: 100%; max-height: 420px; margin: 6px 0; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; object-fit: contain; }

/* «النقاش الاستراتيجي» */
.db { max-width: 920px; }
.db-head { display: flex; align-items: flex-start; gap: 16px; }
.db-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.db-tabs { align-self: flex-start; }
.db-tabs a { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 6px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.db-tabs a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.db-list { display: flex; flex-direction: column; gap: 8px; }
.db-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); color: inherit; text-decoration: none; }
a.db-row:hover { border-color: var(--accent); }
.db .db-row > .grow { flex: 1 1 280px; }
.db-row .hint { margin-top: 3px; }
.db-st.db-run { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.db-st.db-pause { background: var(--warn-soft); color: var(--warn-ink); }
.db-st.db-done { background: var(--st-done-bg); color: var(--st-done); }
.db-st.db-stop { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.db-st.db-fail { background: var(--danger-soft); color: var(--danger); }
.db-warn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-card); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 13.5px; }
.db-part, .db-stage { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-top: 10px; border: 1px solid var(--border-soft); border-radius: var(--r-card); background: var(--surface-3); }
.db-part { border-inline-start: 4px solid hsl(var(--h) 65% 55%); }
.db-part-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-part-row > .input { flex: 1; min-width: 160px; }
.db-part-row > .ctl { min-width: 150px; }
.db-mod { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.db-num { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.db-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.db-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.panel > .field, .panel > .db-check { margin-top: 12px; }
.db-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.db-tpl { display: flex; flex-direction: column; gap: 4px; padding: 12px; text-align: start; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.db-tpl:hover { border-color: var(--accent); }
.db-tpl.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.db textarea.input { width: 100%; resize: vertical; min-height: 64px; height: auto; }
.db-top { display: flex; align-items: flex-start; gap: 12px; }
.db-top h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.db-cost { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 150px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: inherit; font: inherit; font-size: 13px; cursor: pointer; text-align: center; }
.db-cost:hover { border-color: var(--accent); }
.db-cost.full { border-color: var(--warn-line); background: var(--warn-soft); }
.db-bar { display: block; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.db-bar > span { display: block; height: 100%; background: var(--accent); }
.db-cost.full .db-bar > span { background: var(--warn-ink); }
.db-brief { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.db-brief summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.db-cast { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.db-pchip { background: hsl(var(--h) 70% 50% / 14%); color: var(--text); }
.db-feed { display: flex; flex-direction: column; gap: 10px; }
.db-stage-head { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.db-msg { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); border-inline-start: 4px solid hsl(var(--h, 220) 65% 55%); }
.db-modmsg { border-inline-start-color: var(--muted); background: var(--surface-3); }
.db-final { border-color: var(--success); border-inline-start-color: var(--success); background: var(--st-done-bg); }
.db-steer { border-inline-start-color: var(--warn-line); background: var(--warn-soft); font-size: 14px; }
.db-who-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13.5px; }
.db-model { height: 20px; font-size: 11px; }
.db-msg .md { font-size: 14px; line-height: 1.7; }
.db-msg .md > :first-child { margin-top: 0; }
.db-msg .md > :last-child { margin-bottom: 0; }
.db-err { color: var(--danger); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.db-steerbox { background: var(--surface); }
.db-steerbox .input { border: 0; padding: 4px; }
@media (max-width: 640px) {
  .db-top, .db-head { flex-wrap: wrap; }
  .db-cost { width: 100%; }
}
.db .grow { flex: 1; min-width: 0; }
.db-warn > .grow { flex: 1 1 220px; }
.db > .row-end { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.db-jump { align-self: flex-start; }
.sh { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; }
.sh-q { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.sh-qtext { font-weight: 500; margin-bottom: 6px; }
.sh-a { font-size: 14px; line-height: 1.7; padding-inline-start: 12px; border-inline-start: 3px solid var(--border); }
.sh-ask { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sh-ask .input:not(textarea) { max-width: 260px; }
.sh-ask textarea.input { min-height: 72px; }
.sh-ask .row-end { display: flex; gap: 10px; align-items: center; }
.db-shares { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.db-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.db-share .grow { flex: 1; min-width: 0; }
.db-link { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.db-link .input { flex: 1; direction: ltr; font-size: 12.5px; }
.db-files { display: grid; gap: 6px; margin-top: 8px; }
.db-file { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.db-file .db-who-line { align-items: center; }
.db-file .input { margin-top: 6px; }
.db-file summary { cursor: pointer; }
.db-topic .db-who-line h2 { margin: 0; }
.db-gist { margin: 0; font-size: 14.5px; line-height: 1.7; }
.db-more { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.db-more:hover { text-decoration: underline; }
.db-feed-head { display: flex; justify-content: flex-end; margin-bottom: -6px; }
/* a project's rules (rules.js): what each does on one side, its control and source on the other */
.rule-list { display: flex; flex-direction: column; margin-top: 6px; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.rule-row:first-child { border-top: 0; }
.rule-label { font-weight: 600; font-size: 14px; }
.rule-how { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rule-how > .input:not(.rule-num) { flex: 1 1 200px; min-width: 0; }
.rule-num { width: 90px; }
.rule-caps { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-cap { display: inline-flex; align-items: center; gap: 6px; }
.rule-cap .rule-num { width: 72px; }
@media (max-width: 720px) { .rule-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }


/* a project's «قواعد التصميم» tab (design-rules.js) */
.dr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }
.dr-title { margin: 0 0 2px; font-size: 18px; }
.dr-part h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.dr-stamp { font-weight: 400; }
.dr-fold > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.dr-edit { display: flex; flex-direction: column; gap: 8px; }
.dr-text { width: 100%; min-height: 420px; font-size: 13.5px; line-height: 1.7; resize: vertical; box-sizing: border-box; }

/* labels (Plane's): coloured, any number on a task */
.lbl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lbl-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--faint); background: transparent; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 20px; }
.lbl-field { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lbl-pick { display: flex; flex-direction: column; gap: 8px; }
.lbl-opts { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.lbl-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.lbl-opt.child { padding-inline-start: 22px; }
.lbl-new { display: flex; gap: 6px; }
.lbl-new .input { flex: 1; min-width: 0; }
.lbl-color { width: 32px; height: 28px; padding: 0; border: 1px solid var(--border-soft); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.cat-row.lbl-child { padding-inline-start: 24px; }
.field .lbl-opts { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.field .lbl-opt.child { padding-inline-start: 0; }

/* Plane's task fields: dates, points, members, links, relations */
.due-chip { border: 1px solid var(--faint); background: transparent; color: var(--muted); }
.due-chip.soon { color: #b45309; border-color: #f59e0b; }
.due-chip.late { color: #b91c1c; border-color: #ef4444; font-weight: 600; }
.est-chip { border: 1px solid var(--faint); background: transparent; color: var(--muted); font-variant-numeric: tabular-nums; }
.owner-dot.member { opacity: .75; }
.tp-dates { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; }
.tp-dates .late { color: #b91c1c; }
.ctl.date { padding: 2px 6px; font-size: 13px; }
.ctl.est { width: 72px; padding: 2px 6px; font-size: 13px; }
.tp-items { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tp-li { display: inline-flex; gap: 6px; align-items: baseline; max-width: 100%; overflow: hidden; }
.tp-li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-kv .ctl.date, .tp-kv .ctl.est { height: 28px; min-height: 0; padding: 0 6px; font-size: 13px; }
.tp-dates label { display: inline-flex; align-items: center; gap: 4px; }
.tp-items .linkish { color: var(--accent); background: none; border: 0; padding: 0; min-height: 0; height: auto; }
.tp-items .linkish.muted { color: var(--muted); }

/* the subtask tree */
.st-panel { display: flex; flex-direction: column; gap: 10px; }
.st-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st-head h2 { margin: 0; font-size: 16px; }
.st-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.st-tree .st-tree { padding-inline-start: 22px; border-inline-start: 1px solid var(--border-soft); margin-inline-start: 8px; }
.st-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-width: 0; flex-wrap: wrap; }
.st-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.st-count { font-variant-numeric: tabular-nums; }
.st-plus { color: var(--accent); background: none; border: 0; font-size: 16px; padding: 0 4px; cursor: pointer; }
.st-add { padding: 2px 0 6px 0; }

/* task templates */
.tpl-scope { font-size: 11px; }
.tpl-scope.tpl-system { background: var(--surface-2, #eef2f7); }
.tpl-scope.tpl-workspace { background: #e8f0fe; color: #1d4ed8; }
.tpl-scope.tpl-project { background: #e7f6ec; color: #15803d; }
.tpl-rules { margin-top: 6px; font-size: 13px; }
.tpl-rules summary { cursor: pointer; color: var(--accent); }
.tpl-rules-body { white-space: pre-wrap; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f6f7f9); color: var(--text); max-height: 260px; overflow: auto; }
.tpl-why { color: var(--accent); }
.tpl-item { align-items: flex-start; }
.tpl-dialog { width: min(680px, calc(100vw - 32px)); }
.tpl-dialog form { display: grid; gap: 8px; max-height: 80vh; overflow: auto; }
.tpl-row { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 8px; }
@media (max-width: 560px) { .tpl-row { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) {
  .tpl-scope.tpl-workspace { background: #1e2a44; color: #93b4ff; }
  .tpl-scope.tpl-project { background: #17321f; color: #86d6a0; }
}
/* T3 on a parent across repositories: a thread per repository */
.tp-t3-list { display: grid; gap: 12px; }
.tp-t3-list .tp-t3 { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); padding: 16px 20px; }
.tp-t3-repos { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tp-t3-repos li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
.tp-t3-repos li:first-child { border-top: 0; }
.tp-t3-repo { font-weight: 600; }
.tp-t3-repos .grow { flex: 1 1 auto; }

/* comments, mentions, followers, inbox */
.cm-panel { margin-top: 16px; }
.cm-list { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 14px; }
.cm-item { display: flex; gap: 10px; align-items: flex-start; }
.cm-av { flex: none; margin-top: 2px; }
.cm-main { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.cm-tools { margin-inline-start: auto; display: inline-flex; gap: 10px; }
.cm-tools .linkish { color: var(--accent); font-size: 13px; }
.cm-tools .linkish.muted { color: var(--muted); }
.cm-body { margin-top: 4px; font-size: 14px; line-height: 1.7; }
.cm-body p { margin: 0 0 6px; }
.cm-mention { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cm-compose { display: grid; gap: 6px; }
.cm-wrap { position: relative; }
.cm-input { width: 100%; resize: vertical; }
.cm-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cm-actions .hint { margin-inline-end: auto; }
.cm-pop { position: absolute; inset-inline-start: 0; top: 100%; z-index: 30; list-style: none; margin: 4px 0 0; padding: 4px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cm-pop li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cm-pop li.on, .cm-pop li:hover { background: var(--surface-2); }
.cm-followers { display: inline-flex; align-items: center; gap: 2px; }
.inbox-btn { position: relative; }
.inbox-num { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #dc2626; color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; font-weight: 700; }
.inbox-panel { position: fixed; z-index: 60; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.inbox-head .linkish { color: var(--accent); font-size: 13px; }
.inbox-list { list-style: none; margin: 0; padding: 4px; }
.inbox-list a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.inbox-list a:hover { background: var(--surface-2); }
.inbox-list li.unread a { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.inbox-list li.unread a::before { content: ''; }
.inbox-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* views: list, table, calendar, timeline */
.vw-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; width: 100%; flex-basis: 100%; margin-top: 4px; }
.vw-bar .label-sm { display: grid; gap: 4px; }
.vw-layouts .quick-btn { display: inline-flex; align-items: center; gap: 4px; }
.vw-group { margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel, 12px); }
.vw-group > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 14px; }
.vw-group > summary .n, .vw-grow .n { color: var(--muted); font-weight: 500; margin-inline-start: 6px; }
.vw-rows { list-style: none; margin: 0; padding: 0 6px 6px; }
.vw-list > .vw-rows { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.vw-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-top: 1px solid var(--border); font-size: 14px; }
.vw-row:first-child { border-top: 0; }
.vw-title { color: var(--text); text-decoration: none; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-title:hover { color: var(--accent); }
.vw-meta { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vw-table table { font-size: 13.5px; }
.vw-table td { white-space: nowrap; }
.vw-table .vw-c-title { white-space: normal; min-width: 240px; }
.vw-table th .linkish { color: inherit; font-weight: inherit; }
.vw-grow th { background: var(--surface-2); text-align: start; }
.vw-cal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.vw-cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.vw-cal-head strong { font-size: 16px; min-width: 130px; text-align: center; }
.vw-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.vw-wd { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.vw-day { min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vw-day.out { opacity: .45; }
.vw-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vw-dnum { font-size: 12px; color: var(--muted); }
.vw-ev { display: block; font-size: 12px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-inline-start: 3px solid var(--st-draft); }
.vw-ev.st-analyzed { border-color: var(--st-analyzed); } .vw-ev.st-in_progress { border-color: var(--st-in_progress); } .vw-ev.st-blocked { border-color: var(--st-blocked); }
.vw-ev.st-review { border-color: var(--st-review); } .vw-ev.st-done { border-color: var(--st-done); opacity: .7; } .vw-ev.st-cancelled { border-color: var(--st-cancelled); opacity: .6; }
.vw-tl { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.vw-tl .vw-group { border: 0; margin: 0; }
.vw-tl-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 10px; align-items: center; min-height: 30px; }
.vw-tl-name { font-size: 13.5px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-tl-track { position: relative; height: 22px; background: repeating-linear-gradient(to left, transparent 0 calc(100% / 6 - 1px), var(--border) calc(100% / 6 - 1px) calc(100% / 6)); border-radius: 4px; }
.vw-tl-scale .vw-tl-track { background: none; height: 20px; }
.vw-tl-week { position: absolute; font-size: 11px; color: var(--muted); top: 2px; white-space: nowrap; }
.vw-tl-today { position: absolute; top: 0; bottom: -2000px; width: 2px; background: var(--accent); opacity: .5; pointer-events: none; }
.vw-tl { overflow: hidden; }
.vw-tl-bar { position: absolute; top: 4px; height: 14px; border-radius: 7px; background: var(--st-draft); }
.vw-tl-bar.st-analyzed { background: var(--st-analyzed); } .vw-tl-bar.st-in_progress { background: var(--st-in_progress); } .vw-tl-bar.st-blocked { background: var(--st-blocked); }
.vw-tl-bar.st-review { background: var(--st-review); } .vw-tl-bar.st-done { background: var(--st-done); } .vw-tl-bar.st-cancelled { background: var(--st-cancelled); }
.vw-tl-bar.late { outline: 2px solid #dc2626; outline-offset: 1px; }
.vw-tl-off { position: absolute; top: 3px; font-size: 11.5px; inset-inline-start: 4px; }
@media (max-width: 720px) { .vw-day { min-height: 60px; } .vw-ev { font-size: 10.5px; padding: 1px 3px; } .vw-tl-row { grid-template-columns: 110px 1fr; } }

/* custom states (Plane's) under pm's stages */
.st-chip { gap: 6px; }
.st-btn { cursor: pointer; border-style: dashed; }
.st-btn:hover, .st-btn:focus-visible { border-style: solid; }
/* the task's T3 conversation inside pm (t3-chat.js) */
.t3c-wrap { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.t3c-wrap > summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.t3c-wrap > summary::-webkit-details-marker { display: none; }
.t3c-wrap > summary::before { content: ''; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); transition: transform .15s; margin-inline-end: 2px; }
.t3c-wrap[open] > summary::before { transform: rotate(-45deg); }
.t3c { display: grid; gap: 10px; margin-top: 12px; }
/* the conversation reads top to bottom in a scroll box of its own, as tall as the window allows */
.t3c-list { list-style: none; margin: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 12px; max-height: min(64vh, 720px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.t3c-msg { border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 14px; max-width: min(100%, 760px); min-width: 0; font-size: 14px; line-height: 1.7; }
.t3c-msg.owner { align-self: flex-start; background: var(--surface-2); border-color: transparent; }
.t3c-msg.agent { align-self: flex-end; background: var(--surface); }
.t3c-who { font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--text-2); }
.t3c-text { overflow-wrap: anywhere; }
.t3c-text pre { white-space: pre-wrap; overflow-x: auto; }
.t3c-text > :first-child { margin-top: 0; }
.t3c-text > :last-child { margin-bottom: 0; }
.t3c-plain { white-space: pre-wrap; }
.t3c-msg .linkish { margin-top: 6px; font-size: 13px; font-weight: 500; }
.t3c-status:empty { display: none; }
/* the reply box, as Plane's comment box: one bordered field, the actions inside its foot */
.t3c-compose { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.t3c-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t3c-compose textarea.input { width: 100%; min-height: 44px; max-height: 240px; height: 44px; border: 0; box-shadow: none; background: transparent; resize: none; padding: 10px 12px; line-height: 1.6; }
.t3c-compose textarea.input:focus { box-shadow: none; }
.t3c-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--border-soft); }
.t3c-foot .hint { flex: 1; font-size: 12px; color: var(--muted); }
.t3c-foot .btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* the task's details stay in view beside the stages, under the sticky stage bar, as Plane keeps
   an issue's properties beside it */
@media (min-width: 861px) {
  .tp-side input[type="date"] { max-width: 150px; min-width: 0; }
  .tp-shell > .tp-side { position: sticky; top: calc(var(--topbar-h, 56px) + 96px); max-height: calc(100vh - var(--topbar-h, 56px) - 112px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* the agent's result for pm, in the task's T3 chat */
.t3r { border: 1px solid var(--border, #e3e3e8); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: var(--surface-2, rgba(127,127,127,.05)); }
.t3r-title { font-weight: 600; margin-bottom: 6px; }
.t3r-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.t3r-sum { margin-bottom: 6px; }
.t3r-why { font-size: 13px; margin-bottom: 6px; }
.t3r-part { margin-top: 10px; }
.t3r-h { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.t3r-list { margin: 0; padding-inline-start: 20px; }
.t3r-list li { margin: 3px 0; }
.t3r-rec { color: var(--accent, #2563eb); }
.t3r-raw { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 320px; overflow: auto; }
.t3r details > summary, details.t3r-part > summary { cursor: pointer; }

/* how the task is to be analysed (draft) */
.tp-anz-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.tp-anz-prefs .tabs button { padding: 4px 12px; }
.tp-anz-advisors { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.tp-anz-advisors[hidden] { display: none; }
.tp-anz-design { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* the analysis stage while T3 works on it: the conversation is the stage's body, said once */
.tp-anz-t3 { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.tp-anz-t3.live { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.tp-anz-t3-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-anz-t3-head .grow { flex: 1 1 auto; }
.tp-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: tp-pulse 1.6s ease-out infinite; }
@keyframes tp-pulse { to { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .tp-pulse { animation: none; } }
.t3c-wrap.compact { margin-top: 10px; padding-top: 8px; }
.t3c-wrap.compact > summary { font-size: 13px; color: var(--text-2); }
.t3c-wrap.compact .t3c-list { max-height: 360px; }
.tp-stage-body > .tp-anz-prefs { margin-top: 12px; }
.t3c-wrap.compact textarea { min-height: 0; height: auto; }

/* ---- the analysis workspace: one card before, during and just after the analysis ---- */
.tp-shell.has-ws { grid-template-areas: "nav nav" "main side"; }
.ws { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); display: flex; flex-direction: column; overflow: hidden; }
.ws.live, .ws.wait { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ws.ready { border-color: color-mix(in srgb, var(--st-done, #16a34a) 35%, var(--border)); }
.ws.hot { border-color: var(--danger-line); }
.ws-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding: 18px 20px 14px; }
.ws-text { flex: 1; min-width: 260px; }
.ws-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.ws-phase { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.ws-phase.live, .ws-phase.wait { background: var(--accent-soft); color: var(--accent); }
.ws-phase.ready { background: color-mix(in srgb, var(--st-done, #16a34a) 12%, transparent); color: var(--st-done, #16a34a); }
.ws-phase.hot { background: var(--danger-soft); color: var(--danger); }
.ws-label { color: var(--muted); }
.ws h2 { margin: 6px 0 0; font-size: 19px; font-weight: 700; line-height: 1.45; }
.ws h2:focus { outline: none; }
.ws-detail { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-actions .btn { height: 40px; }
.ws-extra { padding: 0 20px 14px; }
.ws-extra .tp-anz-prefs { margin: 0; }
.ws-steps { list-style: none; margin: 0; padding: 12px 20px; display: flex; gap: 0; border-top: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; }
.ws-step { flex: 1 1 0; min-width: 92px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); position: relative; padding-inline-end: 10px; }
.ws-step > span:last-child { display: flex; flex-direction: column; }
.ws-step-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.ws-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--border-strong, var(--border)); background: var(--surface); }
.ws-step.done { color: var(--text); }
.ws-step.done .ws-dot { background: var(--st-done, #16a34a); border-color: var(--st-done, #16a34a); }
.ws-step.now { color: var(--accent); font-weight: 600; }
.ws-step.now .ws-dot { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-step.hot { color: var(--danger); font-weight: 600; }
.ws-step.hot .ws-dot { background: var(--danger); border-color: var(--danger); }
.ws-live { display: flex; gap: 10px; align-items: baseline; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ws-live[hidden] { display: none; }
.ws-live-who { flex: none; font-size: 12px; font-weight: 600; color: var(--accent); }
.ws-live-text { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ws-tabs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px; border-top: 1px solid var(--border); }
.ws-tabs { display: flex; gap: 4px; }
.ws-tab { height: 42px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ws-tab:hover { color: var(--text); }
.ws-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ws-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 6px; }
.ws-count:not(:empty) { font-size: 11.5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.ws-single { margin: 0; padding: 12px 0; font-size: 14px; }
.ws-meta { font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.ws-tabs-row .grow { flex: 1 1 auto; }
.ws-panel { padding: 16px 20px 18px; border-top: 1px solid var(--border); }
.ws-panel[hidden] { display: none; }
.ws-result { display: flex; flex-direction: column; gap: 12px; }
.ws-result > :first-child { margin-top: 0; }
.ws-request { display: flex; flex-direction: column; gap: 12px; }
.ws-request-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ws-request-head .grow { flex: 1 1 auto; }
.ws-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ws-foot .tp-anz-prefs { margin: 0; }
.ws-tools { display: flex; gap: 6px; }
.t3c-wrap.bare { margin: 0; padding: 0; border: 0; }
.t3c-wrap.bare > summary { display: none; }
.t3c-wrap.bare > .t3c { margin-top: 0; }
@media (max-width: 860px) {
  .tp-shell.has-ws { grid-template-areas: "nav" "main" "side"; }
  .ws-head { padding: 16px; }
  .ws-text { min-width: 0; }
  .ws h2 { font-size: 17px; }
  .ws-actions { display: none; }
  .ws-steps, .ws-live, .ws-tabs-row, .ws-panel, .ws-foot, .ws-extra { padding-inline: 16px; }
  .ws-steps { padding-block: 10px; }
  .ws-step { min-width: 0; font-size: 12px; gap: 5px; padding-inline-end: 4px; }
  .ws-step-sub { display: none; }
  .ws-dot { width: 8px; height: 8px; margin-top: 4px; }
  .ws-meta { display: none; }
}
.ws-request .panel { border: 0; padding: 0; background: none; box-shadow: none; }
.ws-request .panel h2 { font-size: 14px; margin: 0 0 8px; }

/* the design and the diagram an analysis made */
.vis { display: flex; flex-direction: column; gap: 18px; }
.vis-part { display: flex; flex-direction: column; gap: 8px; }
.vis-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vis-head h3 { margin: 0; font-size: 14px; }
.vis-head .grow { flex: 1 1 auto; }
.vis-head .tabs button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.vis-diagram { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px; max-height: 520px; overflow: auto; display: flex; justify-content: center; }
.vis-diagram .vis-img { max-width: 100%; height: auto; display: block; }
.vis-diagram.zoom { max-height: none; justify-content: flex-start; }
.vis-diagram.zoom .vis-img { max-width: none; width: 180%; }
.vis-wait { padding: 40px 0; }
.vis-design { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 10px; display: flex; justify-content: center; }
.vis-frame { width: 100%; height: 620px; border: 0; border-radius: 6px; background: #fff; }
.vis-design.phone .vis-frame { width: 390px; max-width: 100%; height: 720px; box-shadow: 0 0 0 1px var(--border); }
.vis-making { display: flex; align-items: center; gap: 10px; padding: 18px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2); font-size: 13.5px; }
@media (max-width: 860px) { .vis-frame { height: 520px; } .vis-diagram.zoom .vis-img { width: 300%; } }
@media (max-width: 860px) { .vis-head .tabs { display: none; } .vis-design.phone .vis-frame { width: 100%; } }
.t3c-msg.pm { justify-self: stretch; max-width: 100%; background: none; border-style: dashed; padding: 6px 12px; }
.t3c-msg.pm summary { cursor: pointer; color: var(--muted); margin: 0; }
.t3c-msg.pm .t3c-plain { margin-top: 8px; font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; max-height: 260px; overflow: auto; }
.ws.you { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ws-phase.you { background: var(--accent); color: #fff; }
