:root {
  /* surfaces, ink, accent and status live in tokens.css */
  --qw: #1F6B3A; --qw-bg: #E3F0E6; --plan: #234E9A; --plan-bg: #E5EBF6; --major: #A42A1E; --major-bg: #F6E3E0;
  --chal: #7A5200; --chal-bg: #F4EAD3; --fill: #474C54; --fill-bg: #EAE8E2; --fmt: #5B4A8A; --fmt-bg: #ECE8F5;
  --verify: #C27C0E;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--accent); } a:hover { color: var(--accent-ink); }
button { font-family: inherit; cursor: pointer; }
.shell { display: flex; min-height: 100vh; }
aside.side { width: 240px; flex-shrink: 0; background: var(--side); color: #E9E7E1; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand b { display: block; font-family: 'Source Serif 4', Georgia, serif; font-size: 22px; color: #fff; }
.brand span, .side .grp { font-size: 12px; color: #B9B6AE; letter-spacing: .06em; text-transform: uppercase; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: block; padding: 11px 12px; border-radius: 8px; text-decoration: none; color: #C9C6BE; font-weight: 500; }
.side nav a.on { color: #fff; background: #2E4643; font-weight: 600; }
.side .grp { padding: 10px 12px 4px; }
.tool { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: #D9D6CE !important; }
.tag { font-size: 11px; color: var(--side); background: #B9B6AE; border-radius: 4px; padding: 1px 6px; }
.rolebox { margin-top: auto; background: #262A2E; border-radius: 10px; padding: 12px; font-size: 12px; color: #B9B6AE; display: flex; flex-direction: column; gap: 6px; }
.rolebox select { width: 100%; height: 36px; border-radius: 6px; border: 0; padding: 0 8px; font: inherit; }
main { flex: 1; min-width: 0; padding: 26px 40px 40px; display: flex; flex-direction: column; gap: 18px; }
h1 { margin: 0; font-family: 'Source Serif 4', Georgia, serif; font-size: 32px; line-height: 1.2; }
h2 { margin: 0; font-size: 17px; } h3 { margin: 0; font-size: 15px; }
.lead { margin: 0; font-size: 16px; color: var(--ink-2); max-width: 920px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g7 { grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
.crumb { display: flex; gap: 8px; font-size: 13px; color: var(--muted); align-items: center; }
.topbar { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); gap: 12px; flex-wrap: wrap; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 6px 4px; font-size: 13px; }
.btn { height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid #C9C4B8; background: #fff; font-size: 14px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.pill { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9C4B8; background: #fff; font-size: 13px; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.word { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; justify-self: start; white-space: nowrap; }
.w-act { color: #fff; background: var(--major); } .w-watch { color: #5C3D00; background: #F4DDA8; } .w-ok { color: var(--qw); background: var(--qw-bg); } .w-early { color: var(--accent); background: var(--accent-soft); }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.p-quick-win { color: var(--qw); background: var(--qw-bg); } .p-plan { color: var(--plan); background: var(--plan-bg); } .p-major { color: var(--major); background: var(--major-bg); } .p-challenge { color: var(--chal); background: var(--chal-bg); } .p-fill-in { color: var(--fill); background: var(--fill-bg); } .p-format { color: var(--fmt); background: var(--fmt-bg); }
.src { font-size: 12px; color: var(--muted); }
.src .live { color: var(--qw); font-weight: 600; } .src .snap { color: var(--chal); font-weight: 600; }
.bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; }
.stage { background: #F8F7F3; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stage.hot { background: #FBF3E4; border-color: #E8C98E; }
.stage .n { font-size: 24px; font-weight: 600; line-height: 1.1; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.row { display: grid; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: start; font-size: 13px; }
.meter { height: 12px; background: #F1EFE9; border-radius: 4px; } .meter > div { height: 12px; border-radius: 4px; background: var(--verify); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; }
.signal .big { font-size: 34px; font-weight: 600; line-height: 1.1; }
.guide { display: flex; gap: 18px; align-items: center; background: var(--accent); color: #fff; border-radius: 14px; padding: 16px 20px; }
.guide .btn { height: 40px; }
.panel { position: fixed; top: 70px; right: 40px; width: 460px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid #C9C4B8; border-radius: 14px; padding: 18px 20px; box-shadow: 0 12px 32px rgba(26,28,32,.14); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.decision { display: grid; grid-template-columns: 1fr 200px 330px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.btnrow { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sel-accept { background: var(--qw) !important; color: #fff !important; border-color: var(--qw) !important; }
.sel-reject { background: var(--major) !important; color: #fff !important; border-color: var(--major) !important; }
.sel-amend, .sel-defer { background: #5A5F66 !important; color: #fff !important; border-color: #5A5F66 !important; }
.sel-arb { background: var(--plan) !important; color: #fff !important; border-color: var(--plan) !important; }
.sel-decide { background: var(--qw) !important; color: #fff !important; border-color: var(--qw) !important; }
.layout-review { display: flex; gap: 18px; align-items: flex-start; }
.itemlist { width: 330px; flex-shrink: 0; max-height: 78vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.itembtn { width: 100%; text-align: left; border: 1px solid transparent; background: #fff; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.itembtn.on { background: var(--accent-soft); border: 2px solid var(--accent); }
.fields { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 14px; }
.fields .k { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.q-cur { font-style: italic; color: var(--ink-2); background: #F6F4EF; border-radius: 8px; padding: 8px 12px; }
.q-new { font-style: italic; color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }
.type { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #fff; border-radius: 6px; padding: 3px 8px; }
.storycard { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); min-height: 44px; }
.storycard.on { background: var(--accent-soft); border: 2px solid var(--accent); }
.col-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.banner { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.bchip { background: var(--chal-bg); color: var(--chal); border-radius: 6px; padding: 4px 10px; font-weight: 500; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.stepper li { border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.stepper li.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.stepper li.cur { border: 2px solid var(--accent); }
.stepper li.lock { background: var(--fill-bg); border: 1px dashed #8E918F; color: var(--fill); }
input[type=text], input[type=url], input[type=search], input[type=password], textarea, select { font: inherit; border: 1px solid #D6D2C8; border-radius: 8px; padding: 10px 12px; background: #fff; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.validate { border: 1px dashed #C9C4B8; border-radius: 12px; padding: 14px 16px; background: #FBFAF7; display: flex; flex-direction: column; gap: 10px; }
.validate .vrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.validate textarea { width: 100%; min-height: 60px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; z-index: 9; max-width: 420px; }
.modebadge { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 6px; }
.modebadge.demo { background: var(--chal-bg); color: var(--chal); } .modebadge.live { background: var(--qw-bg); color: var(--qw); }
@media (max-width: 900px) {
  .shell { flex-direction: column; } aside.side { width: auto; height: auto; position: static; }
  main { padding: 16px; } .g2, .g3, .g4, .g7, .decision, .stepper { grid-template-columns: 1fr; } .layout-review { flex-direction: column; } .itemlist { width: 100%; }
}

mark.anc { background: #FBEBC8; border-bottom: 2px solid #C27C0E; padding: 1px 0; position: relative; cursor: help; color: inherit; }
mark.anc .tip { display: none; position: absolute; left: 0; top: 100%; z-index: 6; width: 380px; background: #fff; color: var(--ink); border: 1px solid #C9C4B8; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 10px 24px rgba(26,28,32,.16); white-space: normal; }
mark.anc:hover .tip, mark.anc:focus .tip { display: block; }
.p-manual { color: #1E5B57; background: var(--accent-soft); }

/* Workflow guide steps */
.wf-step { border-radius: 8px; padding: 10px 12px; background: rgba(255,255,255,.6); }
.wf-active { background: #fff; box-shadow: 0 2px 8px rgba(26,28,32,.10); }
.wf-done { opacity: .7; }

/* Story quality audit */
.qconcerns { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.qsec, .qsec > * { min-width: 0; }
.qimpact { background: #FBF3E4; border-left: 3px solid var(--verify); border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.qimpact strong { font-size: 12px; color: #7A5200; text-transform: uppercase; letter-spacing: .04em; }
.qbar { display: grid; grid-template-columns: 210px 1fr 96px; gap: 10px; align-items: center; min-height: 34px; text-decoration: none; color: var(--ink); border-radius: 8px; padding: 2px 6px; }
.qbar:hover, .qbar:focus { background: var(--accent-soft); }
.qlab { font-size: 13px; } .qlab b { font-family: 'IBM Plex Mono', monospace; margin-right: 6px; }
.qtrack { height: 14px; background: #F1EFE9; border-radius: 4px; overflow: hidden; }
.qtrack span { display: block; height: 14px; background: var(--accent); border-radius: 0 4px 4px 0; }
.qnum { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
table.qheat { border-collapse: separate; border-spacing: 2px; font-size: 12px; width: 100%; }
table.qheat th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 6px; white-space: nowrap; }
table.qheat td { padding: 0; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
a.qcell { display: block; min-width: 34px; padding: 7px 4px; border-radius: 4px; text-decoration: none; font-weight: 600; }
a.qcell:hover, a.qcell:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.qfilters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qfilters select, .qfilters input[type=search] { height: 38px; padding: 0 10px; }
.qdetail { border: 2px solid var(--accent); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #FBFAF7; }
tr.qsel td { background: var(--accent-soft); }
details summary { cursor: pointer; list-style-position: outside; }
@media (max-width: 900px) { .qsec .row, .qsec .decision { grid-template-columns: 1fr !important; } .qsec table.t { display: block; overflow-x: auto; } .qfilters select, .qfilters input[type=search] { max-width: 100%; flex: 1 1 100%; } .qbar { grid-template-columns: 1fr 70px; } .qbar .qtrack { grid-column: 1 / -1; grid-row: 2; } }

/* Architecture shift */
.shiftlead { background: var(--accent); border-color: var(--accent); }
.shiftq { margin: 0; color: #fff; font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; line-height: 1.4; max-width: 980px; }
.shiftk { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.shiftrow { flex-direction: row; gap: 16px; align-items: flex-start; }
.shiftnum { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; }
.chain { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; }
.chain-l { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chainrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cbox { border: 1px dashed #C9C4B8; border-radius: 8px; padding: 8px 12px; font-size: 13px; background: #FBFAF7; color: var(--ink-2); }
.cbox.on { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.cbox.strong { background: var(--accent); color: #fff; font-weight: 600; }
.carr { color: var(--muted); font-weight: 600; } .carr.big { font-size: 22px; align-self: center; }
.fromto { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 12px; }
.fromto > div:first-child { background: #F6F4EF; border-radius: 10px; padding: 10px 14px; }
.fromto > div:last-child { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.fromto p { margin: 4px 0 0; }
.shiftlist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .fromto { grid-template-columns: 1fr; } .fromto .carr { display: none; } .shiftrow { flex-direction: column; } .chain { grid-template-columns: 1fr; } }

/* Folded sections (L-72: one screen, the rest on demand) */
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.fold summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.fold summary::after { content: '+'; color: var(--muted); font-size: 18px; }
.fold[open] summary::after { content: '–'; }
.fold .foldbody { padding: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.navfold summary { cursor: pointer; list-style: none; }
.navfold summary::after { content: ' ›'; }
.navfold[open] summary::after { content: ' ⌄'; }

/* Two layers (L-76): plain words first, the precise record on click */
.plain { margin: 0; color: var(--ink-2); font-size: 15px; }
.dd { display: inline-block; font-size: 12px; margin-top: 2px; }
.dd summary { cursor: pointer; color: var(--muted); list-style: none; text-decoration: underline dotted; }
.dd summary::-webkit-details-marker { display: none; }
.dd[open] summary { color: var(--ink-2); }
.dd .ddbody { margin: 6px 0 2px; padding: 8px 10px; background: var(--surface-2, #F6F5F1); border-left: 3px solid var(--line); border-radius: 6px; color: var(--ink-2); font-size: 13px; max-width: 760px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }

/* Working session */
.prog { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; } .prog span { display: block; height: 100%; background: var(--accent, #2E4643); }
.stepdone { font-weight: 700; color: var(--qw); } .stepon { text-decoration: underline; }
label.small input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Assist (AI drafts the person confirms) */
.assist { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.assist .assistq { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.aiout { background: var(--surface-2, #F6F5F1); border-left: 3px solid var(--accent, #2E4643); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.aitag { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.btn.suggest { outline: 2px solid var(--accent, #2E4643); outline-offset: 2px; }

/* Proposals on cards and steps (4 Oct): every question starts from our answer */
.propose { font-size: 13px; color: var(--ink-2); margin-top: 2px; padding-left: 8px; border-left: 2px solid var(--accent, #2E4643); }
.proposal { background: var(--surface-2, #F6F5F1); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
select#sChoice { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface, #fff); color: inherit; max-width: 100%; }

/* Session companion (4 Oct): a running, streamed conversation beside the host */
.comp { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.comphead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.compthread { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.bub { max-width: 88%; border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.bub.ai { align-self: flex-start; background: var(--surface-2, #F6F5F1); border-left: 3px solid var(--accent, #2E4643); }
.bub.me { align-self: flex-end; background: var(--line-2, #ECEAE4); }
.bub .who { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bub .bt { white-space: pre-wrap; line-height: 1.5; }
.bub .btn { align-self: flex-start; }
.typing { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.compin { display: flex; gap: 8px; }
.compin .compq { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.comphead label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---- 4 Oct feedback: focus layout, reading guide, plain codes, pictures, current → gaps → future ---- */
.hdr { display: flex; flex-direction: column; gap: 6px; }
.hdr h1 { font-size: 26px; line-height: 1.2; margin: 0; }
.hdr h1.sm { font-size: 22px; }
.kick { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sect { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.adhoc { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
abbr.code { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.orient { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }
.orient b { color: var(--accent); }
.fstage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.fstage > .cside { position: sticky; top: 14px; }
.cside .comp { border-top: 0; padding-top: 0; }
.cside .compthread { max-height: calc(100vh - 250px); min-height: 160px; }
.focus { gap: 14px; }
.fq { font-size: 26px; line-height: 1.25; margin: 0; }
.cgf { display: grid; grid-template-columns: 1fr 1fr 1.5fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cgf > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cgf > div + div { border-left: 1px solid var(--line); }
.cgf p, .cgf ul { margin: 0; font-size: 14px; line-height: 1.5; }
.cgf ul { padding-left: 16px; }
.cg-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cg-gap { background: #FBF4E8; }
.cg-fut { background: var(--accent-soft); }
.opt { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; line-height: 1.45; }
.opt input { margin-top: 3px; }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt .ow { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
.rec { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 160px; gap: 8px 10px; align-items: end; }
.rec .vbtns { grid-column: 1 / -1; align-items: center; }
.rec label { display: flex; flex-direction: column; gap: 4px; }
.rec input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 0; }
.vbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.navrow { display: flex; justify-content: space-between; gap: 8px; }
.steps a.stepon { font-weight: 700; color: var(--ink); }
ol.settle { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
ol.settle li { padding-left: 2px; }
.settle .sq { display: block; font-weight: 600; font-size: 14px; }
.propose { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; padding-left: 8px; border-left: 2px solid var(--accent); }
ul.lk { margin: 0; padding-left: 16px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.convgrid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
.convside { display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line-2); padding-left: 18px; }
.convmain { display: flex; flex-direction: column; gap: 10px; }
.later { gap: 2px; }
.laterrow { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; font-size: 14px; }
.laterrow:last-child { border-bottom: 0; }
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vdot { display: inline-block; min-width: 16px; text-align: center; border-radius: 8px; font-size: 11px; font-weight: 700; color: #fff; background: var(--ok); padding: 0 4px; }
.vdot.change { background: var(--risk); }
.picard { gap: 12px; }
.pichead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pic { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pich { display: flex; flex-direction: column; gap: 2px; }
.pich strong { font-size: 17px; }
.pich span { color: var(--ink-2); font-size: 14px; }
.pic svg { width: 100%; height: auto; display: block; font-family: inherit; }
.pic text { fill: var(--ink); font-size: 12px; }
.pic .lane { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; fill: var(--muted); }
.pic .wk { font-size: 11px; font-weight: 600; fill: var(--ink-2); }
.pic .wkd { font-size: 11px; fill: var(--muted); }
.pic .grid { stroke: var(--line-2); stroke-width: 1; }
.pic .pv rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.pic .pv.last rect { fill: var(--line-2); stroke: var(--muted); }
.pic .pvn { font-weight: 700; font-size: 12px; }
.pic .pvs { font-size: 11px; fill: var(--ink-2); }
.pic .cy { fill: var(--line-2); }
.pic .cyn { font-size: 11px; fill: var(--ink-2); }
.pic .base { stroke: var(--line); stroke-width: 2; }
.pic .dm circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.pic .dm.risk circle { fill: var(--risk); stroke: var(--risk); }
.pic .dmn { font-weight: 700; }
.pic .dms { font-size: 11px; fill: var(--ink-2); }
.pic .dm.risk .dms { fill: var(--risk); font-weight: 600; }
.pic .gt polygon { fill: var(--ink); }
.pic .gtn { font-size: 11px; font-weight: 600; }
.pic .mk line { stroke: var(--muted); stroke-width: 2; }
.pic .mkn { font-size: 11px; fill: var(--ink-2); }
.pic .today line { stroke: var(--risk); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pic .tdy { font-size: 11px; font-weight: 700; fill: var(--risk); }
.pic .band { fill: var(--line-2); opacity: .55; }
.pic .band.accent { fill: var(--accent-soft); opacity: .7; }
.pic .bandl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; fill: var(--muted); }
.pic .note { font-size: 11px; font-style: italic; fill: var(--muted); }
.pic .edge { fill: none; stroke: #6B7078; stroke-width: 1.4; }
.pic .edge.dashed { stroke-dasharray: 5 4; }
.pic .edge.gap { stroke: var(--risk); stroke-dasharray: 6 4; stroke-width: 1.6; }
.pic .arh { fill: #6B7078; }
.pic .arh.gap { fill: var(--risk); }
.pic .elab { font-size: 11px; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.pic .elab.gap { fill: var(--risk); font-weight: 600; }
.pic .nd rect { fill: var(--surface); stroke: #8A8F96; stroke-width: 1.2; }
.pic .nd.ours rect { fill: #EEF5F4; stroke: var(--accent); stroke-width: 1.5; }
.pic .nd.partial rect { fill: #FBF1DE; stroke: #B7791F; stroke-width: 1.5; }
.pic .nd.new rect { fill: #E8F0FB; stroke: #3B6CC4; stroke-width: 1.5; }
.pic .nd.missing rect { fill: transparent; stroke: #9AA0A6; stroke-dasharray: 5 4; }
.pic .nd.missing text { fill: var(--muted); }
.pic .nd.check rect { fill: var(--surface); stroke: #9AA0A6; stroke-dasharray: 2 3; }
.pic .ndl { font-weight: 700; font-size: 13px; }
.pic .nds { font-size: 11px; fill: var(--ink-2); }
.pic .ndw { font-size: 11px; font-weight: 700; fill: var(--accent); }
.pic .lgt { font-size: 11px; fill: var(--ink-2); }
.demogrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.dcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; background: var(--surface); }
.dcard.risk { border-color: var(--risk); }
.dct { font-weight: 700; font-size: 13px; }
.dcg { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.dcp { color: var(--ink-2); line-height: 1.4; }
@media (max-width: 1180px) { .fstage { grid-template-columns: 1fr; } .fstage > .cside { position: static; } .cside .compthread { max-height: 340px; } .demogrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cgf { grid-template-columns: 1fr; } .cgf > div + div { border-left: 0; border-top: 1px solid var(--line); } .convgrid { grid-template-columns: 1fr; } .convside { border-left: 0; padding-left: 0; } .rec { grid-template-columns: 1fr 1fr; } }

/* ===== v3 (4 Oct, third pass): top bar, big picture, drawers, companion pop-up, board, audit ===== */
body.v3 main { max-width: 1320px; margin: 0 auto; width: 100%; box-sizing: border-box; padding: 22px 32px 60px; }
.topnav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 10px 32px; background: var(--side); color: #E9E7E1; }
.brand3 { display: flex; flex-direction: column; text-decoration: none; color: #fff; line-height: 1.1; }
.brand3 b { font-family: 'Source Serif 4', Georgia, serif; font-size: 19px; }
.brand3 span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #B9B6AE; }
#nav { display: flex; gap: 4px; flex: 1; }
#nav a { color: #C9C6BE; text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 500; }
#nav a.on { background: #2E4643; color: #fff; font-weight: 600; }
.tright { display: flex; gap: 6px; }
.tb { background: transparent; border: 1px solid #3A3D42; color: #E9E7E1; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tb:hover { border-color: #6B7078; }
.tb.ic { padding: 6px 8px; }
.tb.ic svg { display: block; }
.tend { display: inline-flex; gap: 6px; }
.tb .count { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #9AA0A6; flex-shrink: 0; }
.sdot.ok { background: var(--ok); } .sdot.part { background: #C27C0E; } .sdot.no { background: var(--risk); }
.pop { position: fixed; top: 58px; right: 24px; z-index: 30; width: 360px; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.srclist, .fblist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.srclist li { display: flex; gap: 10px; align-items: flex-start; } .srclist .sdot { margin-top: 7px; }
.fblist li { border-bottom: 1px solid var(--line-2); padding-bottom: 8px; }
.pop select { display: block; width: 100%; margin-top: 4px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; }
/* spark: the companion, on demand */
.spark { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font-size: 13px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.spark:hover { background: var(--accent); color: #fff; }
.iconbtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.compop { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 400px; max-height: min(560px, calc(100vh - 100px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cphead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cphead strong { display: block; font-size: 14px; line-height: 1.35; margin-top: 2px; }
.compop .compthread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.compop .bub { max-width: 92%; }
/* drawer: detail for whatever was clicked, with connected topics */
.drawer { position: fixed; top: 58px; right: 0; bottom: 0; z-index: 25; width: 480px; max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.10); padding: 18px 22px 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.dwhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dwhead h2 { font-size: 20px; line-height: 1.3; }
.dwbtns { display: flex; gap: 6px; align-items: center; }
.dwbody { display: flex; flex-direction: column; gap: 10px; }
.dwbody .cgf { grid-template-columns: 1fr; } .dwbody .cgf > div + div { border-left: 0; border-top: 1px solid var(--line); }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); font-weight: 600; } dl.kv dd { margin: 0; }
.rel { display: flex; flex-direction: column; gap: 6px; }
.relchip { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px; display: flex; flex-direction: column; gap: 1px; }
.relchip:hover { border-color: var(--accent); }
.relchip .rk { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.alist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.arow { width: 100%; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: start; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px 10px; cursor: pointer; font: inherit; font-size: 14px; }
.arow .ad { font-weight: 700; } .arow .aw { display: flex; flex-direction: column; }
/* big picture */
.bp-sec { scroll-margin-top: 80px; transition: opacity .25s; }
.hero { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 6px; }
.hero h1 { font-size: 30px; max-width: 1000px; }
.chips3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nchip { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 16px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.nchip b { font-size: 24px; line-height: 1.15; } .nchip span { color: var(--ink-2); font-size: 14px; }
.nchip:hover { border-color: var(--accent); } .nchip.static { cursor: default; } .nchip.static:hover { border-color: var(--line); }
.heroact { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.sechead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.sechead h2 { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.secact { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.pic .hot { cursor: pointer; }
.pic .hot:hover rect:not(.hit), .pic .hot:focus rect:not(.hit) { stroke-width: 2.6; }
.pic .hot:hover circle { stroke-width: 4; }
.pic .hit { fill: transparent; stroke: none; }
.demorow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.dmini { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: 13px; display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); }
.dmini b { color: var(--ink); font-size: 13px; } .dmini.risk { border-color: var(--risk); } .dmini:hover { border-color: var(--accent); }
.auditstrip { display: grid; grid-template-columns: 170px 170px 1fr; gap: 12px; align-items: stretch; }
.astat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }
.astat b { font-size: 22px; color: var(--ink); }
.aflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fixcard { text-align: left; border: 1px solid var(--accent); background: #EEF5F4; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.fixcard b { color: var(--ink); font-size: 14px; } .fixcard.big { font-size: 14px; }
.gpstrip { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.gp { flex: 1; min-width: 180px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.gp:hover, .fixcard:hover, .keepcard:hover, .barrow:hover { border-color: var(--accent); }
.gpn { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.gparrow { align-self: center; color: var(--muted); font-size: 18px; }
.nextgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nextcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.nextcard.first { border-color: var(--accent); background: #F4F9F8; }
.nextact { display: flex; gap: 8px; align-items: center; margin-top: auto; }
/* walk-through */
body.walking .bp-sec:not(.spot) { opacity: .28; }
.bp-sec.spot { box-shadow: 0 0 0 3px var(--accent); border-radius: 14px; }
.walk { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 35; width: min(560px, calc(100vw - 32px)); background: var(--ink); color: #F2F0EA; border-radius: 14px; padding: 14px 18px; box-shadow: 0 16px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 8px; }
.walk p { margin: 0; font-size: 14px; line-height: 1.5; color: #E2DFD8; } .walk strong { font-size: 16px; }
.walk .kick { color: #B9B6AE; } .walk .iconbtn { background: transparent; color: #E2DFD8; border-color: #4A4D52; }
.wkhead, .wknav { display: flex; justify-content: space-between; align-items: center; }
.wkdots { display: flex; gap: 6px; } .wkdots span { width: 7px; height: 7px; border-radius: 50%; background: #5A5F66; } .wkdots span.on { background: #fff; }
/* inline validation */
.vmini { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.vb { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; padding: 0; }
.vb[data-vsave] { width: auto; padding: 0 8px; }
.vmini .vcomm { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 12px; width: 220px; }
.vstate { font-weight: 600; } .vstate.ok { color: var(--ok); } .vstate.change { color: var(--risk); }
/* board */
.switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.switch .sw { text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-2); }
.switch .sw.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.bhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.bhead .lead { margin: 2px 0 0; }
.bact { display: flex; gap: 8px; align-items: center; }
.pins { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pin { border: 1px dashed var(--accent); background: #F4F9F8; color: var(--accent); border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.pin.ok { border-style: solid; color: var(--ok); border-color: var(--ok); background: var(--ok-bg); } .pin.change { border-style: solid; color: var(--risk); border-color: var(--risk); background: var(--risk-bg); }
.pinlink { font-size: 13px; }
.lanes { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 12px; align-items: start; }
.lane { background: #EDEAE2; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; transition: background .15s; }
.lane.over { background: #DCEBE8; outline: 2px dashed var(--accent); }
.lane.l-confirmed { background: #E8F1EB; } .lane.l-changed { background: #F6EEDF; } .lane.l-deferred { background: #F3E6E3; }
.lanehead { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.lanehint { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 6px; border: 1px dashed #C9C4B8; border-radius: 8px; }
.bcard { background: #FFFDF6; border: 1px solid #E5DFC9; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bcard:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.bcard.drag { opacity: .4; }
.bcard.k-set-up { background: #F7FAFF; border-color: #D5E0F2; } .bcard.k-decision { background: #FBF7FF; border-color: #E3D8F0; } .bcard.k-to { }
.bctop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bk { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bq { font-weight: 600; font-size: 14px; line-height: 1.35; }
.bp { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bp .pl { font-weight: 700; color: var(--accent); }
.bm { font-size: 12px; color: var(--muted); } .bn { font-size: 12px; font-style: italic; color: var(--ink-2); }
.bcard .spark { width: 22px; height: 22px; font-size: 11px; }
.ovl { position: fixed; inset: 58px 0 0 0; z-index: 22; background: rgba(26,28,32,.35); display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: min(980px, 100%); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(1240px, 100%); }
.mhead { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.cgf.one { grid-template-columns: 1fr; }
.btn.suggest { outline: 2px solid var(--accent); outline-offset: 2px; }
/* audit */
.asec { gap: 12px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.barrow { display: grid; grid-template-columns: 190px 1fr 44px 230px; gap: 12px; align-items: center; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 5px 8px; cursor: pointer; font: inherit; font-size: 14px; text-align: left; }
.barrow .bt2 { background: var(--line-2); border-radius: 4px; height: 12px; overflow: hidden; } .barrow .bt2 span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.barrow .bn2 { font-weight: 700; text-align: right; } .barrow .bf { color: var(--muted); font-size: 13px; }
.fixgrid, .keepgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.keepgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.keepcard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); align-items: flex-start; }
.keepcard b { color: var(--ink); font-size: 14px; }
.retired { max-width: 760px; }
@media (max-width: 1100px) { .lanes { grid-template-columns: 1fr 1fr; } .aflow, .fixgrid { grid-template-columns: 1fr 1fr; } .auditstrip { grid-template-columns: 1fr 1fr; } .auditstrip .aflow { grid-column: 1 / -1; } .demorow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nextgrid, .chips3 { grid-template-columns: 1fr; } .barrow { grid-template-columns: 150px 1fr 40px; } .barrow .bf { display: none; } .topnav { gap: 12px; padding: 10px 16px; } body.v3 main { padding: 16px; } }
@media (max-width: 700px) { .lanes, .keepgrid { grid-template-columns: 1fr; } .tright .tb { padding: 6px 8px; } }

[hidden].drawer, [hidden].compop, [hidden].pop, [hidden].walk { display: none !important; }
.hero { padding: 16px 20px; border-radius: 14px; }
.drawer .linkbtn[data-dback] { align-self: flex-start; padding-left: 0; }
.dwbody .btn { align-self: flex-start; }
.lanes { grid-template-columns: 2fr 1fr 1fr 1fr; }
.lane.l-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.lane.l-open .lanehead, .lane.l-open .lanehint { grid-column: 1 / -1; }
@media (max-width: 1100px) { .lanes { grid-template-columns: 1fr 1fr; } .lane.l-open { grid-column: 1 / -1; } }
@media (max-width: 700px) { .lane.l-open { grid-template-columns: 1fr; } }
.pop .linkbtn { text-align: left; padding-left: 0; }

/* Review sheet and quick asks (4 Oct): the record first on a To settle card */
.rsheet{display:flex;flex-direction:column;gap:10px;margin:4px 0 8px}
.rs-sec ul,.rs-sec ol{margin:4px 0 0;padding-left:18px}
.rs-q{margin:4px 0;padding:6px 10px;border-left:3px solid var(--accent,#185fa5);background:var(--accent-soft,#e6f1fb);border-radius:0}
.rs-w,.rs-c{display:block;font-size:12px;color:var(--ink-2,#5f5e5a);margin-top:2px}
.rs-tl li{margin:2px 0}
abbr.term{text-decoration:underline dotted;cursor:help}
.asks{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:6px 0}

/* Planning destination (5 Oct): full-width frame under the top bar */
body.v3.planfull main { max-width: none; padding: 0; }
.planframe { display: block; width: 100%; border: 0; background: #F3F6F4; }
/* Top bar on tablet and phone (5 Oct): the destination links take their own row and scroll sideways, so the page keeps the screen's width */
@media (max-width: 1100px) { .topnav { flex-wrap: wrap; gap: 6px 12px; } #nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; } #nav::-webkit-scrollbar { display: none; } #nav a { white-space: nowrap; flex: none; padding: 6px 12px; } .tright { margin-left: auto; min-width: 0; } }
@media (max-width: 700px) { .topnav { padding: 8px 12px; } .brand3 span { display: none; } .tright { gap: 4px; } .tright .tb { font-size: 12px; white-space: nowrap; } }

/* One conversation beside every tab (5 Oct): the Planning page in compact mode on the right */
#dockframe { display: none; }
body.v3.docked #dockframe { display: block; position: fixed; right: 0; top: var(--navh, 58px); height: calc(100vh - var(--navh, 58px)); width: 400px; border: 0; border-left: 1px solid var(--line); background: #F3F6F4; z-index: 18; }
body.v3.docked main { margin-right: 400px; max-width: none; }
body.v3.docked .drawer { right: 400px; top: var(--navh, 58px); }
body.v3.docked .compop { right: 424px; }
#dockbtn { display: none; }
.planstrip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.planstrip b { font-weight: 600; } .planstrip .btn { margin-left: auto; }
.fromplan { color: var(--accent); font-weight: 600; }
.bcard .handover { font-size: 13px; padding: 4px 0 0; color: var(--accent); font-weight: 600; }
.fromplanrow { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 6px 10px; }
@media (max-width: 1100px) {
  body.v3.docked main { margin-right: 0; }
  body.v3.docked .drawer { right: 0; }
  body.v3.docked .compop { right: 12px; }
  body.v3.docked #dockframe { display: none; }
  body.v3.docked.dockopen #dockframe { display: block; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 72vh; border-left: 0; border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(0,0,0,.18); z-index: 45; }
  body.v3.docked #dockbtn { display: inline-flex; position: fixed; right: 14px; bottom: 14px; z-index: 46; height: 40px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
  body.v3.docked.dockopen #dockbtn { bottom: calc(72vh + 10px); }
}
@media (max-width: 1100px) { .chip { white-space: normal; max-width: 100%; } }

.planstrip.meet { background: #EAF3EE; color: #1E5B42; } .planstrip.meet input { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid #C9C4B8; border-radius: 6px; }

/* ---------- Big picture · full scope of the 28 (5 Oct) ---------- */
.scstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sch { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 14px; }
.scmx { display: grid; gap: 4px; overflow-x: auto; }
.scmh, .scmr { display: grid; grid-template-columns: 170px repeat(5, minmax(96px, 1fr)); gap: 4px; align-items: stretch; }
.scmh span { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; padding: 0 6px; }
.scmh b, .scmp b { color: var(--ink); }
.scmp { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.scmc { background: var(--line-2); border-radius: 8px; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; min-height: 36px; align-content: flex-start; }
.scn { border: 0; border-radius: 6px; min-width: 28px; height: 24px; padding: 0 6px; font: 600 12px/24px 'IBM Plex Mono', monospace; cursor: pointer; }
.scn:hover, .sclc:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.scfilt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scfilt select, .scfilt input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }
.scfilt input { flex: 1 1 180px; min-width: 0; }
.scrows { display: flex; flex-direction: column; gap: 6px; }
.scrow { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.scrow[open] { border-color: var(--accent); }
.scrow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 30px minmax(0, 2.4fr) minmax(0, 1.3fr) 90px minmax(0, 1.4fr) 92px 30px; gap: 10px; align-items: center; padding: 8px 10px; }
.scrow > summary::-webkit-details-marker { display: none; }
.scrk { font: 600 13px 'IBM Plex Mono', monospace; color: var(--muted); text-align: right; }
.sct { display: flex; flex-direction: column; min-width: 0; }
.sct b { font-size: 14px; }
.scc, .scj { display: flex; flex-wrap: wrap; gap: 4px; }
.scpp { display: flex; flex-direction: column; gap: 2px; }
.scdet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 12px 12px; }
.scblk { border-top: 1px solid var(--line-2); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scblk.wide { grid-column: 1 / -1; }
.scblk p { margin: 0; }
.sclist { margin: 0; padding-left: 18px; font-size: 13px; }
.sclist.have li::marker { content: '✓  '; color: var(--qw); }
.sclist.gap li::marker { content: '○  '; color: var(--major); }
.sclist.ep { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.sclist.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; word-break: break-all; }
.screl { display: flex; flex-wrap: wrap; gap: 4px; }
.sccmd { background: var(--line-2); border-radius: 8px; padding: 8px 10px; font: 12px/1.5 'IBM Plex Mono', monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }
.scblk .btn { align-self: flex-start; }
.scsub { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.scsub > summary { cursor: pointer; }
.sclayers { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.sclayer { display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: center; background: var(--line-2); border-radius: 8px; padding: 6px 8px; }
.scln { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sclr { display: flex; flex-wrap: wrap; gap: 4px; }
.sclc { border: 0; border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.scipg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.scip { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.scip > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.scfds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.scfd { display: flex; flex-direction: column; gap: 6px; }
.scent { display: grid; grid-template-columns: 34px 1fr; gap: 6px; font-size: 13px; align-items: start; }
@media (max-width: 1100px) {
  .scstrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scrow > summary { display: flex; flex-wrap: wrap; gap: 6px 10px; }
  .scrow > summary .sct { flex: 1 1 calc(100% - 90px); }
  .scrow > summary .scpp { flex: 0 0 90px; }
  .scipg { grid-template-columns: 1fr 1fr; } .scfds { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .scstrip { grid-template-columns: 1fr 1fr; }
  .scdet { grid-template-columns: 1fr; }
  .sclayer { grid-template-columns: 1fr; }
  .scipg, .scfds { grid-template-columns: 1fr; }
  .scmh, .scmr { grid-template-columns: 120px repeat(5, minmax(84px, 1fr)); }
}

/* One refresh for every tab (5 Oct): icon only on phones so the top bar keeps the screen's width */
@media (max-width: 700px) { .tright .tbl { display: none; } }

/* Big picture holds the plan with its dates and the audit and repair (5 Oct, sixth pass) */
.bpnav { position: sticky; top: calc(var(--navh, 58px) + 6px); z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.bpnav::-webkit-scrollbar { display: none; }
.bpnav button { flex: none; border: 1px solid var(--line); background: var(--ground); color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.bpnav button:hover { border-color: var(--accent); color: var(--accent); }
.segsw { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 100%; }
.segsw button { border: 0; background: var(--surface); color: var(--ink-2); padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.segsw button + button { border-left: 1px solid var(--line); }
.segsw button.on { background: var(--accent); color: #fff; font-weight: 600; }
.tlmount .pl { max-width: 100%; }
.tlmount input[type=date] { max-width: 100%; }
.auditfull { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.auditfull .asec { box-shadow: none; }
.tb.static { cursor: default; opacity: .85; }
.srcgrp { margin-top: 4px; } .srcgrp summary { cursor: pointer; }
.srclinks { list-style: none; padding: 0; margin: 4px 0 6px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.srclinks li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; border-top: 1px solid var(--line-2); padding-top: 5px; }
.srclinks .sl { min-width: 0; } .srclinks .sd { white-space: nowrap; font-size: 12px; } .srclinks .sk { grid-column: 1 / -1; word-break: break-word; }
@media (max-width: 700px) { .segsw button { padding: 6px 10px; } }
.pop[data-which=know] { width: 600px; max-width: calc(100vw - 24px); right: 12px; max-height: calc(100vh - 76px); }
/* Refresh panel (6 Oct): integrity line, then the phases as a timeline; links and why each matters inside each phase */
.kint { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); }
.kint summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kchk { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.kchk li { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line-2); }
.kchk .kca { font-weight: 600; } .kchk li.no .kca { color: var(--risk); } .kchk li.ok .kca { color: var(--ok); }
.kchk .kcd { display: block; font-size: 12px; overflow-wrap: anywhere; }
.tl { list-style: none; margin: 6px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.tlp { position: relative; margin: 0 0 6px; }
.tlp::before { content: ""; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tlp summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; padding: 4px 6px; border-radius: 8px; }
.tlp summary:hover { background: var(--ground); }
.tlp summary::-webkit-details-marker { display: none; }
.tld { font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 1px; }
.tlt { font-weight: 600; font-size: 14px; }
.tlc { font-size: 12px; white-space: nowrap; }
.tll { grid-column: 2 / -1; font-size: 13px; color: var(--ink-2); }
.tlg { margin: 6px 0 4px 6px; }
.tlh { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.tli { font-size: 13px; padding: 5px 0; border-top: 1px solid var(--line-2); }
.tlw { color: var(--ink-2); margin: 1px 0; }
.tlk { font-size: 12.5px; }
.tlbad { color: var(--risk); text-decoration: line-through; }
.kmore { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.kmore summary { cursor: pointer; }
.bp-sec { scroll-margin-top: calc(var(--navh, 58px) + 64px); }
/* Milestones and dates inside the Big picture: rows read as a list, not as buttons */
.tlmount .pl-row > button[data-a=toggle] { text-align: left; background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; min-width: 0; }
.tlmount .pl-row > button[data-a=toggle]:hover { color: var(--accent); }
.tlmount .pl-card { padding: 8px 12px; margin-bottom: 6px; }
.tlmount .pl-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
@media (max-width: 700px) { .tlmount .pl-row { grid-template-columns: 1fr auto; } .tlmount .pl-row > .pl-muted { grid-column: 1 / -1; } .sechead { flex-wrap: wrap; } .sechead > div:first-child { flex: 1 1 100%; } }
.kinfo { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; } .kinfo ul { padding-left: 16px; margin: 2px 0 0; }

/* GP-D2 to GP-D5 (5 Oct 2026): flow in the top bar, cards, hero, Present view, focus and targets */
#nav { align-items: center; }
#nav .navsep { color: #7E7B74; font-size: 13px; padding: 0 1px; user-select: none; }
.bq { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bcard:focus-within .bq, .bcard:hover .bq { -webkit-line-clamp: unset; }
.hero .herosub { margin: 2px 0 0; font-size: var(--fs-lg); color: var(--ink-2); max-width: 920px; }
body.present .tright, body.present .spark, body.present .vmini, body.present .scfilt, body.present [data-sccopy], body.present [data-scexp], body.present .heroact .muted { display: none !important; }
body.present #view { zoom: 1.15; }
body.present .hero h1 { font-size: 40px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.sm, .pill, .linkbtn { min-height: 36px; }
.muted, .src, .small.muted { color: var(--muted); }

/* AI Engineering track beside the 28 (5 Oct): dashed chip = AI Engineering requirement; ↑ = moved to the critical path by dependencies of both tracks */
.scn.ae { outline: 2px dashed var(--accent); outline-offset: -2px; min-width: 40px; }
.scn.lift { box-shadow: inset 0 0 0 2px var(--ink); }
.scn.lift span { margin-left: 2px; font-size: 11px; }
.sclegend .scn { cursor: default; pointer-events: none; height: 20px; line-height: 20px; min-width: 0; }
.scvrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 6px; }
.sclegend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tblw { overflow-x: auto; }
table.aet td, table.aet th { padding: 8px 6px; }
table.aet .relchip { padding: 4px 8px; }
.nowrap { white-space: nowrap; }
.scwave { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; background: var(--line-2); border-radius: 8px; padding: 6px 8px; }
.scwn { font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 700px) { .scvrow .segsw button { padding: 6px 8px; font-size: 12px; } }
.scdet.aedet { grid-template-columns: minmax(0, 1fr); }

/* AI Engineering tab (5 Oct): header strip with the contract to the foundation track, segments, sandbox */
.aehead { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.aehead h1.sm { margin: 0; }
.aelate { color: var(--bad, #b3261e); }
.aeseg a { border: 0; background: var(--surface); color: var(--ink-2); padding: 6px 14px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.aeseg a + a { border-left: 1px solid var(--line); }
.aeseg a.on { background: var(--ink); color: var(--surface); }
.aeseg a.on .muted { color: inherit; opacity: .75; }
.aewait > summary { cursor: pointer; font-size: 13px; }
.aenbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 8px; }
.aenb { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; font-size: 13px; }
.aenb:hover { border-color: var(--accent); }
.aenb .chip { align-self: flex-start; }
.aecon { background: var(--line-2); border-radius: 8px; padding: 8px 10px; }
/* Sandbox chat (8 Oct): a rail of the twelve requirements, one conversation at a time, like a Claude session */
.sbchat { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; padding: 16px 20px; align-items: start; }
.sbrail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow: auto; }
.sbitem { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); border: 1px solid transparent; }
.sbitem b { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.sbitem:hover { background: var(--line-2); }
.sbitem.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.sbitem.on b { color: var(--accent-ink); }
.sbn { font-style: normal; font-size: 11px; background: var(--line); color: var(--ink-2); border-radius: 999px; padding: 0 6px; }
.sbmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.sbhead { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: flex-start; }
.sbhead h2 { margin: 0; font-size: var(--fs-xl); }
.sbtools { display: flex; gap: 8px; }
.sbmsgs { display: flex; flex-direction: column; gap: 14px; min-height: 260px; max-height: calc(100vh - 330px); overflow-y: auto; padding: 4px 2px; }
.sbmsg { display: flex; flex-direction: column; gap: 4px; max-width: 78ch; }
.sbmsg.me { align-self: flex-end; align-items: flex-end; }
.sbbub { font-size: var(--fs-md); line-height: 1.6; overflow-wrap: anywhere; }
.sbmsg.me .sbbub { background: var(--accent-soft); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-lg) var(--r-lg) 4px var(--r-lg); }
.sbmsg.ai .sbbub p:first-child { margin-top: 0; }
.sbthink { color: var(--muted); font-style: italic; }
.sbmeta { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.sbkeep { display: inline; }
.sbkeep > summary { display: inline; cursor: pointer; color: var(--accent); }
.sbkeep[open] > span { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 8px; }
.sbempty { margin: auto; text-align: center; max-width: 60ch; }
.sbempty h3 { margin: 0 0 4px; }
.sbstart { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.sbcomp { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line-2); padding-top: 12px; }
.sbcomp textarea { flex: 1; font: inherit; font-size: var(--fs-md); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); resize: vertical; min-height: 44px; }
@media (max-width: 760px) {
  .sbchat { grid-template-columns: 1fr; padding: 12px 16px; }
  .sbrail { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .sbitem { white-space: nowrap; }
  .sbitem span { display: none; }
  .sbmsgs { max-height: none; }
}
.aewait > summary { list-style-position: inside; }
@media (max-width: 700px) {
  .aehead { gap: 6px; padding: 12px 14px; }
  .aehead h1.sm { font-size: 21px; line-height: 1.25; }
  .aehead .kick { font-size: 10px; }
  .aewait > summary .muted { display: none; }
  .aehead .src { font-size: 11px; }
}
.fromplan.fromae { outline: 1px dashed var(--accent); outline-offset: 1px; border-radius: 4px; padding: 0 3px; }

/* AI Engineering tab, slim bar (6 Oct): one row above the content; the waiting list opens as an overlay */
.aebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 12px; margin: 0 0 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; position: relative; z-index: 5; }
.aettl { font-weight: 700; font-size: 14px; }
.aebar .aeseg a { padding: 5px 12px; }
.aebadge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px; border-radius: 8px; background: var(--line-2); font-size: 11px; line-height: 16px; text-align: center; }
.aeseg a.on .aebadge { background: rgba(255,255,255,.25); }
.aebar .aewait { position: static; }
.aebar .aewait > summary { cursor: pointer; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; list-style: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.aebar .aewait > summary::-webkit-details-marker { display: none; }
.aebar .aewait[open] > .aenbs { position: absolute; left: 8px; right: 8px; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 10px; max-height: 60vh; overflow: auto; margin: 0; }
.aebar .aenbs .src { grid-column: 1 / -1; margin: 4px 0 0; }
.aesp { flex: 1; }
.aesync { cursor: help; white-space: nowrap; }
@media (max-width: 700px) { .aebar { padding: 6px 8px; } .aettl { display: none; } .aebar .aewait > summary .muted { display: none; } .aesync { display: none; } }
#aehead .aebar { margin-bottom: 0; }
.aebar .btn.sm { padding: 4px 10px; }
body.planfull #view { gap: 0; }

/* Agent hand-off (6 Oct, L-193): halted agent tasks on the AI Engineering bar and on board cards */
.aehalt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--warn); background: var(--warn-bg); border-radius: var(--r-sm); padding: 3px 9px; text-decoration: none; white-space: nowrap; }
.aehalt b { color: inherit; }
.bhalt { display: block; margin-top: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: var(--r-sm); padding: 3px 8px; text-decoration: none; }
.bhalt.rel { color: var(--accent); background: var(--accent-soft); }

/* the requirement-set row under the top bar (7 Oct, Wave 1): one set, read by every surface */
.setrow{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:4px 16px;font-size:12px;color:var(--muted);position:relative;background:var(--surface);border-bottom:1px solid var(--line)}
.setrow .setk{font-weight:600;letter-spacing:.04em;text-transform:uppercase;font-size:11px}
.setrow .setpill{display:inline-flex;align-items:center;gap:4px;background:var(--accent-soft);color:var(--accent-ink);border:1px solid var(--accent);border-radius:12px;padding:1px 4px 1px 9px}
.setrow .setpill button{border:0;background:none;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:0 3px}
.setrow .tb{padding:2px 8px;font-size:12px}
.setpick{position:absolute;left:16px;right:auto;top:calc(100% + 6px);z-index:30;text-align:left;width:min(720px,calc(100vw - 32px));background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px -12px rgba(0,0,0,.4);padding:10px 12px;max-width:min(720px,calc(100vw - 32px));display:flex;flex-direction:column;gap:8px}
.setpick .setg{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.setpick .setg b{flex:0 0 100%;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.setopt{border:1px solid var(--line);background:var(--ground);border-radius:6px;padding:3px 9px;font:inherit;font-size:12px;cursor:pointer}.setopt.sm{min-width:30px;text-align:center}.setopt:hover{background:var(--accent-soft)}

/* Refresh panel: toolkit states (Wave 3) */
.tkpanel{margin:0 0 10px;padding:8px 10px;background:var(--ground);border-radius:8px}
.tkrow{display:grid;grid-template-columns:120px 86px 1fr;gap:6px;font-size:12px;padding:2px 0;align-items:baseline}
.tkst{font-size:11px;border-radius:10px;padding:0 7px;background:var(--line-2);color:var(--muted);white-space:nowrap}.tkst.live{background:var(--ok-bg);color:var(--ok)}.tkst.snapshot{background:var(--warn-bg);color:var(--warn)}.tkst.not-signed-in,.tkst.no-snapshot,.tkst.not-on-this-machine{background:var(--risk-bg);color:var(--risk)}

/* repair pass (7 Oct evening): the set named in the AI Engineering bar */
.aeset{font-size:12px;color:var(--accent-ink);background:var(--accent-soft);border:1px solid var(--accent);border-radius:12px;padding:1px 9px;margin-left:8px;white-space:nowrap;max-width:420px;overflow:hidden;text-overflow:ellipsis}

/* 8 Oct: one icon row, one hero, tabs that say a count once */
.ibtn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; }
.heroact .ibtn svg { display: block; }
.switch .sw .swn { margin-left: 6px; font-size: 11px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 9px; padding: 0 6px; }
.switch .sw.on .swn { background: var(--accent); color: #fff; }

/* Everything in the plan: the four tracks Portal 1.0 takes in (§13.6, 23 Oct). Calm by default —
   a count and a status spread per track — and the items only when a track is opened. */
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
.tcard { background: var(--surface, #fff); border: 1px solid var(--line, #e2ded5); border-radius: 12px; padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tcard.open { grid-column: 1 / -1; }
.thead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tact { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tchips { display: flex; flex-wrap: wrap; gap: 5px; }
.tchip { font-size: 11.5px; border-radius: 999px; padding: 2px 8px; background: var(--surface-2, #f6f5f1); color: var(--muted, #5a5f66); white-space: nowrap; }
.tchip.ok { background: #e3f0e6; color: #2f7d5b; }
.tchip.warn { background: #f6ebd3; color: #a97a1e; }
.tlist { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.trow { display: grid; grid-template-columns: 54px 1fr auto auto auto; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line-2, #efece5); min-width: 0; }
.trow:last-child { border-bottom: 0; }
.tn { font: 500 12px var(--mono, ui-monospace, monospace); border-radius: 6px; padding: 1px 6px; text-align: center; background: var(--surface-2, #f6f5f1); color: var(--muted, #5a5f66); }
.tn.ok { background: #e3f0e6; color: #2f7d5b; }
.tn.warn { background: #f6ebd3; color: #a97a1e; }
.tt { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .trow { grid-template-columns: 48px 1fr; } .trow > :nth-child(3), .trow > :nth-child(4), .trow > :nth-child(5) { grid-column: 2; } }

/* View as (23 Oct): the admin's own test seam. The band sits above the top bar and is not dismissible --
   the point of the seam is that a tested view can never be mistaken for your own. Tokens only. */
.viewas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 7px 32px;
  background: var(--surface-2, #F6F5F1); border-bottom: 1px solid var(--line); color: var(--ink-2);
  font-size: var(--fs-sm); }
.viewas.on { background: var(--warn-bg); color: var(--st-part-ink, #6E4E00); border-bottom-color: var(--warn); }
.viewas b { font-weight: 600; }
.viewas select { font: inherit; font-size: var(--fs-sm); padding: 4px 8px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.viewas .btn { margin-left: auto; }
.viewas label { color: var(--muted); }
@media (max-width: 1100px) { .viewas { padding: 7px 16px; } }

/* ---------- Phone (26 Oct, §12 row 123): the layer below 480 px. Everything above composes a desktop and shrinks
   it; this block composes the phone: the top bar wraps so every destination is on screen, wide things scroll inside
   their own box with a visible edge and a pinned first column, floating panels take the screen's width, tap targets
   reach 36-40 px, and the gutter clears a phone's side bar and home indicator (index.html: viewport-fit=cover). ---------- */
@media (max-width: 480px) {
  main, body.v3 main { padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); gap: 14px; }
  /* the bar wraps to three rows here, so it scrolls away instead of sticking; the section chips stick at the top instead */
  .topnav { position: static; padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); gap: 6px 10px; }
  #nav { flex-wrap: wrap; overflow: visible; gap: 2px 4px; }
  .bp-sec { scroll-margin-top: 70px; }
  #nav a { padding: 8px 10px; min-height: 36px; display: inline-flex; align-items: center; }
  .tright .tb, .tright .ibtn { min-width: 40px; min-height: 40px; }
  .hero { padding: 12px; } .hero h1 { font-size: var(--fs-2xl); }
  .card { padding: 12px; }
  /* the fade is a mask, which reads only the colour's alpha: --ink is any opaque token, not a colour that shows */
  .bpnav { top: 6px; scrollbar-width: thin; padding: 6px 8px; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); }
  .bpnav button { min-height: 36px; }
  .segsw { display: flex; flex-wrap: wrap; overflow: visible; }
  .segsw button { flex: 1 1 auto; min-height: 36px; padding: 6px 10px; }
  .segsw button + button { border-left: 0; }
  .scmx { scrollbar-width: thin; padding-bottom: 6px; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); }
  .scmh, .scmr { grid-template-columns: 88px repeat(5, minmax(76px, 1fr)); }
  .scmh > :first-child, .scmr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .scn { min-width: 32px; height: 28px; line-height: 28px; }
  .scstrip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .scrow > summary { gap: 4px 8px; padding: 8px; }
  .scrow > summary .sct { flex: 1 1 100%; }
  .scrow > summary .scpp { flex: 0 0 auto; }
  .scrk { text-align: left; }
  .spark { width: 36px; height: 36px; font-size: var(--fs-lg); }
  .iconbtn { width: 40px; height: 40px; }
  .vb { width: 32px; height: 32px; }
  .demorow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auditstrip, .aflow, .fixgrid, .keepgrid, .nextgrid { grid-template-columns: 1fr; }
  .barrow { grid-template-columns: minmax(0, 1fr) 40px; } .barrow .bt2 { grid-column: 1 / -1; }
  .drawer { top: 0; width: 100vw; padding: calc(12px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(30px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .dwhead h2 { font-size: var(--fs-xl); }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; } dl.kv dd { margin-bottom: 6px; }
  .compop, body.v3.docked .compop { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px)); }
  .toast { left: 12px; right: 12px; max-width: none; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .walk { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.v3.docked #dockbtn { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .panel { left: 16px; right: 16px; width: auto; }
  .pop[data-which=know] { left: 8px; right: 8px; width: auto; }
  table.t { display: block; overflow-x: auto; }
  figure.pic { overflow-x: auto; scrollbar-width: thin; margin: 0; } figure.pic svg { min-width: 640px; }
  .trow { grid-template-columns: 1fr; gap: 4px; } .trow > :nth-child(n) { grid-column: 1; }
  .tn { justify-self: start; white-space: normal; }
  .tlist { max-height: 70vh; }
  .tcard { padding: 12px; }
  .sbrail { scrollbar-width: thin; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); }
}
