/* Kunla: a record of work for people and agents. Spiking Labs tokens: warm paper, ink, lime as fill only. */
:root {
  --canvas: #f4f2ec; --surface: #fffdf8; --sunk: #ebe8df; --ink: #121212; --ink-2: #45443f; --muted: #77756c;
  --rule: #e0dcd1; --rule-2: #cfcabd; --lime: #b9ff66; --on-lime: #121212; --brain: #151513; --on-brain: #f1efe8;
  --warn: #b4410e; --wait: #9a968a; --focus: #3b6cff;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r: 16px; --r-s: 10px; --shadow: 0 1px 0 rgba(18,18,18,.04), 0 8px 24px -16px rgba(18,18,18,.25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0e0e0d; --surface: #181816; --sunk: #222220; --ink: #f1efe8; --ink-2: #c9c6bc; --muted: #8d8a80;
    --rule: #2a2926; --rule-2: #3a3935; --brain: #050505; --on-brain: #f1efe8; --warn: #ff9b62; --wait: #6d6a62;
    --shadow: 0 1px 0 rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0e0e0d; --surface: #181816; --sunk: #222220; --ink: #f1efe8; --ink-2: #c9c6bc; --muted: #8d8a80;
  --rule: #2a2926; --rule-2: #3a3935; --brain: #050505; --on-brain: #f1efe8; --warn: #ff9b62; --wait: #6d6a62;
  --shadow: 0 1px 0 rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--canvas); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono, .key, kbd, code, pre { font-family: var(--mono); }
.muted { color: var(--muted); }
.key { font-size: 12px; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--rule-2); border-radius: 6px; color: var(--muted); background: var(--surface); }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- buttons, pills, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--ink); background: transparent; cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunk); }
.btn.go { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.btn.go:hover { filter: brightness(.95); }
.btn.ink { background: var(--ink); color: var(--canvas); }
.btn.ink:hover { opacity: .88; }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn kbd { border-color: currentColor; color: inherit; opacity: .55; background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--rule-2);
  font-size: 12.5px; white-space: nowrap; text-decoration: none; background: transparent; cursor: default; }
a.pill, button.pill { cursor: pointer; }
a.pill:hover, button.pill:hover { border-color: var(--ink); }
.pill.on { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.pill.lime { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.pill.warn { border-color: var(--warn); color: var(--warn); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
input[type=text], input[type=password], input[type=url], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--rule-2); background: var(--surface); border-radius: 12px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; flex: none; }

/* ---------- avatars ---------- */
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--sunk);
  color: var(--ink); font: 600 11px/1 var(--sans); letter-spacing: .02em; position: relative; }
.av.ai { border-radius: 8px; background: var(--ink); color: var(--canvas); }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av .dot { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--lime); border: 2px solid var(--surface); }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; box-shadow: 0 0 0 0 rgba(185,255,102,.7); animation: beat 1.8s infinite; }
@keyframes beat { 70% { box-shadow: 0 0 0 7px rgba(185,255,102,0); } 100% { box-shadow: 0 0 0 0 rgba(185,255,102,0); } }
@media (prefers-reduced-motion: reduce) { .live, .seg.live::after { animation: none; } }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 24px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.wordmark { font: 700 22px/1 var(--sans); letter-spacing: -.04em; text-decoration: none; display: inline-flex; align-items: flex-end; gap: 2px; }
.lab-tag { font: 500 11px/18px var(--sans); color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 4px; padding: 0 5px; text-decoration: none; flex: none; }
.lab-tag:hover { color: var(--ink); }
.wordmark i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); display: inline-block; margin-bottom: 3px; box-shadow: 0 0 0 1px var(--ink) inset; }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a.on { background: var(--ink); color: var(--canvas); }
.nav .n { font: 600 11px/18px var(--mono); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--on-lime); text-align: center; }
.cmdk { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 38px; min-width: 260px; padding: 0 8px 0 14px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--muted); cursor: pointer; }
.cmdk svg { width: 14px; height: 14px; color: var(--ink); }
.cmdk span { flex: 1; text-align: left; }
.cmdk:hover { border-color: var(--ink); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunk); }
.icon-btn svg { width: 16px; height: 16px; }
.me { border: 0; background: none; padding: 0; cursor: pointer; }
.main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 96px; }
.tabbar { display: none; }
/* Footer (KD-53): who makes Kunla, and an Install button while it isn't installed yet. */
.foot { max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--ink-2); }
.foot-brand { display: inline-flex; align-items: flex-end; gap: 8px; }
.foot-brand .wordmark { font-size: 16px; color: var(--ink); }
.foot-brand .wordmark i { width: 6px; height: 6px; margin-bottom: 2px; }
.foot-install { color: var(--ink-2); }
.foot-install[hidden] { display: none; }

/* ---------- page heads ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { font-size: 36px; line-height: 1.05; letter-spacing: -.035em; font-weight: 600; }
.head .sub { color: var(--ink-2); margin-top: 8px; max-width: 64ch; }
.hello h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; max-width: 18ch; }
.hello h1 em { white-space: nowrap; font-style: normal; background: var(--lime); color: var(--on-lime); padding: 0 .14em; border-radius: .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hello .sub { font-size: 17px; color: var(--ink-2); margin-top: 14px; max-width: 62ch; }
.hello .sub b { color: var(--ink); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.section-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-t h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- briefing ---------- */
.brief { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; margin-top: 32px; align-items: start; }
.brief .side { display: flex; flex-direction: column; gap: 20px; }
.deck-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--rule-2); cursor: pointer; }
.dots button.on { background: var(--ink); width: 22px; border-radius: 99px; }
/* One scroll-snap track holds every card (KD-46): swiping is native scrolling, one card per flick. */
.deck { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; align-items: flex-start; margin: -6px; padding: 6px; scroll-padding: 0 6px; box-sizing: content-box; }
.deck::-webkit-scrollbar { display: none; }
.deck > .slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0; }
.decision { padding: 26px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.decision h2 { font-size: 26px; line-height: 1.12; letter-spacing: -.03em; font-weight: 600; }
.decision h2 a { text-decoration: none; }
.decision h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.byline { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; flex-wrap: wrap; }
.said { font-size: 17px; line-height: 1.5; padding-left: 14px; border-left: 3px solid var(--lime); }
.prstate { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.prstate:empty { display: none; }
.prstate.bad { color: var(--warn); }
.hookstate { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--sunk); border: 1px solid var(--rule-2); }
.hookstate .dot { flex: none; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--wait); }
.hookstate .t { font-weight: 600; font-size: 17px; color: var(--ink); }
.hookstate .s { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.hookstate.ok { border-color: var(--lime); }
.hookstate.ok .dot { background: var(--lime); border: 2px solid #3f7a00; }
.hookstate.bad { border-color: var(--warn); }
.hookstate.bad .t { color: var(--warn); }
.hookstate.bad .dot { background: var(--warn); }
.hooklog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.hooklog li { display: grid; gap: 2px; overflow-wrap: anywhere; }
.hooklog li span { color: var(--ink-2); }
.hooklog li span.bad { color: var(--warn); }
.hooklog time { color: var(--muted); font-size: 12.5px; }
details.hookmore summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
details.hookmore[open] summary { margin-bottom: 8px; }
.ask { font-size: 20px; line-height: 1.4; letter-spacing: -.01em; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a.pill { height: 32px; padding: 0 12px; font-size: 13.5px; background: var(--canvas); }
.checks { display: flex; flex-direction: column; gap: 2px; }
.checks .check { padding: 8px 10px; border-radius: 10px; }
.checks .check:hover { background: var(--canvas); }
.teach { border: 1px dashed var(--rule-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.teach.on { border-style: solid; border-color: var(--ink); background: var(--canvas); }
.teach .hint { font-size: 13px; color: var(--muted); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.acts .spacer { flex: 1; }
.clear { padding: 48px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.clear .big { width: 56px; height: 56px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; color: var(--on-lime); }
.clear h2 { font-size: 24px; letter-spacing: -.03em; }

.pulse { display: flex; flex-direction: column; }
.pulse .p { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.pulse .p:first-child { border-top: 0; }
.pulse .p .t { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse .p .nm { font-weight: 600; font-size: 14px; }
.state { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 7px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.state.working { background: var(--lime); color: var(--on-lime); }
.state.blocked { color: var(--warn); background: transparent; border: 1px solid currentColor; }

.brain { background: var(--brain); color: var(--on-brain); border-radius: var(--r); padding: 20px; }
.brain .eyebrow { color: #9c998f; }
.brain h2 { font-size: 20px; letter-spacing: -.02em; margin: 8px 0 4px; font-weight: 600; }
.brain p.s { color: #b9b6ac; font-size: 13.5px; }
.brain ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.brain li { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); }
.brain li .r { font-size: 14.5px; line-height: 1.4; }
.brain li .m { margin-top: 6px; font: 11.5px/1.4 var(--mono); color: #9c998f; display: flex; gap: 10px; flex-wrap: wrap; }
.brain li .m b { color: var(--lime); font-weight: 500; }
.brain a { color: inherit; }

.prog { display: flex; flex-direction: column; gap: 16px; }
.prog a { text-decoration: none; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--sunk); margin-top: 8px; }
.bar span { display: block; height: 100%; }
.b-done { background: var(--ink); } .b-review { background: var(--lime); } .b-in_progress { background: var(--wait); }
.b-blocked { background: var(--warn); } .b-ready { background: var(--rule-2); } .b-inbox { background: transparent; }
.legend { font: 12px/1.4 var(--mono); color: var(--muted); margin-top: 6px; }

.done-list { display: flex; flex-direction: column; }
.done-list a { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; text-decoration: none; border-top: 1px solid var(--rule); font-size: 14px; }
.done-list a:first-child { border-top: 0; }
.done-list a:hover .t { text-decoration: underline; }
/* Asks on the Briefing (KD-50): what waits on someone else for too long. */
.ask-list { display: flex; flex-direction: column; }
.ask { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.ask:first-child { border-top: 0; }
.ask-k { flex: none; font: 600 11px/20px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--wait); min-width: 104px; }
.ask.budget_stop .ask-k, .ask.question_waiting .ask-k { color: var(--warn); }
.ask-l { line-height: 1.4; }
.ask-t { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.ask-a { flex: none; display: flex; gap: 6px; }
@media (max-width: 560px) {
  .ask { flex-wrap: wrap; }
  .ask-k { min-width: 0; width: 100%; line-height: 16px; }
  .ask .grow { flex: 1 1 60%; min-width: 0; }
}
.digest-preview { white-space: pre-wrap; font: 12.5px/1.5 var(--mono); background: transparent; border: 1px solid var(--rule); border-radius: 10px; padding: 12px; margin-top: 8px; max-height: 360px; overflow: auto; }

/* ---------- work map ---------- */
.map { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 8px 20px 12px 0; touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
.map-in { position: relative; }
.map-days, .lane { display: grid; grid-template-columns: var(--label, 200px) minmax(0, 1fr); }
.map-days .track { position: relative; height: 34px; }
.map-days .d { position: absolute; top: 10px; font: 11px/1 var(--mono); color: var(--muted); letter-spacing: .04em; padding-left: 6px; white-space: nowrap; }
.map-days .d.day { text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
/* Lane names stay put while the time axis scrolls under them. */
.map-days > .who, .lane > .who { position: sticky; left: 0; z-index: 7; background: var(--surface); padding-left: 20px; }
.lane { border-top: 1px solid var(--rule); min-height: calc(64px + (var(--rows, 1) - 1) * 42px); }
.lane > .who { padding: 12px 12px 12px 20px; display: flex; gap: 10px; align-items: center; box-shadow: 1px 0 0 var(--rule); }
.lane .who .name { font-weight: 600; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane .who .grow { min-width: 0; }
.lane .who small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.lane .track { position: relative; }
.map-group { gap: 6px; align-items: center; margin-bottom: 10px; }
.map-group .label { margin-right: 4px; }
.lane-badge { border-radius: 8px; font-size: 11px; letter-spacing: .02em; }
.map-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.zoom { display: inline-flex; align-items: center; gap: 6px; font: 12px/1 var(--mono); color: var(--ink-2); }
.zoom .btn { width: 36px; padding: 0; font-size: 18px; }
#zoomv { min-width: 34px; text-align: center; }
.grid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); opacity: .55; }
.grid-line.day { opacity: 1; }
.night { position: absolute; top: 0; bottom: 0; background: var(--sunk); opacity: .6; }
.now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); z-index: 5; pointer-events: none; }
.now.bare::before { display: none; }
.now::before { content: 'now'; position: absolute; top: 8px; left: 6px; font: 600 10.5px/1 var(--mono); text-transform: uppercase; background: var(--lime); color: var(--on-lime); padding: 3px 5px; border-radius: 5px; }
.seg { position: absolute; top: calc(14px + var(--row, 0) * 42px); height: 36px; border-radius: 9px; display: flex; align-items: center; padding: 0 8px; min-width: 6px;
  font-size: 12px; line-height: 1.15; text-decoration: none; overflow: hidden; white-space: nowrap; z-index: 2; }
.seg span { overflow: hidden; text-overflow: ellipsis; }
.seg.work { background: var(--ink); color: var(--canvas); }
.seg.wait { border: 1.5px dashed var(--wait); color: var(--ink-2); background: var(--surface); }
.seg.decide { background: var(--lime); color: var(--on-lime); top: calc(18px + var(--row, 0) * 42px); height: 28px; padding: 0; z-index: 4; box-shadow: 0 0 0 2px var(--surface); min-width: 10px; }
.seg:hover { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg.live { padding-right: 20px; }
.seg.live::after { content: ''; position: absolute; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); animation: beat 1.8s infinite; }
.waits { display: flex; flex-direction: column; }
.waits a { display: grid; grid-template-columns: 70px minmax(0, 1fr) 160px 64px; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.waits a:first-child { border-top: 0; }
.waits a:hover .t { text-decoration: underline; }
.waits .t small { display: block; color: var(--muted); font-size: 13px; }
.waits .len { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.waits .len i { display: block; height: 100%; background: var(--warn); border-radius: 99px; }
.waits .for { font: 500 13px/1 var(--mono); text-align: right; }
.map-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.map-key span { display: inline-flex; align-items: center; gap: 6px; }
.map-key i { width: 22px; height: 10px; border-radius: 4px; display: inline-block; }

/* ---------- task ---------- */
.task { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.task h1 { font-size: 34px; line-height: 1.08; letter-spacing: -.035em; font-weight: 600; margin: 10px 0 12px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.people { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.people > span { display: inline-flex; align-items: center; gap: 8px; }
.sec { margin-top: 28px; }
.sec > h3 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.prose { font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.crit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.crit li { display: flex; gap: 10px; align-items: flex-start; }
.crit li::before { content: ''; width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 4px; margin-top: 4px; flex: none; }
.crit.met li::before { background: var(--lime); border-color: var(--lime); }
.trail { font-family: var(--mono); font-size: 13px; }
.trail .ev { display: grid; grid-template-columns: 88px 22px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px dashed var(--rule); align-items: start; }
.trail .ev:first-child { border-top: 0; }
.trail .ev .when { color: var(--muted); padding-top: 2px; }
.trail .ev .what { font-family: var(--sans); font-size: 14px; }
.trail .ev .note { color: var(--ink-2); margin-top: 3px; font-family: var(--sans); white-space: pre-wrap; }
.trail .ev.mark .what { font-weight: 600; }
.trail .ev.rule .note { border-left: 3px solid var(--lime); padding-left: 10px; color: var(--ink); }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer textarea { min-height: 88px; }
.aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.aside h3 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.aside .brain h3 { color: #9c998f; }
.cite { display: flex; flex-direction: column; gap: 8px; }
.cite button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--rule); }
.cite button:hover { border-color: var(--ink); }
.cite small { font-size: 11.5px; color: var(--muted); }
.cite code { font-size: 12px; word-break: break-all; }
details.playbook { margin-top: 14px; }
details.playbook summary { cursor: pointer; font-size: 13.5px; color: #b9b6ac; }
details.playbook pre { white-space: pre-wrap; font-size: 12.5px; background: rgba(255,255,255,.06); padding: 12px; border-radius: 10px; margin: 10px 0 0; }

/* ---------- tasks board ---------- */
.cols { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scroll-padding: 0; }
.col { scroll-snap-align: start; }
.col h3 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.col h3 .n { opacity: .7; } /* the count sits with its own label, not beside the next column's */
.col .list { display: flex; flex-direction: column; gap: 8px; }
.tcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; text-decoration: none; border-radius: 12px; }
.tcard:hover { border-color: var(--ink); }
.tcard .t { font-weight: 500; font-size: 14px; line-height: 1.3; }
.tcard .f { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.empty-col { font-size: 13px; color: var(--muted); padding: 12px; border: 1px dashed var(--rule-2); border-radius: 12px; }

/* ---------- team ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.member { display: flex; flex-direction: column; gap: 14px; }
.member .nm { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--canvas); border-radius: 10px; padding: 10px; }
.stats b { display: block; font-size: 20px; letter-spacing: -.02em; }
.stats small { color: var(--muted); font-size: 12px; }
.continuous { font-size: 13.5px; padding: 8px 10px; border-radius: 10px; border-left: 3px solid var(--lime); background: var(--canvas); }
.continuous.stopped { border-left-color: var(--wait); }
.continuous .muted { font-size: 12.5px; margin-top: 2px; }
.continuous.off { border-left-color: var(--rule-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* Continuous mode offer: shows on the Briefing and Tasks page when Ready work piles up. */
.nudge { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; margin-top: 20px; border-left: 3px solid var(--lime); }
.nudge p { margin: 4px 0 0; font-size: 14px; }
.nudge .grow { min-width: 220px; }
.tlist + .nudge, .head ~ .nudge { margin: 0 0 18px; }
.cont-how { padding: 12px 14px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.cont-how p { margin: 0; line-height: 1.5; }
.secret { font: 13px/1.4 var(--mono); padding: 12px; border-radius: 12px; background: var(--brain); color: var(--lime); word-break: break-all; }
pre.code { font-size: 12.5px; padding: 14px; border-radius: 12px; background: var(--brain); color: var(--on-brain); overflow-x: auto; margin: 0; }

/* ---------- playbook ---------- */
.pb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.pb textarea { font-family: var(--mono); font-size: 13px; min-height: 220px; }
.rule-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rule); }
.rule-row:first-child { border-top: 0; }
.rule-row .m { font: 11.5px/1.4 var(--mono); color: var(--muted); margin-top: 4px; }
.switch { appearance: none; width: 36px; height: 22px; border-radius: 99px; background: var(--rule-2); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.switch:checked { background: var(--ink); } .switch:checked::after { left: 17px; background: var(--lime); }

/* ---------- command bar ---------- */
.palette { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,10,.42); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal { width: min(640px, 100%); background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; border: 1px solid var(--rule); }
.pal textarea { border: 0; border-radius: 0; padding: 20px 22px 10px; font-size: 19px; letter-spacing: -.01em; min-height: 0; resize: none; background: transparent; }
.pal textarea:focus, .pal textarea:focus-visible { border: 0; outline: none; }
.pal .hint { padding: 0 22px 12px; font-size: 12.5px; color: var(--muted); }
.pal .hint code { color: var(--ink); background: var(--sunk); padding: 1px 5px; border-radius: 5px; }
.pal .chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 22px 14px; }
.pal .opts { border-top: 1px solid var(--rule); max-height: 46vh; overflow-y: auto; padding: 8px; }
.pal .opt { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; text-decoration: none; }
.pal .opt.on { background: var(--sunk); }
.pal .opt .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); flex: none; font: 600 12px/1 var(--mono); }
.pal .opt.on .ic { background: var(--ink); color: var(--canvas); }
.pal .opt.delegate .ic { background: var(--lime); color: var(--on-lime); }
.pal .opt .t { font-weight: 500; }
.pal .opt small { display: block; color: var(--muted); font-size: 12.5px; }
.pal .grp { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 6px; }

/* ---------- gate, toast ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 28px; letter-spacing: -.035em; line-height: 1.1; font-weight: 600; }
.gate-card .warn { color: var(--warn); }
.gate-card button.primary { height: 44px; border-radius: 999px; border: 0; background: var(--lime); color: var(--on-lime); font-weight: 600; cursor: pointer; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; }
.gate-card button.ghost { height: 44px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; cursor: pointer; padding: 0 20px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--canvas); padding: 12px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.skel { height: 120px; border-radius: var(--r); background: var(--sunk); animation: fade 1.2s infinite alternate; }
@keyframes fade { to { opacity: .5; } }

/* ---------- workspaces ---------- */
.space { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 8px; border-radius: 999px; border: 1px solid var(--rule-2); background: transparent; cursor: pointer; font-weight: 500; font-size: 14px; max-width: 220px; }
.space:hover { border-color: var(--ink); }
.space svg { width: 12px; height: 12px; flex: none; }
.space .sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-dot { width: 18px; height: 18px; border-radius: 6px; background: var(--ink); flex: none; box-shadow: inset -6px -6px 0 -2px var(--lime); }
.pal.spaces .pad { padding: 18px 22px; }
.focus-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink); margin-right: 8px; vertical-align: 1px; }
.m-ws { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: var(--lime); color: var(--on-lime); padding: 2px 5px; border-radius: 4px; margin-left: 4px; }

/* ---------- task list ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { width: 240px; height: 34px; padding: 6px 12px; border-radius: 999px; }
.toolbar select { width: auto; height: 34px; padding: 4px 10px; border-radius: 999px; }
.seg-toggle { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 999px; padding: 2px; }
.seg-toggle button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.seg-toggle button.on { background: var(--ink); color: var(--canvas); }
.pill.saved { padding: 0 4px 0 10px; gap: 2px; }
.pill.saved a { text-decoration: none; }
.pill.saved button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 14px; }
.tlist { display: flex; flex-direction: column; gap: 16px; }
.group { padding: 6px 0; }
.group h2 { font-size: 15px; font-weight: 600; padding: 12px 18px 8px; display: flex; align-items: center; gap: 6px; }
.rows { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 14px 72px minmax(0, 1fr) 130px 190px 44px; gap: 12px; align-items: center; padding: 9px 18px; border-top: 1px solid var(--rule); text-decoration: none; font-size: 14px; }
.trow:hover { background: var(--canvas); }
.trow .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.child .t { padding-left: 18px; position: relative; color: var(--ink-2); }
.trow.child .t::before { content: ''; position: absolute; left: 2px; top: -2px; width: 9px; height: 11px; border-left: 1.5px solid var(--rule-2); border-bottom: 1.5px solid var(--rule-2); border-bottom-left-radius: 4px; }
.trow .stx { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.trow .w { min-width: 0; font-size: 13px; }
.subcount { font: 500 11px/1 var(--mono); background: var(--sunk); padding: 3px 6px; border-radius: 6px; margin-left: 6px; color: var(--ink-2); }
.st-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.st-dot.s-done { background: var(--ink); border-color: var(--ink); }
.st-dot.s-review { background: var(--lime); border-color: var(--ink); }
.st-dot.s-in_progress { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.st-dot.s-blocked { border-color: var(--warn); background: var(--warn); }
.st-dot.s-inbox { border-style: dashed; }
.st-dot.s-declined { opacity: .35; }
.subs { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.subrow { display: flex; gap: 12px; align-items: center; padding: 10px 14px; text-decoration: none; border-top: 1px solid var(--rule); font-size: 14px; }
.subrow:first-child { border-top: 0; }
.subrow:hover { background: var(--canvas); }
.subrow.fin .t { text-decoration: line-through; color: var(--muted); }
.title-in { flex: 1; font-weight: 600; font-size: 18px; border-color: transparent !important; background: transparent !important; padding-left: 4px !important; }
.title-in:hover, .title-in:focus { border-color: var(--rule-2) !important; }
.proj.focused { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.ws { background: var(--sunk); }
/* Projects page (KD-17): one box per workspace, the workspace as its header, projects as rows. */
.wsbox { padding: 0; overflow: hidden; }
.wsbox-head { padding: 18px 20px 14px; background: var(--sunk); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.wsbox-title { display: flex; align-items: center; gap: 10px; }
.wsbox-title .sp-dot { width: 22px; height: 22px; }
.wsbox-title .title-in { font-size: 20px; }
.wsbox-meta { font-size: 13px; padding-left: 40px; }
.wsbox-meta a { color: inherit; }
.wsbox-empty { padding: 18px 20px; font-size: 14px; margin: 0; }
.prow { padding: 12px 20px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.prow:first-child { border-top: 0; }
.prow.focused { box-shadow: inset 3px 0 0 var(--lime); }
.prow-main { display: flex; align-items: center; gap: 10px; }
.prow-main .title-in { font-size: 16px; min-width: 0; }
.prow-when { font-size: 13px; white-space: nowrap; }
.prow-focus { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.prow-focus .switch { margin: 0; }
.fold > summary { font-size: 13px; color: var(--muted); cursor: pointer; list-style: none; padding: 2px 0; }
.fold > summary::before { content: '▸ '; }
.fold[open] > summary::before { content: '▾ '; }
.wsbox-head .fold { padding-left: 40px; }
@media (max-width: 560px) {
  .wsbox-head, .prow { padding-left: 14px; padding-right: 14px; }
  .prow-main { flex-wrap: wrap; } .prow-main .title-in { flex: 1 1 60%; }
  .wsbox-meta, .wsbox-head .fold { padding-left: 0; }
}
.focus-check .switch { margin-top: 0; }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* ---------- small screens ---------- */
@media (max-width: 1020px) {
  .trow { grid-template-columns: 14px 66px minmax(0, 1fr) 110px 44px; }
  .trow .w { display: none; }
  .brief, .task { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .pb { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 16px; height: 58px; }
  .top .nav { display: none; }
  .space { max-width: 120px; padding: 0 8px 0 6px; }
  .space .sp-dot { display: none; }
  .trow { grid-template-columns: 12px 60px minmax(0, 1fr) 38px; }
  .trow .stx, .trow .w { display: none; }
  .toolbar .search { width: 100%; }
  .toolbar > .row { width: 100%; }
  .cmdk { min-width: 0; flex: 1; margin-left: 8px; }
  .cmdk kbd { display: none; }
  .main { padding: 22px 16px 32px; }
  .foot { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; background: var(--ink); border-radius: 999px; padding: 6px; justify-content: space-between; }
  .tabbar a { flex: 1; min-width: 0; text-align: center; color: var(--canvas); opacity: .75; text-decoration: none; font-size: 12px; letter-spacing: -.01em; font-weight: 500; padding: 9px 0; border-radius: 999px; position: relative; }
  .tabbar a.on { background: var(--lime); color: var(--on-lime); opacity: 1; }
  .tabbar .n { position: absolute; top: 1px; right: 8%; font: 600 9.5px/15px var(--mono); min-width: 15px; border-radius: 99px; background: var(--lime); color: var(--on-lime); }
  .tabbar a.on .n { background: var(--on-lime); color: var(--lime); }
  .decision { padding: 20px; }
  /* A sliver of the next card shows, so the deck reads as swipeable. */
  .deck > .slide { flex-basis: calc(100% - 22px); }
  .decision h2 { font-size: 22px; }
  .head h1 { font-size: 30px; }
  .task h1 { font-size: 27px; }
  .acts .btn { flex: 1; }
  .acts .spacer { display: none; }
  .map { padding: 8px 12px 12px 0; }
  .map-days > .who, .lane > .who { padding-left: 12px; }
  .lane > .who { gap: 8px; }
  .lane .who small { display: none; }
  .lane .who .name { font-size: 13px; }
  .map-ranges { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .waits a { grid-template-columns: 62px minmax(0, 1fr) 50px; }
  .waits .len { display: none; }
  .trail .ev { grid-template-columns: 70px 22px minmax(0, 1fr); }
  .toast { bottom: 90px; }
}
.check input.switch { width: 36px; height: 22px; margin-top: 0; accent-color: auto; }
.check:has(.switch) { align-items: center; }
.cmdk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { #theme { display: none; } .cmdk { padding: 0 12px; } }
.paused { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 40; display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; max-width: calc(100% - 32px);
  height: 40px; padding: 0 6px 0 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); font-size: 14px; }
.paused b { background: var(--lime); color: var(--on-lime); border-radius: 999px; padding: 6px 12px; font-weight: 600; }
@media (max-width: 380px) { .top .lab-tag { display: none; } }

/* ---------- dialogs (connect, token, manage, claude.ai) ---------- */
.palette.sheet { align-items: flex-start; padding: 8vh 16px 16px; overflow-y: auto; }
.sheet-card { overflow: visible; }
.sheet-body { padding: 22px; gap: 16px; }
.sheet-body h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.sheet-body .muted { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.btn.danger { color: var(--warn); border-color: currentColor; }
.sheet-body pre.code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

@media (pointer: coarse) { .seg { min-width: 14px; } .seg.decide { min-width: 14px; } }
/* ---------- later (parked) ---------- */
.later-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.later-opts .btn { height: auto; padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 14px; }
.later-opts .btn small { color: var(--muted); font-size: 12px; font-weight: 400; }
.claim { margin-top: 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.claim .grow { display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 1; }
.claim.stale { border-color: var(--warn); }
.handoff { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--rule-2); }
.handoff small { color: var(--muted); }
.handoff p { margin: 4px 0 0; }
.parked-note { margin-top: 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.parked-note .grow { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.st-dot.s-parked { border-style: dashed; }

/* ---------- long text never pushes layout sideways ---------- */
.decision, .decision > *, .brief > *, .task > *, .deck { min-width: 0; }
.said, .ask, .note, .prose, .decision h2, .what, .check span { overflow-wrap: anywhere; }
a.inline-link { display: inline-block; padding: 0 8px; border-radius: 99px; background: var(--canvas); border: 1px solid var(--rule); font-size: .82em; line-height: 1.6; text-decoration: none; white-space: nowrap; vertical-align: .08em; }
a.inline-link:hover { border-color: var(--ink-2); }
/* A mention ("acme/site PR #3") keeps reading as part of the sentence and wraps like it (KD-42). */
a.inline-link.mention { display: inline; padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; line-height: inherit; white-space: normal; overflow-wrap: anywhere; vertical-align: baseline; color: inherit; text-decoration: underline; text-decoration-color: var(--lime, currentColor); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.links { min-width: 0; }
.links .pill { max-width: 100%; min-width: 0; flex-wrap: nowrap; }
.pill-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck { touch-action: pan-x pan-y pinch-zoom; }
/* Phones: the pill sits above the tab bar, where it never covers a card title. */
@media (max-width: 760px) {
  .paused { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); height: 44px; font-size: 14px; }
}

/* A decision recorded from a chat (KD-26): the person's words, who recorded it, the chat link. */
.via { margin-top: 4px; font-family: var(--sans); font-size: 13.5px; overflow-wrap: anywhere; }
.via .btn { margin-left: 4px; }
.via q { font-style: italic; color: var(--ink); }
.via a { color: var(--ink-2); }

/* ---------- appearance (KD-35): System / Light / Dark ---------- */
.segctl { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--rule); }
.segctl button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.segctl button svg { width: 14px; height: 14px; flex: none; }
.segctl button:hover { color: var(--ink); }
.segctl button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule-2); }
@media (max-width: 380px) { .theme-row .segctl button span { display: none; } .theme-row .segctl button { padding: 0 10px; } }

/* Dark polish: the inverted pieces read as glare on a dark canvas, so they turn into raised dark surfaces. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brain { box-shadow: inset 0 0 0 1px var(--rule); }
  :root:not([data-theme="light"]) .tabbar { background: var(--sunk); box-shadow: inset 0 0 0 1px var(--rule-2), 0 12px 30px -12px rgba(0,0,0,.8); }
  :root:not([data-theme="light"]) .tabbar a { color: var(--ink); }
  :root:not([data-theme="light"]) .tabbar a.on { color: var(--on-lime); }
  :root:not([data-theme="light"]) .palette { background: rgba(0,0,0,.62); }
}
:root[data-theme="dark"] .brain { box-shadow: inset 0 0 0 1px var(--rule); }
:root[data-theme="dark"] .tabbar { background: var(--sunk); box-shadow: inset 0 0 0 1px var(--rule-2), 0 12px 30px -12px rgba(0,0,0,.8); }
:root[data-theme="dark"] .tabbar a { color: var(--ink); }
:root[data-theme="dark"] .tabbar a.on { color: var(--on-lime); }
:root[data-theme="dark"] .palette { background: rgba(0,0,0,.62); }
.theme-row .label { flex: 1 0 auto; }

/* Kinds of work (KD-37) and written outcomes */
.kind { display: inline-block; vertical-align: 1px; margin-right: 6px; padding: 0 6px; border-radius: 5px; font: 600 10.5px/17px var(--mono); text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); background: var(--canvas); border: 1px solid var(--rule-2); white-space: nowrap; }
.kind.k-code { color: var(--muted); }
.kind.k-discussion, .kind.k-learning, .kind.k-reading { border-style: dashed; }
.later-btn { background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; gap: 5px; }
.later-btn:hover { color: var(--ink); }
.statuspick select { height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.statuspick.lime select { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.statuspick.on select { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.statuspick.warn select { border-color: var(--warn); color: var(--warn); }
.kindpick select { height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ltype { font: 600 10.5px/1 var(--mono); text-transform: uppercase; color: var(--muted); }
.notes { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--canvas); }
.notes .nhead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 6px; }
.notes .prose { font-size: 15px; overflow-wrap: anywhere; }
details.notes summary { cursor: pointer; list-style: none; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes .nprev { display: block; color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
details.notes[open] .nprev { display: none; }
.finish p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.kinds-field { margin-top: 12px; }
.kinds-field .hint-s { font-size: 13px; margin: 2px 0 6px; line-height: 1.45; }
.kinds-field textarea::placeholder { color: var(--muted); opacity: .6; }

/* ---------- hints (qhint, not .hint: that name is already used for helper text): a tiny ? that explains a column, filter or status ---------- */
.qhint { display: inline-grid; place-items: center; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid var(--rule-2);
  background: transparent; color: var(--muted); font: 600 10px/1 var(--sans); cursor: help; vertical-align: middle; flex: none; position: relative; }
.qhint::after { content: ''; position: absolute; inset: -10px; } /* a finger-sized target around the small circle */
.qhint:hover, .qhint:focus-visible, .qhint[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); outline: none; }
.qtip { position: fixed; z-index: 60; max-width: min(300px, calc(100vw - 24px)); padding: 10px 12px; border-radius: var(--r-s);
  background: var(--ink); color: var(--canvas); font: 400 13px/1.45 var(--sans); letter-spacing: 0; text-transform: none;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.45); pointer-events: none; white-space: pre-line; }

/* ---------- batch hand-over (KD-43): select Ready tasks, hand them to one member ---------- */
.selecting .unpickable { opacity: .42; }
.selecting .trow.pickable .st-dot { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--ink); background: transparent; }
.selecting .trow.picked .st-dot { background: var(--lime); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.selecting .trow.picked, .selecting .tcard.picked { background: color-mix(in srgb, var(--lime) 18%, var(--surface)); }
.tcard { position: relative; }
.pickbox { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--ink); background: var(--surface); }
.tcard.picked .pickbox { background: var(--lime); box-shadow: inset 0 0 0 2px var(--surface); }
.selbar { position: sticky; bottom: 16px; z-index: 20; margin-top: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 30px -14px rgba(0,0,0,.35); border-left: 3px solid var(--lime); }
.selbar select { width: auto; min-width: 200px; max-width: 100%; flex: 0 1 auto; }
@media (max-width: 760px) { .selbar { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* KD-81: Briefing filtered to one project. One line of pills that scrolls sideways on a phone. */
.brief-filter { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.brief-filter::-webkit-scrollbar { display: none; }
.brief-filter .pill { flex: none; cursor: pointer; font: inherit; font-size: 13px; background: none; color: inherit; }
.brief-filter .pill.on { background: var(--ink); color: var(--canvas); }

/* ---------- waiting on, assumptions, bottleneck, relations (KD-84) ---------- */
.dep-list { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r-s); background: var(--surface); }
.dep { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--rule); font-size: 14px; min-width: 0; }
.dep:first-child { border-top: 0; }
.dep a { text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.dep a:hover { text-decoration: underline; }
.dep .grow { overflow-wrap: anywhere; }
.dep-w { font-size: 12.5px; white-space: nowrap; }
.dep .btn.sm { height: 28px; padding: 0 10px; }
.cond-dot { width: 10px; height: 10px; border-radius: 3px; border: 1.5px dashed var(--ink-2); flex: none; }
.dep-met { font-size: 13px; margin-top: 8px; }
.dep-add { margin-top: 10px; flex-wrap: nowrap; }
.dep-add input { flex: 1; min-width: 0; }
.dep-add select { max-width: 150px; }
.dep-map { display: inline-block; margin-top: 14px; font-size: 13px; }
.asm-k { flex: none; font: 600 11px/20px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--warn); min-width: 84px; }
.asm.confirmed .asm-k { color: var(--muted); }
.asm.corrected .asm-k { color: var(--ink-2); }
.asm-a { display: block; color: var(--ink-2); margin-top: 2px; }
.waitchip { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px dashed var(--wait); border-radius: 99px; font: 500 11px/18px var(--mono); color: var(--ink-2); vertical-align: 1px; }
.waitcard { border-style: dashed; }
.bneck { border-left: 4px solid var(--lime); }
.bneck.quiet { border-left-color: var(--warn); }
.bneck-l { font-size: 18px; line-height: 1.35; letter-spacing: -.01em; margin: 8px 0 4px; }
.bneck-l a { text-decoration: none; }
.bneck-l a:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .dep { flex-wrap: wrap; }
  .dep-w { order: 3; width: 100%; padding-left: 20px; white-space: normal; }
  .dep-add { flex-wrap: wrap; }
  .dep-add select { max-width: none; flex: 1; }
}

.map-switch { gap: 6px; margin-bottom: 16px; }
.rel-tools { gap: 6px; margin-top: 4px; }
.rel-tools .spacer { flex: 1; }
.rel-subs { gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.rel-card { margin-top: 16px; padding: 0; overflow: hidden; }
.rel { overflow: auto; max-height: 72vh; -webkit-overflow-scrolling: touch; }
.rel-in { position: relative; }
.rel-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.rel-e { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.rel-e.sub { stroke: var(--wait); stroke-dasharray: 2 4; stroke-linecap: round; }
.rel-e.met { stroke: var(--wait); stroke-dasharray: 6 5; opacity: .6; }
.rel-e.hot { stroke: var(--ink); stroke-width: 2.4; }
.ah { fill: var(--ink-2); } .ah.sub, .ah.met { fill: var(--wait); }
.rel-n { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--rule-2); background: var(--surface); text-decoration: none; color: inherit; box-shadow: var(--shadow); overflow: hidden; }
a.rel-n:hover { border-color: var(--ink); }
.rel-n.condition { border-style: dashed; background: var(--canvas); }
.rel-n.bn { border: 2px solid var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 35%, transparent); }
.rel-n.focus { border: 2px solid var(--ink); }
.rel-n.dim { opacity: .45; }
.rel-n.fin { opacity: .6; }
.rel-k { display: flex; gap: 6px; align-items: center; font: 500 11.5px/1.2 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-k .st-dot { width: 8px; height: 8px; flex: none; }
.rel-t { font-size: 13.5px; line-height: 1.25; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-f { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-f .q { color: var(--warn); font-weight: 600; }
.rel-empty { padding: 40px 24px; max-width: 560px; }
.rel-empty h2 { font-size: 20px; margin-bottom: 8px; }
.map-key .k-wait, .map-key .k-sub, .map-key .k-met { width: 22px; height: 0; border-top: 2px solid var(--ink-2); border-radius: 0; }
.map-key .k-sub { border-top: 2px dotted var(--wait); }
.map-key .k-met { border-top: 2px dashed var(--wait); }
.map-key .k-cond { border: 1.5px dashed var(--ink-2); background: transparent; }
.map-key .k-bn { border: 2px solid var(--lime); background: transparent; }
