/* Light theme only. Content wraps at spaces and never truncates. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #141a24;
  --ink-2: #4a5568;
  --ink-3: #6b7484;
  --line: #e2e6ec;
  --line-2: #cfd5de;
  --accent: #1f3a8a;
  --accent-2: #2f55c8;
  --accent-soft: #eaf0fd;
  --hit: #b42318;
  --hit-soft: #fdeceb;
  --ok: #157347;
  --ok-soft: #e6f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans);
  overflow-wrap: break-word;
}
a { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .6em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }

/* header + tabs */
.top { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { color: var(--accent); display: inline-flex; flex: none; }
.brand-t { font-weight: 650; font-size: 1rem; min-width: 0; }
.tabs { display: flex; gap: 4px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 8px 12px; text-decoration: none; color: var(--ink-2); font-weight: 550;
  border-bottom: 2px solid transparent; white-space: nowrap; font-size: .92rem;
}
.tabs a[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 8px; }
.tab > * + * { margin-top: 14px; }
.lede { color: var(--ink-2); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* metrics */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.metric b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.metric span { color: var(--ink-3); font-size: .82rem; }

/* controls */
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.lbl { font-size: .78rem; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2);
  border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .84rem; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); border-radius: 8px;
  padding: 7px 12px; font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--hit); }
.btn:disabled { opacity: .55; cursor: default; }
input[type=text], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

/* tables: capped height, sticky header, sticky first column */
.tablewrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88rem; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; background: var(--panel); }
table.t thead th {
  position: sticky; top: 0; z-index: 2; background: #f0f2f6; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-2); word-break: keep-all; white-space: nowrap;
}
table.t .pin { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line), 4px 0 6px -4px rgba(20, 26, 36, .18); }
table.t thead th.pin { z-index: 3; }
table.t tbody tr:hover td { background: #f7f9fd; }
table.t tbody tr.sel td { background: var(--accent-soft); }
table.req { min-width: 1260px; table-layout: fixed; }
table.req col.c-pin { width: 230px; }
@media (max-width: 640px) { table.req col.c-pin { width: 160px; } table.req { min-width: 1150px; } }
@media (max-width: 860px) { .rm .rm-list { order: -1; } }
.rid { font-family: var(--mono); font-size: .8rem; font-weight: 650; color: var(--accent); }
.jur { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #eef1f6; color: var(--ink-2); letter-spacing: .03em; white-space: nowrap; }
.tag { display: inline-block; font-size: .74rem; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin: 0 4px 4px 0; }
.quote { border-left: 3px solid var(--line-2); padding-left: 8px; color: var(--ink-2); font-style: italic; margin-top: 6px; }
.verified { color: var(--ok); font-size: .76rem; font-weight: 600; white-space: nowrap; }

/* matrix */
table.mx { min-width: 900px; }
table.mx td, table.mx th { text-align: center; }
table.mx td.pin, table.mx th.pin { text-align: left; }
table.mx thead th { white-space: normal; word-break: keep-all; min-width: 72px; font-size: .7rem; padding: 8px 5px; }
table.mx td { padding: 8px 5px; }
.cell { display: inline-block; min-width: 34px; padding: 3px 6px; border-radius: 6px; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; border: 0; font: inherit; font-size: .9rem; }
.cell.c0 { background: var(--warn-soft); color: var(--warn); }
.cell.c1 { background: #e3eafc; color: var(--accent); }
.cell.c2 { background: #c9d7f8; color: var(--accent); }
.cell.c3 { background: var(--accent); color: #fff; }

/* status pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.hit { background: var(--hit-soft); color: var(--hit); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.fail { background: var(--warn-soft); color: var(--warn); }
.pill.na { background: #eef1f6; color: var(--ink-3); }
.pill.run { background: var(--accent-soft); color: var(--accent); }

/* verdict banner */
.verdict { border-radius: 10px; padding: 14px; border: 1px solid; }
.verdict.hit { background: var(--hit-soft); border-color: #f3b8b3; }
.verdict.ok { background: var(--ok-soft); border-color: #b7dfc7; }
.verdict.fail { background: var(--warn-soft); border-color: #f1d29a; }
.verdict h2 { margin: 0 0 4px; }

/* roadmap */
.rank { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px; gap: 12px; align-items: start; }
.item .pos { font-size: 1.3rem; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.item .score { text-align: right; }
.item .score span { display: block; }
.item .score b { font-size: 1.25rem; font-variant-numeric: tabular-nums; display: block; }
.item h3 { margin: 0 0 4px; }
.item dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 10px; margin: 8px 0 0; font-size: .88rem; }
.item dt { color: var(--ink-3); font-weight: 600; }
.item dd { margin: 0; min-width: 0; }
.calc { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); background: #f3f5f9; border-radius: 6px; padding: 4px 8px; display: inline-block; margin-top: 6px; }
.illus { font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.formula { font-family: var(--mono); font-size: .86rem; background: #f3f5f9; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.picker { max-height: 260px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px; background: #fff; }
.picker label { display: flex; gap: 8px; align-items: flex-start; padding: 4px; font-size: .85rem; border-radius: 6px; }
.picker label:hover { background: #f4f6fa; }
.picker input { margin-top: 3px; flex: none; }
.picker label > span { min-width: 0; }
@media (max-width: 640px) {
  .item { grid-template-columns: auto minmax(0, 1fr); }
  .item > div:nth-child(2) { grid-column: 1 / -1; order: 2; }
  .item .score { text-align: right; }
  .item dl { grid-template-columns: minmax(0, 1fr); }
  .item dt { margin-top: 4px; }
}

/* screening */
.addr { font-family: var(--mono); font-size: .9rem; overflow-wrap: break-word; }
.srcrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.srcrow:last-child { border-bottom: 0; }
.srcrow .d { color: var(--ink-3); font-size: .84rem; }

.foot { max-width: 1240px; margin: 20px auto 0; padding: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .84rem; }
.foot p { margin: 0 0 4px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: .88rem; z-index: 100; }
details summary { cursor: pointer; color: var(--accent-2); font-size: .85rem; }
