/* REQ-126: the Dashboard (crew cards, summary counts, shipped stories, notes on cards). The colour tokens (:root) and shared components are in ../styles.css; this file never defines :root variables. */

.summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .summary { grid-template-columns: minmax(0, 1fr); } }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.count { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.count strong { font-family: var(--font-display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.count span i { width: 8px; height: 8px; border-radius: 50%; }
.inbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.inbox h2 { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--needs); }
.inbox ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.inbox li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.inbox li b { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.inbox .none { color: var(--mute); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--st); }
.top { display: flex; align-items: center; gap: 12px; }
.mono { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--st); background: var(--st-soft); flex: none; }
.who { flex: 1; min-width: 0; }
.who h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.who p { margin: 2px 0 0; color: var(--mute); font-size: 13px; }
.now { font-weight: 700; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.block h4 { margin: 0 0 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.block.needs h4 { color: var(--needs); }
/* REQ-170.3.1 (Pablo): Gus's PRs not ready: a ref chip, the state in words with a glyph (status tokens only), the author and the time; wraps to two lines on a phone. */
.block.pr-chase ul { list-style: none; padding-left: 0; gap: 6px; }
.block.pr-chase .pc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.block.pr-chase .pc-ref { font-family: var(--font-mono); text-decoration: none; color: var(--accent); min-height: 24px; display: inline-flex; align-items: center; }
.block.pr-chase .pc-ref:hover { text-decoration: underline; }
.block.pr-chase .pc-state { font-weight: 600; }
.block.pr-chase .pc-state.pc-bad { color: var(--blocked); }
.block.pr-chase .pc-state.pc-needs { color: var(--needs); }
.block.pr-chase .pc-state.pc-mute, .block.pr-chase .pc-who, .block.pr-chase .pc-note, .block.pr-chase .pc-more { color: var(--mute); }
.block.pr-chase .pc-more { margin: 4px 0 0; font-size: 13px; }
.block ul { margin: 0; padding-left: 18px; color: var(--mute); font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.log { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.log div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; font-size: 13px; color: var(--mute); }
.log time { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.foot { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.foot .session-link { color: var(--accent); font-weight: 700; text-decoration: none; padding: 6px 0; }
.foot .session-link:hover { text-decoration: underline; }
.foot .session-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 18px; padding: 28px; text-align: center; color: var(--mute); }

details.protocol { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
details.protocol summary { cursor: pointer; font-weight: 700; }
details.protocol summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
details.protocol p { color: var(--mute); margin: 10px 0; max-width: 72ch; }

.card.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.counts { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1000px) { .counts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.with { font-size: 13px; color: var(--meeting); font-weight: 700; }
@media (max-width: 760px) { .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Teams: one section of cards per team, and a room tag in the office. */
.teams { display: flex; flex-direction: column; gap: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .cards { grid-template-columns: minmax(0, 1fr); } }

/* Agent avatars */
.card .avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--st); background: var(--st-soft); }

/* Shipped stories (top of the page) */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.story { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.story .ring { position: relative; width: 70px; height: 70px; border-radius: 50%; padding: 3px; box-sizing: border-box; background: conic-gradient(from 200deg, #facc15, #f97316, #ec4899, #8b5cf6, #facc15); display: grid; place-items: center; }
.story .ring img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); box-sizing: border-box; background: var(--panel); }
.story.seen .ring { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.story-item { font: 800 12px/1.1 var(--font-mono); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-who { font: 600 11px/1.1 var(--font-body); color: var(--mute); }
.story:focus-visible .ring { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-none { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 14px; }
.story-none .ring.empty { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--ink) 30%, transparent); display: grid; place-items: center; font-size: 22px; flex: none; }
body.story-open { overflow: hidden; }
.story-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(8, 6, 14, 0.92); display: grid; place-items: center; padding: 16px; }
.story-viewer[hidden] { display: none; }
.sv-card { position: relative; width: min(400px, 100%); height: min(711px, calc(100vh - 32px)); border-radius: 18px; overflow: hidden; color: #fff; background: radial-gradient(120% 80% at 50% 20%, color-mix(in srgb, var(--c) 75%, #fff 0%), color-mix(in srgb, var(--c) 35%, #0b0814) 70%, #0b0814); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); user-select: none; cursor: pointer; display: flex; flex-direction: column; }
.sv-bars { display: flex; gap: 4px; padding: 10px 10px 0; }
.sv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.sv-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars span.done i { width: 100%; }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.sv-head img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.sv-head b { display: block; font: 800 14px/1.2 var(--font-body); }
.sv-head span { font: 600 12px/1.2 var(--font-body); opacity: .8; }
.sv-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.3); color: #fff; font-size: 16px; cursor: pointer; }
.sv-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 24px 34px; text-align: center; }
.sv-avatar { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 0 0 5px #fff, 0 12px 30px rgba(0, 0, 0, 0.35); background: #fff; }
.sv-pkg { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: #c8955a; color: #3b1d0b; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15); }
.sv-box { font-size: 28px; }
.sv-id { font: 800 26px/1 var(--font-mono); }
.sv-stamp { transform: rotate(-8deg); border: 3px solid #4ade80; color: #4ade80; font: 900 22px/1 var(--font-display); letter-spacing: .14em; padding: 6px 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); }
.sv-text { margin: 0; font: 700 17px/1.4 var(--font-body); max-width: 320px; }
.sv-role { margin: 0; font: 600 13px/1.3 var(--font-body); opacity: .8; }
.sv-link { color: #fff; font: 800 14px/1 var(--font-body); padding: 9px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); text-decoration: none; }
.sv-link:focus-visible, .sv-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.story-n { position: absolute; right: -2px; bottom: -2px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #ec4899; color: #fff; border: 2px solid var(--bg); font: 800 11px/18px var(--font-mono); text-align: center; }
/* REQ-50: story kinds. Each has a label and an icon; the ring colour reuses
   the status families (Shipped --done, Plan --qa, Way of working --staging,
   Decision --release). */
.story { --k: var(--done); }
.story.k-plan { --k: var(--qa); } 
.story.k-process { --k: var(--staging); } 
.story.k-decision { --k: var(--release); } 
.story.k-idea { --k: var(--review); }
.story .ring { background: var(--k); }
.story.seen .ring { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.story-k { position: absolute; left: -2px; bottom: -2px; width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; background: var(--panel); color: var(--k); border: 2px solid var(--k); display: grid; place-items: center; font: 800 12px/1 var(--font-body); }
.story-k, .sv-kind-i { z-index: 0; }
.story.k-decision .story-k { border: 0; background: none; }
.story.k-decision .story-k::before, .sv-card.k-decision .sv-kind-i::before { content: ''; position: absolute; inset: 3px; z-index: -1; border: 2px solid currentColor; border-radius: 3px; background: var(--panel); transform: rotate(45deg); }
.story { width: 84px; position: relative; }
.story-who { display: flex; flex-direction: column; align-items: center; max-width: 84px; text-align: center; }
.story-who > span { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-kl { font: 800 10.5px/1.2 var(--font-body); letter-spacing: .02em; color: var(--k); }
.story.seen .story-kl { color: var(--mute); }
.story-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.story-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.story-filter[hidden] { display: none; }
.story-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 700 13px/1 var(--font-body); cursor: pointer; }
.story-chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.story-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-chip-n { font: 800 11px/1 var(--font-mono); opacity: .7; }
.sv-kind { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); font: 800 13px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.sv-kind-i { font-size: 18px; letter-spacing: 0; }
.sv-card.k-decision .sv-kind-i { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: 12px; }
.sv-card.k-decision .sv-kind-i::before { background: transparent; }
.sv-sentence { margin: 0; font: 600 18px/1.45 var(--font-body); max-width: 340px; }
.sv-by { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 13px/1.3 var(--font-body); opacity: .9; }
.sv-by img { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
@media (max-width: 480px) { .story-chip { padding: 0 11px; font-size: 12.5px; } }
/* Phone widths: the live label stays on one line; long code paths wrap. */
#liveText { white-space: nowrap; }
details.protocol code { overflow-wrap: anywhere; }
.office-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; min-height: 44px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); text-decoration: none; }
.office-link:hover { border-color: var(--accent); }
.office-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.office-link-t { display: flex; flex-direction: column; gap: 4px; }
.office-link-t b { font: 800 18px/1.2 var(--font-display); color: var(--accent); }
.office-link-t span { color: var(--mute); font-size: 14px; }
.office-link-w { padding: 8px 12px; border-radius: 999px; background: var(--needs-soft); color: var(--needs); font: 800 13px/1 var(--font-body); }
.office-link-w.none { background: var(--done-soft); color: var(--done); }
.office-link-w:empty { display: none; }

/* REQ-68.3.1: the card's last wake-up, one muted line under the status. */
.wake-line { margin: 2px 0 0; font-size: 12.5px; color: var(--mute); }
.wake-line time { font-variant-numeric: tabular-nums; }

/* REQ-68: the idle count in the summary (a 44 px button) and the wake-up switch. */
/* REQ-35: the status counts are buttons that filter the cards. Selected:
   a 2 px outline in the status ink, its soft fill, a "Filtering" tag and the
   label in --ink (not colour alone). */
button.count { font: inherit; color: var(--ink); text-align: left; cursor: pointer; min-height: 44px; }
button.count:hover { border-color: var(--st, var(--line)); }
button.count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.count.on:not(.idle-work) { background: var(--st-soft); border-color: var(--st); box-shadow: inset 0 0 0 1px var(--st); }
button.count.on:not(.idle-work) span { color: var(--ink); font-weight: 700; flex-wrap: wrap; }
.count-tag { white-space: nowrap; font: 800 9.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; background: var(--ink); color: var(--panel); }
.count-tag::before { content: '✓ '; }
.card-filter { margin-block: -14px 0; display: none; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink); }
.card-filter.on { display: flex; }
.card-filter .cf-text { font-weight: 700; }
.card-filter .cf-act { display: inline-flex; align-items: center; gap: 8px; }
.card-filter .cf-act[hidden] { display: none; }
.cf-all { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 700 14px/1 var(--font-body); cursor: pointer; }
.cf-all:hover { background: var(--accent-soft); }
.cf-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count.idle-work { min-height: 44px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; border-radius: 10px; padding: 6px 12px; }
.count.idle-work.on { box-shadow: inset 0 0 0 2px var(--accent); }
.wake-switch-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.wake-switch { position: relative; width: 48px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: var(--idle-soft); cursor: pointer; padding: 0; }
.wake-switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--mute); transition: left .15s; }
.wake-switch[aria-checked="true"] { background: var(--accent); }
.wake-switch[aria-checked="true"] .knob { left: 23px; background: var(--panel); }
@media (prefers-reduced-motion: reduce) { .wake-switch .knob { transition: none; } }

/* REQ-66.3: a note from Nora on an agent's card. Reuses the block and chip styles; state = shape + word. */
.block.anote h4 { display: flex; gap: 6px; align-items: baseline; }
.block.anote h4 time { text-transform: none; letter-spacing: 0; color: var(--faint); }
.note-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-state { display: inline-flex; align-items: center; gap: 5px; }
.note-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; flex: none; }
.ns-open::before { border: 1.5px solid currentColor; }
.ns-accepted::before { content: "✓"; width: auto; height: auto; border-radius: 0; }
.ns-declined::before { content: "✕"; width: auto; height: auto; border-radius: 0; }
.ns-done::before { content: "✓"; width: 12px; height: 12px; line-height: 12px; text-align: center; font-size: 9px; background: currentColor; color: var(--panel); }
.note-ref { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--accent); }
.note-ref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.note-text { margin: 4px 0 0; color: var(--mute); font-size: 14px; overflow-wrap: anywhere; }
.note-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-more { margin-top: 4px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.note-one { color: var(--mute); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.note-reason { display: block; margin-top: 4px; color: var(--mute); font-size: 13.5px; font-style: italic; }
.summary { width: 100%; max-width: 1440px; margin-inline: auto; }
details.protocol p { max-width: 72ch; }

/* REQ-120: what a held PR waits on, on its card chip (Pablo: a pause sign and the words). */
.pr-hold { color: var(--mute); }
.pr-hold a { color: inherit; text-decoration: underline; }
.pr-hold.over { color: var(--ink); font-weight: 700; }

/* REQ-172.3 (Pablo): an agent card's products, at most 2 then '+N', and a
   'Shared' chip when it works on several products. */
.prod-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.prod-chip { color: var(--ink); }
.chip.prod-shared { color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
/* REQ-174.2.4: the skill an agent is using now, under its now-line. */
.chip.skill-now { display: inline-block; margin-top: 4px; color: var(--ink); }
/* REQ-180.4.2: the skill chip and the last hook signal, side by side (one small muted line). */
.card-signals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.card-signals .chip.skill-now { margin-top: 0; }
.signal-line { font-size: 12.5px; color: var(--mute); }
.signal-line time { font-variant-numeric: tabular-nums; }

/* REQ-211.4.4: on Wren's card, each release document that missed this
   morning's refresh (words and the ⚠, never colour alone), each a link to it. */
.card-missed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--needs-soft); color: var(--ink); font-size: 13px; }
.card-missed-h { font-weight: 700; }
.card-missed a { color: var(--ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
