/* ============================================================================
   PageOneAudit design system — ported from PageOneAudit.dc.html (Claude Design).
   Data-dense instrument, light only. Cool graphite chrome, one signal-cyan accent,
   semantic colour reserved for state, monospace for every figure.
   ============================================================================ */
:root {
  --bg:#F5F8FA; --surface:#FFFFFF; --surface-2:#EFF3F6; --line:#E1E7EC;
  --ink:#101820; --ink-2:#48555F; --ink-3:#7C8894;
  --accent:#0B84A5; --accent-2:#076780; --accent-bg:#E4F2F6;
  --good:#1E9D5B; --good-bg:#E4F4EB; --warn:#C07C08; --warn-bg:#F8EEDB; --crit:#D2453F; --crit-bg:#FAE6E5;
  --mono:ui-monospace,"SF Mono","Cascadia Code",Menlo,Consolas,monospace;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  --shadow:0 1px 2px rgba(16,24,32,.04),0 1px 3px rgba(16,24,32,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color-scheme: light;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 13px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
::selection { background: var(--accent-bg); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-3); } .dim2 { color: var(--ink-2); }
.is-good { color: var(--good); font-weight: 600; }
.is-warn { color: var(--warn); font-weight: 600; }
.is-crit { color: var(--crit); font-weight: 600; }
.is-accent { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #CBD5DC; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #B4C0C9; }

/* ---- shell ---------------------------------------------------------------- */
.app { height: 100vh; display: flex; overflow: hidden; background: var(--bg); }
.side { width: 238px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.brand .mark { width: 28px; height: 28px; flex: none; border-radius: 6px; background: var(--accent); position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.brand .mark::before { content:""; position:absolute; left:8px; top:8px; width:12px; height:12px; border:2px solid #fff; border-radius:50%; }
.brand .mark::after { content:""; position:absolute; right:6px; bottom:6px; width:6px; height:2px; background:#fff; transform:rotate(45deg); border-radius:2px; }
.brand-txt { line-height: 1.1; display: flex; flex-direction: column; }
.brand-txt b { font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--ink); }
.brand-txt em { font-family: var(--mono); font-style: normal; font-size: 9px; letter-spacing: .14em; color: var(--ink-3); margin-top: 2px; text-transform: uppercase; }
.snav { flex: 1; overflow: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; }
.snav a { padding: 8px 10px; border-radius: 6px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.snav a:hover { background: var(--surface-2); color: var(--ink); }
.snav a.on { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 9px; }
.side-foot .av { width: 26px; height: 26px; border-radius: 50%; flex: none; background: linear-gradient(135deg,#0B84A5,#076780); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.side-foot .who { line-height: 1.15; display: flex; flex-direction: column; }
.side-foot .who b { font-weight: 600; font-size: 12px; }
.side-foot .who em { font-style: normal; font-size: 10px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex: none; height: 52px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 14px; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.crumbs .sep { color: var(--ink-3); } .crumbs .cur { font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn { height: 32px; display: inline-flex; align-items: center; padding: 0 15px; background: var(--accent); border: 1px solid var(--accent); border-radius: 16px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: #fff; cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.scroll { flex: 1; overflow: auto; }
.page { max-width: 1120px; margin: 0 auto; padding: 24px 26px 60px; }
.col { max-width: 1120px; margin: 0 auto; padding: 24px 26px; }
.empty { padding: 60px; text-align: center; color: var(--ink-3); }
.pulsing { font-weight: 600; color: var(--ink-2); animation: fade 1.5s infinite; }
@keyframes fade { 0%,100%{opacity:1} 50%{opacity:.55} }
.banner-err { margin: 24px 26px; background: var(--crit-bg); border: 1px solid #F1C9C7; color: #8A2C28; border-radius: 8px; padding: 14px 16px; font-size: 13px; }

/* ---- verdict banner ------------------------------------------------------- */
.verdict-banner { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.vb-grade { flex: none; width: 150px; border-right: 1px solid var(--line); padding: 20px 18px; display: flex; flex-direction: column; justify-content: center; }
.tone-good .vb-grade { background: var(--good-bg); } .tone-good .vb-lbl, .tone-good .vb-letter { color: var(--good); }
.tone-warn .vb-grade { background: var(--warn-bg); } .tone-warn .vb-lbl, .tone-warn .vb-letter { color: var(--warn); }
.tone-crit .vb-grade { background: var(--crit-bg); } .tone-crit .vb-lbl, .tone-crit .vb-letter { color: var(--crit); }
.vb-lbl { font-size: 10px; font-weight: 700; letter-spacing: .09em; margin-bottom: 6px; }
.vb-letter { font-size: 52px; font-weight: 700; line-height: .9; }
.vb-note { font-size: 11px; color: var(--ink-2); margin-top: 8px; line-height: 1.35; }
.vb-body { flex: 1; padding: 18px 22px; min-width: 0; }
.vb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .09em; color: var(--ink-3); text-transform: uppercase; }
.vb-verdict { font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; max-width: 660px; text-wrap: pretty; }
.vb-warn { margin-top: 14px; display: flex; align-items: flex-start; gap: 8px; background: var(--warn-bg); border: 1px solid #ECD9AE; border-radius: 6px; padding: 8px 11px; max-width: 700px; font-size: 12px; color: #6E4E08; line-height: 1.4; }
.warn-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.mini-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; }
.mini-tag.warn { color: var(--warn); background: var(--warn-bg); }

/* ---- summary strip -------------------------------------------------------- */
.summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 22px; }
.sum-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); padding: 13px 15px; }
.sum-cell.stripe-crit { border-left: 2px solid var(--crit); }
.sum-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; color: var(--ink-3); text-transform: uppercase; }
.sum-val { font-size: 27px; font-weight: 700; margin-top: 4px; line-height: 1; }
.sum-val .pct { font-size: 15px; color: var(--ink-3); }
.sum-sub { font-size: 11px; color: var(--ink-2); margin-top: 3px; }

/* ---- section heads -------------------------------------------------------- */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.sec-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sec-sub { font-size: 12px; color: var(--ink-3); }

/* ---- action plan ---------------------------------------------------------- */
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.offp-wrap { margin-bottom: 26px; }
.plan-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.plan-head.onp { background: var(--surface-2); }
.plan-head.offp { background: var(--accent-bg); }
.plan-head b { font-size: 13px; } .plan-head b.accent { color: var(--accent-2); }
.plan-head .sq { width: 8px; height: 8px; border-radius: 2px; } .sq.ink { background: var(--ink); } .sq.accent { background: var(--accent); }
.plan-sub { font-size: 11.5px; color: var(--ink-2); } .plan-sub.accent { color: var(--accent-2); opacity: .85; }
.plan-count { margin-left: auto; font-size: 11px; color: var(--ink-3); } .plan-count.accent { color: var(--accent-2); }
.plan-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.plan-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-row.stripe-crit { box-shadow: inset 2px 0 0 var(--crit); }
.plan-row.stripe-warn { box-shadow: inset 2px 0 0 var(--warn); }
.plan-txt { flex: 1; min-width: 0; }
.plan-factor { font-weight: 600; font-size: 13px; }
.plan-sub2 { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; text-wrap: pretty; }
.pill { flex: none; width: 62px; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; border-radius: 3px; padding: 4px 0; text-transform: uppercase; }
.pill-high { color: var(--crit); background: var(--crit-bg); border: 1px solid #F1C9C7; }
.pill-medium { color: var(--warn); background: var(--warn-bg); border: 1px solid #ECD9AE; }
.pill-low { color: var(--ink-2); background: var(--surface-2); border: 1px solid #DCE3E8; }
.gap { flex: none; width: 300px; display: flex; flex-direction: column; gap: 5px; }
.gap-nums { font-size: 12px; display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.gap-nums .you b { font-weight: 700; } .gap-nums .arrow, .arrow { color: var(--ink-3); }
.gap-nums .tgt { color: var(--ink-2); }
.gap-delta { color: var(--crit); font-weight: 700; }
.gap-track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.gap-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.offrow { }
.off-badge { flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .07em; color: var(--accent-2); background: var(--accent-bg); border: 1px solid #BEDDE5; border-radius: 3px; padding: 3px 7px; }
.bool { display: flex; align-items: center; gap: 8px; flex: none; }
.tag { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 3px; font-weight: 600; }
.tag.crit { background: var(--crit-bg); color: var(--crit); }
.tag.good { background: var(--good-bg); color: var(--good); }

/* ---- data tables ---------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 26px; }
.tbl-scroll { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.dt thead tr { background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.dt th { text-align: left; padding: 9px 16px; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; white-space: nowrap; }
table.dt th.r { text-align: right; }
table.dt td { padding: 9px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.dt tbody tr:last-child td { border-bottom: 0; }
table.dt tbody tr:hover td { background: var(--surface-2); }
table.dt td.r { text-align: right; }
.factor-name { font-weight: 500; position: relative; }
.row-stripe { position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; }
.row-stripe.st-crit { background: var(--crit); } .row-stripe.st-warn { background: var(--warn); }
.row-stripe.st-good { background: var(--good); } .row-stripe.st-muted { background: transparent; }
.band { font-size: 11px; font-weight: 600; border-radius: 3px; padding: 2px 8px; display: inline-block; white-space: nowrap; }
.band-crit { color: var(--crit); background: var(--crit-bg); }
.band-warn { color: var(--warn); background: var(--warn-bg); }
.band-good { color: var(--good); background: var(--good-bg); }
.band-muted { color: var(--ink-3); background: var(--surface-2); }

/* ---- entity gaps + serp --------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.ent-row { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.ent-row:last-child { border-bottom: 0; }
.ent-term { font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 9px; }
.ent-note { flex: 1; min-width: 0; font-size: 11.5px; color: var(--ink-2); }
.ent-dots { flex: none; display: flex; align-items: center; gap: 3px; }
.ent-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-2); }
.ent-dot.on { background: var(--accent); }
.ent-count { flex: none; width: 52px; text-align: right; font-size: 11.5px; color: var(--ink-3); }
/* vocabulary lists (report) — select-all so one click grabs the whole list without the button */
.vocab-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.vocab-terms { padding: 12px 14px; font-size: 11.5px; line-height: 1.9; max-height: 260px; overflow-y: auto; color: var(--ink-2); user-select: all; }
.serp-row { display: flex; align-items: center; gap: 12px; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.serp-row:last-child { border-bottom: 0; }
.serp-row.you { background: var(--accent-bg); }
.serp-rank { flex: none; width: 26px; text-align: right; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.serp-rank.is-accent { color: var(--accent-2); }
.serp-mid { flex: 1; min-width: 0; }
.serp-host { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-tag { font-size: 10.5px; font-weight: 600; margin-top: 1px; }
.serp-tag.warn { color: var(--warn); } .serp-tag.you { color: var(--accent-2); }
.serp-words { flex: none; width: 60px; text-align: right; font-size: 11.5px; color: var(--ink-2); }

@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2,1fr); }
  .two-col { grid-template-columns: 1fr; }
  .gap { width: 200px; }
  .side { display: none; }
}

/* action-plan "show all" footer */
.plan-more { padding: 10px 16px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.plan-more a { color: var(--accent); font-weight: 600; }

/* ---- forms + utility-page controls (New audit / History / Factors) ---------------------- */
.form-wrap { max-width: 640px; }
.lead { font-size: 13px; color: var(--ink-2); margin: 4px 0 20px; line-height: 1.5; max-width: 640px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.fld { margin-bottom: 18px; }
.fld:last-child { margin-bottom: 0; }
.fld > label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.inp {
  width: 100%; height: 38px; padding: 0 12px; font-family: var(--sans); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-sizing: border-box;
}
.inp.mono { font-family: var(--mono); }
select.inp { cursor: pointer; padding-right: 8px; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.hint.warn { color: var(--warn); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.divide-top { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.note { border-radius: 7px; padding: 9px 12px; font-size: 12px; line-height: 1.45; }
.note.warn { background: var(--warn-bg); border: 1px solid #ECD9AE; color: #6E4E08; }
.note.crit { background: var(--crit-bg); border: 1px solid #F1C9C7; color: #8A2C28; }
.btn.block { width: 100%; justify-content: center; height: 40px; font-size: 13px; }
.btn[disabled] { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); cursor: not-allowed; box-shadow: none; }

/* status pill (History) */
.spill { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; }
.spill.DONE { color: var(--good); background: var(--good-bg); }
.spill.RUNNING { color: var(--accent-2); background: var(--accent-bg); }
.spill.PENDING { color: var(--ink-2); background: var(--surface-2); }
.spill.FAILED { color: var(--crit); background: var(--crit-bg); }

/* filters row */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters .inp { height: 34px; }
.row-del { color: var(--ink-3); cursor: pointer; font-size: 12px; background: none; border: none; }
.row-del:hover { color: var(--crit); }
.row-act { color: var(--ink-3); cursor: pointer; font-size: 14px; background: none; border: none; text-decoration: none; margin-right: 10px; }
.row-act:hover { color: var(--ink); }
.prose { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.prose h2 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 16px 0 6px; }
.prose p { margin: 0 0 10px; }
.prose code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }

/* center-aligned cells for utility tables */
table.dt th.c, table.dt td.c { text-align: center; }

/* ---- strategic overview: the 7 checks ---------------------------------------------------- */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 22px; }
.chk { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 13px 15px; position: relative; overflow: hidden; }
.chk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
.chk-crit::before { background: var(--crit); }
.chk-warn::before { background: var(--warn); }
.chk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.chk-name { font-weight: 700; font-size: 13px; }
.chk-nums { font-size: 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.chk-nums b { font-weight: 700; }
.chk-deficit { font-size: 11px; font-weight: 600; color: var(--crit); margin-top: 3px; }
.chk-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }

/* ---- data-quality check detail (grade banner) --------------------------------------------- */
.vb-checks-toggle { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 600; }
.vb-checklist { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.vcheck { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.vcheck .band { flex: none; }
.vcheck-name { font-weight: 600; white-space: nowrap; text-transform: capitalize; }
.vcheck-detail { font-size: 11.5px; line-height: 1.35; }

/* ---- change since last run ----------------------------------------------------------------- */
.diff-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.chip { font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 11px; }
.chip-good { color: var(--good); background: var(--good-bg); }
.chip-crit { color: var(--crit); background: var(--crit-bg); }
.chip-muted { color: var(--ink-2); background: var(--surface-2); }
.movers { margin-top: 11px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 18px; }
.mover { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; padding: 3px 0; }
.mover-dir { font-weight: 700; flex: none; }
.mover-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
