/* Jötunn Workspace — midnight / ice identity inherited from Jötunn PenTest+ Study. */
:root {
  color-scheme: dark;
  --bg: #030c14; --deep: #01070e; --panel: #071827; --panel2: #0c2435;
  --ink: #dff0ff; --muted: #a0bad0; --line: #244358; --line-soft: #1a3346; --control: #385c75;
  --accent: #7ecfff; --good: #5dffd8; --bad: #ff8fa0; --warn: #e6c98e; --violet: #b5a8ff;
  --radius: .9rem; --shadow: 0 12px 40px #00000025;
  --surface: linear-gradient(145deg, #091c2b, #061421);
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --gap: 20px; --pad: 24px; --pad-sm: 16px; --radius-sm: 10px;
}
body[data-accent=electric] { --accent: #72b9ff; }
body[data-accent=arctic] { --accent: #76e4ed; }
body[data-density=compact] { --gap: 14px; --pad: 18px; --pad-sm: 12px; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.55 "Segoe UI", Arial, sans-serif; overflow-wrap: anywhere; background: radial-gradient(ellipse at 75% 0%, #092036 0, transparent 46%), linear-gradient(150deg, #030c14, #020910); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary { touch-action: manipulation; outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
a { color: var(--accent); }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1 { font-size: 2.1rem; font-weight: 650; letter-spacing: -.04em; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.02em; }
h3 { font-size: 1rem; font-weight: 650; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, small { color: var(--muted); }
.hint { color: var(--muted); font-size: .8rem; }
.calm { color: var(--muted); font-size: .9rem; padding: 8px 0 14px; }
kbd { font: 10px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
code, .cmd { font-family: var(--mono); color: var(--accent); }
.skip { position: fixed; top: -100px; left: 12px; z-index: 50; background: var(--panel); padding: 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.ico { display: inline-block; width: 1.1em; text-align: center; }
.label { display: block; color: var(--accent); font: 10px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { font: 11px var(--mono); letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.clamp-1, .clamp-2, .clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; } .clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; } .clamp-4 { -webkit-line-clamp: 4; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spacer { flex: 1; }
/* One rhythm: blocks in a view are separated by the same gap, and side-by-side cards share their row height. */
#content, .section-body, #agenda-body, #library-body { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
#results { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.g2 > :last-child:nth-child(odd), .choice-cards.two > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 28px 16px 22px; background: linear-gradient(180deg, #04111ddd, #020910f0); border-right: 1px solid #1c3447; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 7px; color: var(--ink); text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 0 8px #7ecfff44); }
.brand strong { display: block; font: 400 1.12rem Georgia, serif; letter-spacing: .09em; }
.brand small { display: block; color: #9fdcff; font-size: .65rem; letter-spacing: .15em; }
.tagline { font: 11px/1.6 var(--mono); letter-spacing: .12em; color: #9fdcff; padding: 0 8px; }
.mainnav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.mainnav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: .9rem; transition: background .16s, border-color .16s; }
.mainnav a .ico { font-size: 20px; width: 25px; }
.mainnav a b { font-weight: 500; }
.mainnav a:hover { background: #10283c66; color: var(--ink); }
.mainnav a[aria-current=page] { color: var(--accent); border-color: #25506c; background: linear-gradient(100deg, #11314a, #091c2c); box-shadow: inset 3px 0 var(--accent); }
.mainnav .nav-settings { margin-top: auto; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 16px 8px 0; font-size: 12px; color: var(--muted); }
.sidebar-foot p { margin-top: 6px; font-size: 11px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 8px; box-shadow: 0 0 8px var(--good); }
.live-dot.paused { background: var(--warn); box-shadow: none; }
main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 40px 48px 90px; min-width: 0; }
main:focus { outline: none; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: calc(var(--gap) + 8px); }
.topbar-main { min-width: 0; flex: 1 1 380px; }
.topbar .eyebrow { margin-bottom: 12px; }
.topbar h1:focus { outline: none; }
.topbar-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.program-link { font-size: .85rem; text-decoration: none; margin-left: 4px; }
.program-link:hover { text-decoration: underline; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-trigger kbd { margin-left: 4px; }

/* ---------- Buttons and controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 16px; border: 1px solid #27475e; border-radius: .65rem; background: var(--panel2); color: var(--ink); font-size: .875rem; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s, box-shadow .15s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--deep); box-shadow: 0 4px 18px #7ecfff16; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 6px 22px #7ecfff30; transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: #18334c66; }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); color: var(--deep); border-color: transparent; }
.btn.sm { min-height: 34px; padding: 6px 11px; font-size: .8rem; border-radius: .55rem; }
.btn.icon { min-width: 42px; padding: 8px; }
.btn.icon.sm { min-width: 32px; min-height: 32px; padding: 4px; }
.link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; background: #040e19; border: 1px solid var(--control); border-radius: .6rem; font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #7ecfff14; outline: none; }
textarea { resize: vertical; line-height: 1.65; font-size: .9rem; }
textarea.code { font: 13px/1.6 var(--mono); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; margin: 0; }
::placeholder { color: #6f8ca3; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 99px; background: #0f2a3d; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #0f2a3d; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* ---------- Surfaces ---------- */
.surface { background: var(--surface); border: 1px solid #203c51; border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.panel-head h2, .panel-head h3 { margin-right: auto; }
.panel-body { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.panel-body > .calm { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; }
.panel-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.panel-foot > .hint { margin-right: auto; }
.panel-foot > .check-add { flex: 1; margin: 0; }
.list-more { padding: 0 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: #091a2a; color: var(--accent); font: 11px/1.5 var(--mono); white-space: nowrap; text-decoration: none; }
a.badge:hover { border-color: var(--accent); }
.sev-critical, .sev-high, .v-high, .v-out-of-scope, .v-finding { color: var(--bad); border-color: #774153; }
.sev-medium, .v-medium, .v-review, .v-testing, .v-submitted, .v-triaged, .v-working { color: var(--warn); border-color: #6b5a39; }
.sev-low, .v-low, .v-in-progress, .v-verified, .v-reported, .v-open { color: var(--accent); }
.sev-informational, .v-draft, .v-duplicate, .v-rejected, .v-closed, .v-archived, .v-paused, .v-not-started, .v-not-applicable, .v-planned, .v-backlog, .v-inconclusive, .v-skipped { color: var(--muted); }
.v-done, .v-resolved, .v-accepted, .v-paid, .v-passed, .v-supported, .v-in-scope, .v-completed, .v-reproduced, .v-peer-reviewed, .v-active { color: var(--good); border-color: #2b6b5d; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border: 1px solid #27475e; border-radius: 99px; background: #071827; color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed=true], .chip:has(input:checked) { background: #12324a; border-color: var(--accent); color: var(--accent); }
.chip.v-finding[aria-pressed=true], .chip.sev-critical:has(input:checked), .chip.sev-high:has(input:checked) { background: #3a1822; border-color: var(--bad); color: var(--bad); }
.chip.v-passed[aria-pressed=true], .chip.v-done[aria-pressed=true] { background: #0f3a33; border-color: var(--good); color: var(--good); }
.chip.v-in-progress[aria-pressed=true], .chip.v-working[aria-pressed=true], .chip.sev-medium:has(input:checked) { background: #3a3220; border-color: var(--warn); color: var(--warn); }
.chip .count { color: inherit; opacity: .75; font: 11px var(--mono); }
.radio-chips .chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chips .chip { position: relative; }
.radio-chips .chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid #27475e; border-radius: .7rem; background: #040e19; gap: 3px; flex-wrap: wrap; }
.seg button { min-height: 36px; padding: 6px 14px; border: 0; border-radius: .5rem; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600; }
.seg button[aria-pressed=true] { background: #12324a; color: var(--accent); box-shadow: inset 0 0 0 1px #365e7a; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .85rem; color: var(--muted); cursor: pointer; }

/* Sub navigation inside a section */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.section-head-main { min-width: 0; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.subnav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: #040f1ab0; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: var(--ink); background: #10283c66; }
.subnav a[aria-current=page] { background: #12324a; color: var(--accent); box-shadow: inset 0 0 0 1px #365e7a; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: #0c2435; color: var(--muted); font: 11px/18px var(--mono); text-align: center; }
[aria-current=page] .count { background: #0b2235; color: var(--accent); }

/* Toolbars and search */
.toolbar { display: flex; flex-direction: column; gap: 12px; padding: var(--pad-sm); background: #071827; border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.toolbar-row > .hint { flex: 0 1 auto; max-width: 52%; margin-left: auto; text-align: right; }
.toolbar-end { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.toolbar select { width: auto; min-width: 150px; max-width: 220px; min-height: 38px; padding: 7px 10px; font-size: .85rem; }
.grow { flex: 1 1 260px; }
.search { position: relative; flex: 1 1 240px; min-width: 0; display: block; }
.search > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type=search] { padding-left: 34px; min-height: 38px; }
.results-caption { color: var(--muted); font-size: .8rem; margin: 0 2px; }
.progress-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.progress-row progress { flex: 1; min-width: 120px; }
.progress-row span { white-space: nowrap; }

/* Lists and rows */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, .list-row:hover .as-link b { color: var(--accent); }
.list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; text-align: left; }
.list-main b { font-weight: 600; font-size: .92rem; line-height: 1.4; }
.list-main small { font-size: .78rem; }
.as-link { padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.mini-progress { width: 90px; flex: none; }
.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #061421; }
.rows-head, .row-link, .row-item { display: grid; align-items: center; gap: 16px; padding: 12px 18px; }
.rows-head { background: #0a1f30; color: var(--muted); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.row-link, .row-item { border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--ink); text-align: left; text-decoration: none; width: 100%; font: inherit; cursor: pointer; }
.row-item { cursor: default; grid-template-columns: minmax(0, 1fr) auto; }
.row-link:hover { background: #0e263a; }
.row-link:hover .cell-main b { color: var(--accent); }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main b { font-weight: 600; font-size: .92rem; }
.cell-main small { font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cell { min-width: 0; font-size: .85rem; }
.findings-rows .rows-head, .findings-rows .row-link { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) 110px 120px 110px; }
.asset-rows .rows-head, .asset-rows .row-link { grid-template-columns: minmax(0, 3fr) 100px 140px minmax(0, 1.2fr); }
.sub-rows .rows-head, .sub-rows .row-link { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 120px 120px 110px; }
.card-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid.wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Empty states */
.empty { text-align: center; padding: 44px 24px; border: 1px dashed #31516a; border-radius: var(--radius); background: linear-gradient(135deg, #07182755, #030c1433); color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 1.2rem; margin-bottom: 8px; }
.empty p { max-width: 520px; margin: 0 auto; font-size: .92rem; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: var(--pad-sm) 20px; border: 1px solid #213b4f; border-radius: var(--radius); background: linear-gradient(140deg, #0b2233, #06131f); color: var(--ink); text-decoration: none; }
.stat::before { content: ''; position: absolute; top: 0; left: 20px; width: 30px; height: 2px; background: var(--accent); }
.stat.tone-warn::before { background: var(--warn); } .stat.tone-good::before { background: var(--good); } .stat.tone-bad::before { background: var(--bad); } .stat.tone-violet::before { background: var(--violet); }
.stat strong { font-size: 1.9rem; font-weight: 600; letter-spacing: -.04em; line-height: 1.25; }
.stat span { color: var(--muted); font-size: .78rem; }
a.stat:hover { border-color: #35617e; }

/* Structured text: blocks flow into columns instead of one long column */
.rt { columns: 19rem; column-gap: 32px; color: #c6dcee; font-size: .9rem; line-height: 1.65; }
.rt.single { columns: auto; }
.rt-block { break-inside: avoid; padding-bottom: 16px; }
.rt h4 { color: var(--ink); font-size: .88rem; font-weight: 650; margin-bottom: 6px; }
.rt p + p { margin-top: 6px; }
.rt-list { padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.rt-list + p, p + .rt-list { margin-top: 6px; }
.rt-list li::marker { color: var(--accent); }
.rt-list:not(.open) li.extra { display: none; }
.rt-toggle, .clamp-toggle { margin-top: 6px; padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rt strong { color: var(--ink); font-weight: 600; }
.clampable { max-height: 15rem; overflow: hidden; position: relative; }
.clampable.open { max-height: none; }
.clampable.is-clamped:not(.open)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3.5rem; background: linear-gradient(transparent, #071725); pointer-events: none; }

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 32px 34px; border: 1px solid #355972; border-radius: var(--radius); background: linear-gradient(90deg, #030c14f5 30%, #030c1470), url('mountains.jpg') center 52% / cover; box-shadow: 0 15px 45px #00000025; }
.hero h2 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.035em; max-width: 640px; }
.hero > p:not(.eyebrow) { color: var(--muted); max-width: 640px; }
.hero .row { margin-top: 8px; }
.hero-progress { display: flex; align-items: center; gap: 12px; max-width: 460px; color: var(--muted); font-size: .8rem; }
.hero-progress progress { flex: 1; }
.hero-progress span { white-space: nowrap; }
/* Sits over the photograph, so these buttons carry their own backing. */
.hero-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hero-tools .btn { background: #030c14b3; border-color: #ffffff26; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.hero-tools .btn:hover:not(:disabled) { background: #0b2233e6; border-color: var(--accent); }
.welcome { min-height: 260px; justify-content: center; }
.intro-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.intro-steps article { border-top: 1px solid #254357; padding-top: 18px; }
.intro-steps span { color: var(--accent); font: 10px var(--mono); letter-spacing: .12em; }
.intro-steps h3 { margin: 10px 0 6px; }
.intro-steps p { color: var(--muted); font-size: .88rem; }
.seg.compact button { min-height: 34px; padding: 5px 12px; }

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.project-card:hover, .note-card:hover, .choice-card:not(.static):hover { border-color: var(--accent); box-shadow: 0 10px 30px #00000030, 0 0 0 1px #7ecfff22; }
.project-card h3 { font-size: 1.2rem; margin-top: 8px; }
.card-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 14px; border-top: 1px solid #203c51; font-size: .75rem; color: var(--muted); }

/* ---------- Findings strip ---------- */
.sev-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.sev-chip { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad-sm); border: 1px solid var(--line); border-radius: var(--radius); background: #071827; color: var(--muted); font-size: .8rem; text-align: left; }
.sev-chip strong { font-size: 1.5rem; color: var(--ink); font-weight: 600; }
.sev-chip.sev-critical strong, .sev-chip.sev-high strong { color: var(--bad); }
.sev-chip.sev-medium strong { color: var(--warn); }
.sev-chip.sev-low strong { color: var(--accent); }
.sev-chip[aria-pressed=true] { border-color: var(--accent); background: #12324a; }
.sev-chip:hover { border-color: var(--accent); }
.sev-mini { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); }
.sev-mini b { margin-right: 5px; font-size: 1.1rem; color: var(--ink); }
.sev-mini .sev-critical b, .sev-mini .sev-high b { color: var(--bad); }
.sev-mini .sev-medium b { color: var(--warn); }

/* ---------- Project page ---------- */
.ptabs { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #040f1ac0; overflow-x: auto; scrollbar-width: thin; }
.ptabs a { position: relative; flex: 1 1 0; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ptabs a:hover { background: #10283c66; color: var(--ink); }
.ptabs a[aria-current=page] { background: linear-gradient(100deg, #11314a, #0b2133); color: var(--accent); box-shadow: inset 0 0 0 1px #365e7a; }
.ptabs .n { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #365e7a; border-radius: 50%; font: 11px var(--mono); color: var(--muted); }
.ptabs .n.done { background: #0f3a33; border-color: var(--good); color: var(--good); }
.ptabs [aria-current=page] .n:not(.done) { border-color: var(--accent); color: var(--accent); }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: var(--pad-sm) var(--pad); border: 1px solid #2c5874; border-left: 3px solid var(--accent); border-radius: var(--radius); background: linear-gradient(100deg, #0d2b40, #071827); }
.next-step p { font-size: 1rem; font-weight: 600; margin-top: 2px; }
.next-step.done { border-left-color: var(--good); }
.stepper-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.step-card { display: flex; align-items: center; gap: 12px; height: 100%; padding: var(--pad-sm); border: 1px solid var(--line); border-radius: var(--radius); background: #071725; color: var(--ink); text-decoration: none; }
.step-card:hover { border-color: #3c6886; }
.step-card.current { border-color: var(--accent); background: #0f2c42; }
.step-card.done { border-color: #2b6b5d; }
.step-n { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid #365e7a; border-radius: 50%; font: 12px var(--mono); color: var(--accent); }
.step-card.done .step-n { background: #0f3a33; border-color: var(--good); color: var(--good); }
.step-card.current .step-n { background: var(--accent); border-color: var(--accent); color: var(--deep); }
.checklist { list-style: none; padding: 0; display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.check-row label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: .9rem; min-width: 0; }
.check-row input { margin-top: 3px; }
.check-row.is-done span { color: var(--muted); text-decoration: line-through; }
.check-row .btn { opacity: .55; }
.check-row:hover .btn, .check-row .btn:focus-visible { opacity: 1; }
.check-add { display: flex; gap: 8px; margin: 6px 0; }
.check-add input[name] { min-height: 38px; font-size: .88rem; }
.checklist-surface { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.checklist-surface .empty { border: 0; background: none; padding: 20px; }

/* Scope */
.scope-panels { display: flex; flex-direction: column; gap: var(--gap); }
.scope-panel { border-left: 3px solid var(--accent); }
.scope-panel.tone-good { border-left-color: var(--good); }
.scope-panel.tone-bad { border-left-color: var(--bad); }
.scope-panel .panel-head { margin-bottom: 14px; }
.scope-panel .clampable { max-height: 34rem; }
.scope-panel .clampable.is-clamped:not(.open)::after { background: linear-gradient(transparent, #071624); }
.ref-card, .note-card, .playbook-card, .tool-card, .cmd-card, .hyp-card { display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--ink); }
.ref-card h3, .note-card h3, .playbook-card h3, .cmd-card h3, .hyp-card h3 { font-size: 1.02rem; }
.note-card { cursor: pointer; font: inherit; }
.note-card p, .ref-card p { font-size: .85rem; }
.playbook-card ol { padding-left: 20px; color: var(--muted); font-size: .85rem; line-height: 1.7; }

/* Board */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); }
.kcol { display: flex; flex-direction: column; gap: 10px; padding: var(--pad-sm); border: 1px solid #243f54; border-radius: var(--radius); background: linear-gradient(#071624, #040f1a); min-width: 0; transition: border-color .15s, background .15s; }
.kcol.drop-target { border-color: var(--accent); background: #0c2638; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 2px solid #66849c; }
.kcol-in-progress .kcol-head { border-top-color: var(--accent); }
.kcol-review .kcol-head { border-top-color: var(--warn); }
.kcol-done .kcol-head { border-top-color: var(--good); }
.kcol-head h3 { font-size: .85rem; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; }
.kcol-empty { color: var(--muted); font-size: .8rem; padding: 12px 0; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.kcard { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid #23405a; border-radius: var(--radius-sm); background: #0b2234; cursor: grab; }
.kcard:hover { border-color: #3c6886; }
.kcard.dragging { opacity: .5; }
.kcard-title { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: .86rem; font-weight: 600; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-title:hover { color: var(--accent); }
.kcard-meta { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.kcard-move { margin-left: auto; display: flex; gap: 2px; }
.due { font-size: .75rem; color: var(--muted); }
.due.overdue { color: var(--bad); font-weight: 600; }
.kmore { align-self: center; }

/* Testing */
.picker { display: flex; flex-direction: column; gap: var(--gap); }
.picker-head p { margin-top: 6px; max-width: 680px; }
.picker-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.choice-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.choice-card.static { cursor: default; }
.choice-card p { font-size: .88rem; }
.choice-card small { color: var(--accent); font: 11px var(--mono); margin-top: auto; }
.choice-card .btn { margin-top: auto; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: var(--gap); }
.test-tile { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: var(--pad-sm); border: 1px solid #203c51; border-left: 3px solid #3a5a72; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.test-tile.res-in-progress { border-left-color: var(--accent); }
.test-tile.res-passed { border-left-color: var(--good); }
.test-tile.res-finding { border-left-color: var(--bad); }
.test-tile.res-not-applicable { border-left-color: #24394a; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
.tile-head .label { min-width: 0; }
.tile-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tile-title { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: .92rem; font-weight: 600; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-title:hover { color: var(--accent); }
.test-tile .result-chips { margin-top: auto; }
.btn.has-notes { color: var(--accent); }
.guide-step { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.test-title { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.test-title:hover { color: var(--accent); }
.has-notes { margin-left: 8px; color: var(--accent); font-size: .8rem; }
.result-chips .chip { min-height: 30px; padding: 3px 10px; font-size: .75rem; }
.test-notes { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: #061421; border: 1px solid var(--line-soft); }
.test-notes > .muted { font-size: .85rem; }
.save-state { font-size: .75rem; color: var(--muted); }
.save-state[data-status=saved] { color: var(--good); }
.save-state[data-status=error] { color: var(--bad); }
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.guide-head h2 { font-size: 1.3rem; margin-top: 4px; }
.guide-stats { display: flex; flex-direction: column; gap: 6px; min-width: 240px; color: var(--muted); font-size: .8rem; }
.phase-strip { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 4px; }
.phase-pill { display: flex; align-items: center; gap: 10px; min-width: 190px; flex: 1; padding: 12px var(--pad-sm); border: 1px solid var(--line); border-radius: var(--radius); background: #071725; color: var(--ink); text-align: left; }
.phase-pill.active { border-color: var(--accent); background: #102d42; }
.phase-pill.done .step-n { background: #0f3a33; border-color: var(--good); color: var(--good); }
.phase-pill b { font-size: .82rem; }
.phase-card { display: flex; flex-direction: column; gap: 6px; }
.phase-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.phase-head h2 { font-size: 1.25rem; }
.deliverable { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding: 10px 14px; border-left: 2px solid var(--accent); background: #0a2031; border-radius: 0 8px 8px 0; font-size: .85rem; }
.deliverable b { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.deliverable span { flex: 1; min-width: 160px; color: var(--muted); }
.guide-step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guide-step-head .chip { min-height: 30px; padding: 3px 10px; font-size: .75rem; }
.phase-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); margin-top: 8px; }
.details { margin: 0; }
.details summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.details[open] summary { margin-bottom: 14px; }
.details .muted { font-size: .88rem; margin-bottom: 8px; }
.source-list { padding-left: 18px; font-size: .88rem; line-height: 1.9; }
.hyp-io { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hyp-io > div { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #04101c; }
.hyp-io p { font-size: .85rem; color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.hyp-card .btn.primary { align-self: flex-start; margin-top: auto; }

/* Findings master-detail */
.fx { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); }
.fx-list { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #061421; }
.fx-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.fx-item:hover { background: #0e263a; }
.fx-item[aria-current=true] { background: #12324a; box-shadow: inset 3px 0 var(--accent); }
.fx-item b { font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sev-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--muted); }
.sev-dot.sev-critical, .sev-dot.sev-high { background: var(--bad); } .sev-dot.sev-medium { background: var(--warn); } .sev-dot.sev-low { background: var(--accent); }
.fx-detail { display: flex; flex-direction: column; gap: 18px; }
.back-link { display: none; font-size: .85rem; text-decoration: none; }
.fx-head { display: flex; flex-direction: column; gap: 8px; }
.fx-head h2 { font-size: 1.45rem; line-height: 1.3; }
.fx-head p { font-size: .85rem; }
.fx-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.fx-status .chip { min-height: 30px; padding: 3px 11px; font-size: .75rem; }
.fx-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fx-section { padding: var(--pad-sm); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #071827; min-width: 0; }
.fx-section h3 { font-size: .85rem; margin-bottom: 10px; color: var(--accent); }
.fx-section.missing { border-style: dashed; }
.fx-section.missing .btn { margin-top: 10px; }
.fx-section .clampable.is-clamped:not(.open)::after { background: linear-gradient(transparent, #071827); }
.fx-evidence { display: flex; flex-direction: column; gap: 12px; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0b2233; color: var(--ink); font-size: .82rem; text-align: left; }
.ev-chip:hover { border-color: var(--accent); }
.ev-chip small { flex: none; }
.fx-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.fx-actions .danger { margin-left: auto; }

/* Evidence */
.dropzone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: var(--pad-sm) var(--pad); border: 1px dashed #3a6481; border-radius: var(--radius); background: #06152280; transition: border-color .15s, background .15s; }
.dropzone p { display: flex; flex-direction: column; gap: 2px; }
.dropzone span { color: var(--muted); font-size: .8rem; }
.dropzone.drop-target { border-color: var(--accent); background: #0c2638; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); }
.ev-tile { display: flex; flex-direction: column; gap: 6px; padding: var(--pad-sm); }
.ev-tile h3 { font-size: .88rem; }
.ev-cover { position: relative; display: grid; place-items: center; height: 130px; margin-bottom: 6px; border: 1px solid #25485f; border-radius: var(--radius-sm); background: radial-gradient(ellipse, #153b58, #071827); color: var(--accent); overflow: hidden; }
.ev-cover > span { font-size: 38px; }
.ev-cover small { position: absolute; right: 8px; bottom: 6px; font: 10px var(--mono); letter-spacing: .12em; color: var(--accent); }
.ev-cover img { width: 100%; height: 100%; object-fit: cover; }
.ev-cover img:not([src]) { display: none; }

/* Delivery */
.ready-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.ready-list li { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ready-list li:last-child { border-bottom: 0; }
.ready-list .mark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1px solid var(--line); color: var(--warn); font-size: .8rem; }
.ready-list .ok .mark { border-color: var(--good); color: var(--good); background: #0f3a33; }
.ready-list .ok b, .ready-list .na b { color: var(--muted); font-weight: 500; }
.ready-list .na .mark { color: var(--muted); }
.export-list { flex: 1; display: grid; grid-auto-rows: 1fr; gap: 10px; }
.export-item { display: flex; align-items: center; gap: 14px; padding: 14px var(--pad-sm); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #071827; color: var(--ink); text-decoration: none; }
.export-item:hover { border-color: var(--accent); }
.export-item .ico { font-size: 1.3rem; color: var(--accent); }
.brief-card { display: flex; flex-direction: column; gap: 16px; }
.brief-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.brief-meta div { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #071827; }
.brief-meta dt { color: var(--muted); font-size: .75rem; }
.brief-meta dd { margin-top: 4px; font-size: .9rem; font-weight: 600; }
.brief-texts section h3 { font-size: .85rem; color: var(--accent); margin-bottom: 8px; }
.brief-texts .clampable { max-height: 10rem; }

/* Log */
.timeline { display: flex; flex-direction: column; gap: var(--gap); }
.tl-day { display: flex; flex-direction: column; gap: 8px; }
.tl-day h3 { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tl-row { display: flex; gap: 16px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #071827; color: var(--ink); text-align: left; font: inherit; }
.tl-row:hover { border-color: var(--accent); }
.tl-time { flex: none; width: 64px; font: 13px var(--mono); color: var(--accent); padding-top: 2px; }
.tl-row .clamp-2 { font-size: .82rem; margin-top: 4px; }
.more-button { align-self: center; }
.cmd-card pre.cmd { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--deep); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.clamp-code { max-height: 6.2em; overflow: hidden; }
code.cmd { display: block; padding: 10px 12px; border-radius: 8px; background: var(--deep); font-size: 12.5px; }
.tool-card .btn { align-self: flex-start; margin-top: auto; }
.note-card .tags { margin-top: auto; padding-top: 4px; }
.notes-wrap textarea { min-height: 360px; font-size: .92rem; }

/* ---------- Home ---------- */

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.legend-item::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: var(--accent); vertical-align: -1px; }
.legend-item.ev-journal::before { background: var(--good); } .legend-item.ev-submission::before { background: var(--warn); } .legend-item.ev-command::before { background: var(--violet); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: 8px 10px; color: var(--muted); font-size: .75rem; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-day { min-height: 118px; padding: 8px; background: #07182766; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-day.outside { background: #01070e55; }
.cal-day.today { background: #12314988; }
.day-number { font-size: .75rem; color: var(--muted); }
.cal-day.today .day-number { color: var(--accent); font-weight: 700; }
.cal-event { display: block; width: 100%; margin-top: 5px; padding: 5px 7px; border: 1px solid #28536f; border-left: 2px solid var(--accent); border-radius: 5px; background: #15334b; color: var(--ink); font: 600 11px/1.4 "Segoe UI", sans-serif; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event small { display: block; font-size: 10px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.cal-event.ev-journal { border-left-color: var(--good); } .cal-event.ev-submission { border-left-color: var(--warn); } .cal-event.ev-command { border-left-color: var(--violet); }
.cal-more { display: block; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.cal-agenda { display: none; }
.cal-empty { margin-top: 12px; }
.agenda-day { margin-bottom: 16px; }
.agenda-day h3 { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.agenda-day .cal-event { white-space: normal; font-size: .85rem; padding: 10px 12px; }

/* ---------- Settings ---------- */
.settings-grid .surface, .data-grid .surface { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; width: 100%; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: .9rem; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 3px #071827; }
.swatch[aria-pressed=true] { border-color: var(--ink); }
.sw-ice { background: #7ecfff; } .sw-electric { background: #72b9ff; } .sw-arctic { background: #76e4ed; }
.shortcut-row { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: .85rem; }
.shortcut-row kbd { font-size: 12px; white-space: nowrap; }
.data-grid .btn { margin-top: auto; }

/* ---------- Dialogs ---------- */
dialog { width: min(720px, calc(100% - 24px)); max-height: min(92vh, 900px); padding: 0; overflow: hidden; color: var(--ink); background: linear-gradient(140deg, #0a1e30, #06131f); border: 1px solid #375d78; border-radius: 16px; box-shadow: 0 20px 100px #00000088; }
dialog[open] { display: flex; flex-direction: column; }
dialog.wide { width: min(940px, calc(100% - 24px)); }
dialog::backdrop { background: #01070ecc; backdrop-filter: blur(5px); }
dialog > form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px 14px; }
.modal-head h2 { font-size: 1.3rem; margin-top: 6px; }
.modal-body { padding: 6px 26px 8px; overflow-y: auto; min-height: 0; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 26px 20px; border-top: 1px solid #244358; }
dialog .error { padding: 0 26px; color: var(--bad); font-size: .85rem; }
dialog .error:empty { display: none; }
.stepper { list-style: none; display: flex; gap: 6px; padding: 0 26px 14px; overflow-x: auto; }
.stepper li { flex: 1; min-width: 0; }
.stepper button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px 10px; border: 0; border-bottom: 2px solid #23405a; background: none; color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; }
.stepper button:disabled { opacity: .6; cursor: default; }
.stepper .step-n { width: 24px; height: 24px; font-size: 11px; }
.stepper .step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .visited button { border-bottom-color: #2b6b5d; color: var(--ink); }
.stepper .visited .step-n { border-color: var(--good); color: var(--good); }
.stepper .current button { border-bottom-color: var(--accent); color: var(--accent); }
.stepper .current .step-n { background: var(--accent); border-color: var(--accent); color: var(--deep); }
.step-intro { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid > .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field + .field { margin-top: 0; }
.wizard-body > .field + .field, .modal-body > .field + .field { margin-top: 16px; }
.field > label, .field > legend, .field > span { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0; }
.field > legend { margin-bottom: 7px; }
.req { color: var(--accent); }
.field-hint { font-size: .75rem; color: var(--muted); }
.choice-cards { display: grid; gap: 10px; }
.choice-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #27475e; border-radius: 10px; background: #061421; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #3c6886; }
.choice:has(input:checked) { border-color: var(--accent); background: #0f2c42; }
.choice input { margin-top: 2px; }
.choice span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice b { font-size: .9rem; }
.choice small { font-size: .78rem; line-height: 1.45; }
.choice em { font: normal 11px var(--mono); color: var(--accent); }
.review { display: flex; flex-direction: column; }
.review-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.review-row dt { color: var(--muted); font-size: .8rem; }
.file-picks { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.file-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: .88rem; }
.file-pick:last-child { border-bottom: 0; }
.file-pick span { display: flex; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; }
.file-pick small { flex: none; }
.import-row { margin-top: 12px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.inline-field select { width: auto; min-height: 34px; padding: 5px 8px; }
.asset-preview { margin-top: 12px; }
#confirm { width: min(460px, calc(100% - 24px)); }
#confirm form { padding: 24px 26px 0; gap: 10px; }
#confirm .modal-foot { padding: 16px 0 20px; margin-top: 10px; }
#search-dialog { width: min(680px, calc(100% - 24px)); align-self: flex-start; margin-top: 10vh; }
.search-box { display: flex; gap: 8px; padding: 16px 16px 10px; }
.search-box input[type=search] { min-height: 46px; font-size: 1rem; }
#search-results { overflow-y: auto; padding: 0 10px 8px; min-height: 0; flex: 1; }
.search-group { padding: 10px 8px 4px; color: var(--accent); font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.search-hit { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-hit small { flex: none; max-width: 45%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit[aria-selected=true], .search-hit:hover { background: #12324a; }
.search-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line-soft); }
#viewer { width: min(1080px, calc(100% - 24px)); }
.viewer-body { padding: 0 26px 24px; overflow: auto; min-height: 0; }
.viewer-body pre { margin: 0; padding: 16px; border-radius: 10px; background: var(--deep); font: 13px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-image { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; object-fit: contain; border-radius: 8px; }

/* Menu */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; padding: 6px; border: 1px solid #375d78; border-radius: var(--radius); background: #0a1e30; box-shadow: 0 16px 50px #000000aa; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu [role=menuitem] { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: .88rem; text-align: left; text-decoration: none; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: #12324a; outline: none; }
.menu .danger { color: var(--bad); }

/* Toast and session bar */
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 14px; max-width: min(460px, calc(100% - 32px)); padding: 12px 14px 12px 18px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--panel2); box-shadow: 0 10px 40px #00000077; font-size: .9rem; }
#toast.tone-error { border-color: var(--bad); }
#session-bar { position: fixed; left: calc(50% + 115px); bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; max-width: calc(100vw - 280px); padding: 10px 12px 10px 16px; border: 1px solid #49728f; border-radius: var(--radius); background: #071827f5; box-shadow: 0 10px 40px #00000077; font-size: .85rem; }
.sb-main { display: flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; min-width: 0; }
.sb-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sb-clock { margin-left: 12px; font: 15px var(--mono); color: var(--accent); }
body.has-session #toast { bottom: 84px; }

/* ---------- Preferences ---------- */
body[data-motion=reduced] *, body[data-motion=reduced] *::before { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }

/* ---------- Responsive ---------- */
@media (min-width: 1900px) {
  main { max-width: 1840px; padding-inline: 60px; }
  .app { grid-template-columns: 260px minmax(0, 1fr); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}
@media (max-width: 1250px) {
  .stepper-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brief-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g3, .data-grid { grid-template-columns: 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .fx { grid-template-columns: 1fr; }
  .fx-list { position: static; max-height: none; }
  .fx.has-item .fx-list { display: none; }
  .fx:not(.has-item) .fx-detail { display: none; }
  .back-link { display: inline-flex; }
  .findings-rows .rows-head, .findings-rows .row-link { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) 100px 110px; }
  .findings-rows .row-link > :last-child, .findings-rows .rows-head > :last-child { display: none; }
  .sev-strip { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); }
  main { padding: 30px 24px 90px; }
  .intro-steps { grid-template-columns: 1fr; }
  .fx-sections, .hyp-io { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, minmax(240px, 82%)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .kcol { scroll-snap-align: start; }
  #session-bar { left: 50%; max-width: calc(100vw - 32px); }
}
@media (max-width: 720px) {
  .hero-tools { position: static; margin-top: 4px; justify-content: flex-start; }
  .app { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 45; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; gap: 0; border-right: 0; border-top: 1px solid var(--line); background: #030c14f5; overflow: visible; }
  .brand, .tagline, .sidebar-foot { display: none; }
  .mainnav { flex-direction: row; gap: 2px; }
  .mainnav a { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; padding: 6px 2px; font-size: .68rem; border-radius: 10px; text-align: center; }
  .mainnav a .ico { font-size: 18px; width: auto; }
  .mainnav a[aria-current=page] { box-shadow: inset 0 -2px var(--accent); }
  .mainnav .nav-settings { margin-top: 0; }
  main { padding: 20px 16px 96px; }
  h1 { font-size: 1.6rem; }
  .topbar { margin-bottom: 20px; gap: 14px; }
  .topbar-main { flex-basis: 100%; }
  .search-trigger .search-label, .search-trigger kbd { display: none; }
  .hero { padding: 22px 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 1.5rem; }
  .stepper-cards { grid-template-columns: 1fr; gap: 8px; }
  .step-card { padding: 10px 12px; }
  .ptabs { margin-inline: -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .toolbar { padding: 12px; }
  .toolbar-row > .hint { flex-basis: 100%; max-width: none; margin-left: 0; text-align: left; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar select { flex: 1; max-width: none; min-width: 0; }
  .sev-strip { grid-template-columns: repeat(5, minmax(96px, 1fr)); }
  .rows-head { display: none; }
  .rows .row-link { grid-template-columns: 1fr auto !important; row-gap: 6px; }
  .rows .row-link .cell-main { grid-column: 1 / -1; }
  .rows .row-link .cell:empty { display: none; }
  .card-grid, .card-grid.wide, .evidence-grid { grid-template-columns: 1fr; }
  .form-grid, .choice-cards.two, .choice-cards.three { grid-template-columns: 1fr; }
  .review-row { grid-template-columns: 1fr auto; }
  .review-row dt { grid-column: 1 / -1; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .stepper { padding: 0 18px 12px; }
  .stepper .step-label { display: none; }
  
  dialog { width: calc(100% - 16px); max-height: 94vh; }
  .cal-weekdays, .cal-grid { display: none; }
  .cal-agenda { display: block; }
  .cal-empty { display: none; }
  .fx-actions .btn { flex: 1 1 45%; }
  .fx-actions .danger { margin-left: 0; }
  .guide-head { flex-direction: column; align-items: stretch; }
  .phase-pill { min-width: 150px; }
  #toast { left: 12px; right: 12px; bottom: 80px; max-width: none; }
  #session-bar { left: 8px; right: 8px; bottom: 72px; transform: none; max-width: none; justify-content: space-between; }
  body.has-session #toast { bottom: 140px; }
  body.has-session main { padding-bottom: 160px; }
  .menu { right: -8px; }
}
