/* claude-fscar dashboard - look of the platform mockup (docs/platform/mockup). No external fonts (CSP). */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1c2430; --muted: #5f6976; --faint: #8a929c;
  --line: #dfe3e8; --line-soft: #eef1f5; --track: #eef1f5;
  --accent: #2a6f97; --accent-strong: #1d5373; --accent-weak: #e3eef5;
  --warn-bg: #fff4e0; --warn: #8a5200; --warn-line: #f3d9a8;
  --ok-bg: #e6f4ea; --ok: #1e6b2b; --bad: #b03a2e; --bad-line: #f0c9c3; --neutral-bg: #eef1f5; --neutral: #4b5563;
  --bar-done: #2a6f97; --bar-active: #c47a00; --bar-active-bg: #f3d9a8; --bar-planned: #c9d0d8;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --panel: #1a2029; --text: #e6e9ee; --muted: #9aa4b0; --faint: #7d8794; --line: #2c3440;
    --line-soft: #232a34; --track: #262e39; --accent: #6bb3dc; --accent-strong: #9fd0ec; --accent-weak: #1f3341;
    --warn-bg: #3a2c14; --warn: #f0c27a; --warn-line: #5a4320; --ok-bg: #1d3323; --ok: #8fd19e; --bad: #f08a7e;
    --bad-line: #5a2a25; --neutral-bg: #2a323d; --neutral: #c3cad3; --bar-done: #5aa9d6; --bar-active: #e0a040;
    --bar-active-bg: #5a4320; --bar-planned: #4a5562; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); } a:hover { color: var(--accent-strong); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
h1 { font-size: 32px; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 15px; margin: 0 0 6px; }
.err { color: var(--bad); }

/* ---- shell */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; white-space: nowrap; } .brand span { font-weight: 400; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--text); white-space: nowrap; }
nav a:hover { background: var(--line-soft); color: var(--text); }
nav a.active { background: var(--accent-weak); color: var(--accent-strong); font-weight: 600; }
.badge { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 2px; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--muted); }
.search { position: relative; }
.search input { width: 220px; }
.search .results { position: absolute; right: 0; top: 40px; width: min(560px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.12); padding: 6px; z-index: 10; }
.search .hit { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.search .hit:hover, .search .hit:focus { background: var(--accent-weak); outline: none; }
.search .hit small { display: block; color: var(--muted); }
main { max-width: 1360px; margin: 0 auto; padding: 24px 32px 56px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 700px) { main { padding: 16px 16px 48px; } .top { padding: 10px 16px; } .search input { width: 160px; } h1 { font-size: 26px; } }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.row > .grow { flex: 999 1 560px; min-width: 0; } .row > .side { flex: 1 1 300px; min-width: 0; }
.row > .side.narrow { flex: 1 1 240px; max-width: 300px; } .row > .side.wide { flex: 1 1 340px; max-width: 420px; }

/* ---- building blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card.warn { border-color: var(--warn-line); } .card.bad { border-color: var(--bad-line); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-decoration: none; color: var(--text); }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; } .kpi .l { font-size: 13px; color: var(--muted); }
.kpi.bad { border-color: var(--bad-line); } .kpi.bad .v { color: var(--bad); }
.kpi.warn { border-color: var(--warn-line); } .kpi.warn .v { color: var(--warn); }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.chip.accent, .chip.preliminary, .chip.evidence, .chip.layout { background: var(--accent-weak); color: var(--accent-strong); }
.chip.warn, .chip.open, .chip.answered, .chip.active, .chip.running { background: var(--warn-bg); color: var(--warn); }
.chip.ok, .chip.acknowledged, .chip.done, .chip.validated, .chip.verified, .chip.pass { background: var(--ok-bg); color: var(--ok); }
.chip.qopen { background: #fdecea; color: var(--bad); }
@media (prefers-color-scheme: dark) { .chip.qopen { background: #3a1f1c; } }
.list > * { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.list > *:first-child { border-top: 0; }
.item-title { font-size: 14px; font-weight: 600; } .item-meta { font-size: 13px; color: var(--muted); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.3; }
button:hover, .btn:hover { border-color: var(--faint); color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primary, .btn.primary { color: #0d1a22; } }
button:disabled { opacity: .6; cursor: default; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pills button { border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.pills button.on, .tabs button.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; font-size: 14px; }
.tabs button.on { background: transparent; border-bottom-color: var(--accent); }
.menu button, .menu a { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; border-radius: 6px; padding: 8px 10px; min-height: 36px; background: transparent; font-size: 14px; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--line-soft); }
.menu .on { background: var(--accent-weak) !important; color: var(--accent-strong); font-weight: 600; }
.menu .group { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 2px; padding: 0 10px; }
.menu .dim { color: var(--muted); }
input[type=search], input[type=text], textarea, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label.lbl { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.box { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.box .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.answer { white-space: pre-wrap; }
.note { font-size: 13px; color: var(--muted); margin: 0; }

/* ---- tables */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line-soft); }
th { font-weight: 600; color: var(--muted); background: var(--bg); border-top: 0; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
.table-min { min-width: 900px; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--line-soft); }

/* ---- bars */
.bar-row { display: grid; grid-template-columns: minmax(120px, 230px) minmax(0, 1fr) 72px; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
.track { background: var(--track); border-radius: 4px; height: 12px; overflow: hidden; }
.track > div { height: 100%; border-radius: 4px; background: var(--accent); }
.track > div.margin { background: var(--bar-planned); }
.stack { display: flex; height: 28px; border-radius: 6px; overflow: hidden; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---- gates */
.gates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 3px solid var(--line); }
.gates > div { padding: 10px 10px 0 0; }
.gates > div.next { border-top: 3px solid var(--accent); margin-top: -3px; }
.gates .g { font-weight: 700; } .gates .next .g { color: var(--accent-strong); }
.gates .d { font-size: 13px; color: var(--muted); } .gates .n { font-size: 14px; }

/* ---- gantt */
.gantt { min-width: 1060px; }
.gantt .gr { display: grid; grid-template-columns: 380px minmax(0, 1fr) 64px; align-items: center; border-top: 1px solid var(--line-soft); }
.gantt .gr.hd { background: var(--bg); border-top: 0; }
.gantt .gr.sel { background: var(--accent-weak); }
.gantt .lbl { padding: 5px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .lbl span { color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt .lane { position: relative; height: 28px; }
.gantt .hd .lane { height: 52px; }
.gantt .pct { padding: 5px 12px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gantt .stream { padding: 8px 12px 2px; font-size: 12px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line-soft); }
.gantt .bar { position: absolute; top: 7px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--bar-planned); }
.gantt .bar.done { background: var(--bar-done); } .gantt .bar.active { background: var(--bar-active-bg); }
.gantt .bar.active > div { height: 100%; background: var(--bar-active); }
.gantt .bar.descoped { background: transparent; border: 1px dashed var(--bar-planned); }
.gantt .today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .6; }
.gantt .month { position: absolute; top: 6px; font-size: 12px; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--line); height: 44px; }
.gantt .gate { position: absolute; top: 26px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #fff; background: var(--accent-strong); border-radius: 4px; padding: 2px 5px; }
@media (prefers-color-scheme: dark) { .gantt .gate { color: #0d1a22; } }

/* ---- CAD */
.viewer { position: relative; border-radius: 8px; overflow: hidden; background: var(--line-soft); height: 540px; }
.viewer .sel { position: absolute; left: 14px; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.viewer img { width: 100%; height: 100%; object-fit: contain; display: block; background: #f3f4f6; }
input[type=range] { width: 100%; accent-color: var(--accent); }
@media (max-width: 700px) { .viewer { height: 360px; } }

/* ---- documents */
.doc { line-height: 1.6; }
.doc h1 { font-size: 28px; margin: 4px 0 12px; } .doc h2 { font-size: 20px; margin: 26px 0 8px; } .doc h3 { font-size: 17px; margin: 22px 0 6px; }
.doc table { margin: 10px 0; display: block; overflow-x: auto; } .doc td, .doc th { border: 1px solid var(--line-soft); }
.doc pre { overflow-x: auto; background: var(--bg); padding: 10px; border-radius: 6px; font-size: 12px; }
.doc code { font-size: 13px; } .doc img { max-width: 100%; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.doc a.xref { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.doc :target { background: var(--warn-bg); }
img.plot { max-width: 100%; background: #fff; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* ---- ED slide */
.slide { aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; background: #fff; color: #1c2430; }
.slide .cat { font-size: 13px; color: #2a6f97; font-weight: 600; }
.slide .claim { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.slide .body { display: flex; gap: 22px; flex: 1; min-height: 0; }
.slide .body img { flex: 1 1 55%; min-width: 0; object-fit: contain; border: 1px solid #eef1f5; border-radius: 6px; }
.slide .body ul { flex: 1 1 45%; margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.slide .src { font-size: 12px; color: #5f6976; }
@media (max-width: 700px) { .slide { aspect-ratio: auto; padding: 18px; } .slide .body { flex-direction: column; } }

.login { text-align: center; margin: 80px auto; max-width: 460px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.kv > div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.kv > div span:first-child { color: var(--muted); }
tr.sel td { background: var(--accent-weak); }
.doc .target { background: var(--warn-bg); border-radius: 4px; }
details > summary { cursor: pointer; }
@media print { .top, nav.menu, .pills button, .side { display: none !important; } main { padding: 0; } .card { border: 0; } }
.math-block { overflow-x: auto; overflow-y: hidden; text-align: center; margin: 12px 0; font-size: 1.1em; }
math { font-size: 1.05em; }

/* ---- collapsible side panels: open on wide screens, collapsed on phones (core.js panel()) */
details.panel > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; padding: 4px 10px 6px; min-height: 36px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .sub { margin-left: auto; text-align: right; font-weight: 400; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.panel > summary::after { content: "▾"; color: var(--muted); font-size: 14px; }
details.panel[open] > summary::after { content: "▴"; }
@media (min-width: 900px) {
  details.panel > summary { pointer-events: none; }
  details.panel > summary::after, details.panel > summary .sub { display: none; }
}
.menu a > span, .menu button > span { min-width: 0; overflow-wrap: anywhere; }

/* ---- header: menu button on phones */
.menu-btn { display: none; margin-left: auto; padding: 8px 12px; line-height: 0; }
.menu-btn svg { width: 20px; height: 20px; }
.topnav { display: contents; }
@media (max-width: 899px) {
  .top { gap: 8px; padding: 8px 16px; }
  .menu-btn { display: inline-block; }
  .topnav { display: none; width: 100%; flex-direction: column; gap: 10px; padding: 6px 0 4px; }
  .top.open .topnav { display: flex; }
  .topnav nav { flex-direction: column; gap: 2px; }
  .topnav nav a { padding: 10px 12px; }
  .topnav .who { margin-left: 0; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 10px; }
  .topnav .search { order: -1; width: 100%; }
  .topnav .search input { width: 100%; }
  .search .results { position: static; width: 100%; max-height: 60vh; box-shadow: none; margin-top: 6px; }
  .top:not(.open) .search .results { display: none; }
}

/* ---- tables as cards on phones (core.js labels the cells of table.rtable) */
@media (max-width: 699px) {
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; min-width: 0; }
  table.rtable thead, table.rtable tr:has(> th) { display: none; }
  table.rtable tr { padding: 10px 14px; border-top: 1px solid var(--line); }
  table.rtable tr:first-child, table.rtable thead + tbody tr:first-child { border-top: 0; }
  table.rtable td { border: 0; padding: 2px 0; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; text-align: right; }
  table.rtable td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: 0 0 34%; }
  table.rtable td[data-label=""]::before { content: none; }
  table.rtable td.lead { display: block; text-align: left; font-size: 15px; padding-bottom: 4px; }
  table.rtable td.lead::before { content: none; }
  .card.flush .table-min, .card.flush table { min-width: 0 !important; }
  table.rtable td.hide-sm { display: none; }
  table.rtable td.lead { font-weight: 600; }
}

/* ---- Gantt on phones: label line above the bar */
@media (max-width: 699px) {
  .gantt { min-width: 0; }
  .gantt .gr { grid-template-columns: minmax(0, 1fr) 52px; }
  .gantt .gr .lbl { grid-column: 1; grid-row: 1; padding: 6px 12px 0; white-space: normal; }
  .gantt .gr .pct { grid-column: 2; grid-row: 1; padding-top: 6px; }
  .gantt .gr .lane { grid-column: 1 / -1; grid-row: 2; margin: 0 12px; height: 22px; }
  .gantt .gr .lane .bar { top: 4px; }
  .gantt .gr.hd .lbl, .gantt .gr.hd .pct { display: none; }
  .gantt .gr.hd .lane { grid-row: 1; height: 52px; }
  .gantt .gate { font-size: 10px; padding: 1px 3px; }
  .gantt .month { font-size: 11px; }
}

/* ---- documents on phones */
@media (max-width: 699px) {
  .doc { padding: 14px 14px; overflow-wrap: anywhere; }
  .doc h1 { font-size: 24px; } .doc h2 { font-size: 18px; }
  .doc table td, .doc table th { min-width: 8em; }
  .doc table td:first-child, .doc table th:first-child { min-width: 4em; }
  .viewer { height: 340px; }
  .slide .claim { font-size: 20px; }
  .kpi .v { font-size: 22px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) minmax(60px, 34%) 62px; font-size: 13px; }
}
.menu-btn .badge { line-height: 1.5; margin-left: 6px; vertical-align: 3px; }
@media (max-width: 899px) { .row > .docmain { order: 2; } .row > aside.side { order: 1; } }
.neg { color: var(--bad); } .pos { color: var(--ok); }
