/* OKCapture portal — shared styles. Values come from css/tokens.css (docs/design/tokens). No new colours here. */
* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell { min-height: 100vh; padding: var(--page-pad); }
.topbar, .page { max-width: var(--content-max); margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: var(--section-gap); margin-top: 24px; }

/* ---- top bar ---- */
.topbar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font: 600 19px/1 var(--font-display); letter-spacing: -0.02em; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a { display: flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid transparent; background: var(--surface-muted); }
.nav a:hover { background: var(--surface); }
.nav a[aria-current] { background: var(--surface); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.ask-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 20px; border-radius: 22px; background: var(--accent); color: #fff; font-weight: 500; }
.ask-btn[aria-current] { background: var(--ink); }
.badge-arrow { display: flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--accent); }
.ask-btn[aria-current] .badge-arrow { color: var(--ink); }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px 48px; align-items: end; padding-top: 20px; border-top: var(--rule-hero); }
.hero-right { display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.hero-right > p { margin: 0; max-width: 460px; color: var(--ink-2); }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow a:hover { text-decoration: underline; }
.page-title { margin-top: 8px; }
.dim { color: var(--ink-display-grey); }
.ink-2 { color: var(--ink-2); } .ink-3 { color: var(--ink-3); }
.small { font-size: 13px; } .xsmall { font-size: 12px; }
.lead { font-size: 15px; color: var(--ink-2); margin: 0; }

/* ---- cards ---- */
.card { background: var(--surface); border-radius: var(--radius-card); padding: var(--card-pad); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card-head .section-title { margin-top: 6px; }
.section-title.lg { font-size: 26px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.split-main { grid-column: span 2; padding: 26px 30px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.split-hl { background: var(--accent); color: #fff; padding: 14px 30px 22px; border-bottom-left-radius: var(--radius-panel-corner); display: flex; flex-direction: column; }
.split-hl .eyebrow { color: rgba(255,255,255,0.85); padding: 14px 0 4px; }
.hl-row { display: block; padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.35); }
.hl-row b { display: block; font: 400 34px/1 var(--font-display); letter-spacing: -0.03em; }
.hl-row span { display: block; margin-top: 4px; font-size: 13px; }
@media (max-width: 760px) { .split-main { grid-column: auto; } .split-hl { border-bottom-left-radius: 0; } }
.kpi-xl .of { color: var(--rule); }
.kpi-l { font: 300 56px/0.9 var(--font-display); letter-spacing: -0.04em; }
.num-panel { font: 400 30px/1 var(--font-display); letter-spacing: -0.03em; }
.card-title { font: 600 17px/1.2 var(--font-display); letter-spacing: -0.01em; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.rule-row { border-top: var(--rule-row); }
.scroll-x { overflow-x: auto; }

/* ---- marks ---- */
.hex { display: block; flex: none; clip-path: var(--hex-clip); }
.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; flex: none; }
.meter i { display: block; width: 3px; border-radius: 1px; background: var(--meter-off); }
.meter i:nth-child(1) { height: 4px; } .meter i:nth-child(2) { height: 7px; } .meter i:nth-child(3) { height: 10px; } .meter i:nth-child(4) { height: 13px; }
.meter i.on { background: var(--ink); }
.meter.on-dark i { background: rgba(255,255,255,0.35); } .meter.on-dark i.on { background: #fff; }
.squares { display: flex; flex-wrap: wrap; gap: 4px; }
.sq { display: block; width: 14px; height: 14px; border-radius: 3px; flex: none; }
.sq.lg { width: 18px; height: 18px; border-radius: 4px; }
.sq.planned { background: transparent !important; border: 1.5px dashed var(--depth-advanced); }
.lv-4 { background: var(--depth-expert); } .lv-3 { background: var(--depth-advanced); } .lv-2 { background: var(--depth-working); } .lv-1 { background: var(--depth-aware); }
.lv-0 { background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border); }
.dot { display: block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.disc { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.disc.lg { width: 36px; height: 36px; font-size: 13px; }
.risk-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 11px; font-size: 12px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.risk-pill.high { background: var(--risk-high); } .risk-pill.medium { background: var(--risk-medium); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 12px; border-radius: var(--radius-chip); background: var(--surface-sunken); font-size: 13px; }
a.chip:hover { background: var(--border); }
.level { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---- controls ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 22px; background: var(--surface); }
.seg.on-card { background: var(--surface-sunken); }
.seg button, .seg a { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: transparent; cursor: pointer; }
.seg [aria-pressed="true"], .seg a[aria-current] { background: var(--accent); color: #fff; font-weight: 500; }
.seg.on-card [aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.select { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); max-width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--ink); background: transparent; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.on-blue { background: #fff; border-color: #fff; color: var(--accent); padding: 0 8px 0 20px; }
.btn.on-blue .badge-arrow { background: var(--accent); color: #fff; }
.split-hl .btn:not(.on-blue) { border-color: rgba(255,255,255,0.75); color: #fff; }
.split-hl .btn:not(.on-blue):hover { background: rgba(255,255,255,0.14); border-color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 500; align-self: flex-start; }
.link:hover { text-decoration: underline; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 28px; padding: 6px 6px 6px 20px; }
.search input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 15px; outline-offset: 4px; }
.search button { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }

/* ---- numbered cards ---- */
.ncard { display: flex; flex-direction: column; gap: 12px; min-height: 230px; padding: 18px 20px; border: 1px solid var(--ink); border-radius: var(--radius-tile-l); transition: transform .15s ease; }
a.ncard:hover { transform: translateY(-3px); }
.ncard .top { display: flex; justify-content: space-between; align-items: flex-start; }
.ncard .no { font: 500 20px/1 var(--font-display); letter-spacing: -0.02em; }
.ncard .circle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; }
.ncard .sub { color: var(--ink-2); font-size: 13px; }
.ncard .type { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.ncard.hot { background: var(--accent); border-color: var(--accent); color: #fff; }
.ncard.hot .circle { background: #fff; color: var(--accent); }
.ncard.hot .sub, .ncard.hot .type { color: rgba(255,255,255,0.88); }
.ncard .foot { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.ncard.hot .lv-4 { background: #fff; } .ncard.hot .lv-3 { background: rgba(255,255,255,0.7); } .ncard.hot .lv-2 { background: rgba(255,255,255,0.42); } .ncard.hot .lv-1 { background: rgba(255,255,255,0.2); }

/* ---- risk callout, notes, states ---- */
.risk-soft { background: var(--risk-soft-bg); color: var(--risk-soft-text); border-radius: var(--radius-tile-l); padding: 18px 20px; }
.risk-soft .eyebrow { color: var(--risk-soft-label); }
.note { font-size: 12px; color: var(--ink-3); margin: 0; }
.empty { padding: 40px 0; text-align: center; color: var(--ink-3); }
.error { background: var(--risk-soft-bg); color: var(--risk-soft-text); border-radius: var(--radius-tile); padding: 14px 18px; }

/* ---- overview ---- */
.depth-row { display: grid; grid-template-columns: 22px 78px 28px 1fr; gap: 10px; align-items: center; }
.depth-row .n { font: 500 16px/1 var(--font-display); text-align: right; }
.periods { display: grid; grid-template-columns: 3fr 8fr 2.4fr; gap: 20px; align-items: end; }
.period { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.period .squares { gap: 5px; align-content: flex-end; min-height: 80px; }
.period .cap { padding-top: 10px; border-top: 1px solid var(--rule); }
.period.now .cap { border-top: 2px solid var(--ink); } .period.now .cap span { font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--ink-3); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { display: block; width: 10px; height: 10px; border-radius: 3px; }
.ent-row { display: grid; grid-template-columns: 110px 40px 1fr; gap: 12px; align-items: center; min-height: 44px; padding: 6px 0; border-top: var(--rule-row); }
.ent-row .n { font: 500 18px/1 var(--font-display); letter-spacing: -0.02em; }
.ent-row .marks { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; }
.dotmatrix { display: grid; grid-template-columns: repeat(19, 9px); gap: 4px; }
.dotmatrix i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.pill-note { display: flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--bg); font-size: 13px; }
