/* Metric Lab. Same look as parsebench.ai: white page, hairlines, square corners, black controls,
   one azure accent, IBM Plex Mono for labels and numbers' headers. Light theme only, like the site. */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f5; --line: #e7e7e7; --line-soft: #f0f0f0;
  --ink: #000000; --ink-2: #404040; --ink-3: #737373;
  --accent: #0077c7; --accent-soft: #f2f8fc;
  --up: #0077c7; --up-soft: #e6f1f9; --down: #c26200; --down-soft: #fdf0e0;
  --crit: #b3261e; --maj: #c26200; --min: #737373; --ign: #a3a3a3;
  --changed: #fff8dc;
  --sans: "Overused Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --nav-h: 0px; /* the site copy sets this to the height of its fixed navbar */
  color-scheme: light;
}
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

* { box-sizing: border-box; }
html { font-size: 14px; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; padding-top: var(--nav-h); background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap, .top, .layout, .loading, .error { max-width: 1648px; margin-inline: auto; }

/* page header: eyebrow, large title, one-paragraph summary, policy state and reset on the right */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 48px 24px 28px; flex-wrap: wrap; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
h1 { font-size: 2.6rem; line-height: 1.05; margin: 0; font-weight: 500; letter-spacing: -0.03em; }
h1 span { color: var(--ink-3); }
h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; font-weight: 500; color: var(--ink); }
.sub { margin: 14px 0 0; color: var(--ink-2); max-width: 68ch; font-size: 1.07rem; line-height: 1.55; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.state { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.state.changed { color: var(--accent); }
#theme { display: none; }

button, input[type="search"], input[type="number"] { font: inherit; color: inherit; border-radius: 0; }
button { background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--surface-2); }
button:disabled { opacity: 0.4; cursor: default; }
/* the site's button: square, mono, uppercase; black once there is something to reset */
#reset { height: 34px; padding: 0 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
#reset:not(:disabled) { background: #000; border-color: #000; color: #f5f5f5; }
#reset:not(:disabled):hover { background: var(--accent); border-color: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.loading, .error { padding: 40px 24px; color: var(--ink-2); }
.error { color: var(--crit); white-space: pre-wrap; }
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; padding: 0 24px 80px; align-items: start; }
/* the controls stay in view while the tables scroll; one hairline frame, sections split by hairlines */
.side { display: grid; position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow: auto; border: 1px solid var(--line); }
.side .card { border: 0; border-bottom: 1px solid var(--line); }
.side .card:last-child { border-bottom: 0; }
main { display: grid; gap: 24px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.hint, .foot { color: var(--ink-3); font-size: 0.9rem; margin: 8px 0 14px; line-height: 1.5; }
.foot { margin: 12px 0 0; }
.note { background: var(--surface-2); padding: 10px 12px; margin: 0 0 10px; color: var(--ink-2); font-size: 0.92rem; }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; font-family: var(--mono); color: var(--ink-3); font-size: 1.1rem; line-height: 1; }
details[open] > summary::after { content: "−"; }
.notes { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.92rem; }
.notes li { margin-bottom: 6px; }

/* sliders */
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin-bottom: 14px; }
.ctl:last-child { margin-bottom: 0; }
.ctl label { font-size: 0.95rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ctl .paper { color: var(--ink-3); font-size: 0.82rem; }
.ctl input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: #000; margin: 0; }
.ctl input[type="number"] { width: 72px; text-align: right; background: var(--surface); border: 1px solid var(--line); padding: 3px 6px; font-family: var(--mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ctl.changed input[type="number"] { background: var(--changed); border-color: #e6d58a; }
.ctl.changed input[type="range"] { accent-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.c0 { background: var(--crit); } .dot.c1 { background: var(--maj); } .dot.c2 { background: var(--min); } .dot.c3 { background: transparent; border: 1.5px solid var(--ign); }

/* summary tiles: one hairline grid, as the site's fact rows */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--surface); padding: 14px 18px; min-width: 0; }
.tile .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tile .v { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.tile .d { color: var(--ink-2); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tabs: the site's segmented control */
.tabs { display: inline-flex; border: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; height: 32px; padding: 0 14px; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: #000; color: #f5f5f5; }
#kind-search { margin-left: auto; background: var(--surface); border: 1px solid var(--line); height: 34px; padding: 0 10px; width: 200px; }
#kind-search::placeholder { color: var(--ink-3); }

/* tables */
.scroll { overflow-x: auto; margin-inline: -20px; padding-inline: 20px; }
table.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.grid th { text-align: right; font-family: var(--mono); font-weight: 400; color: var(--ink-3); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.grid th.l, .grid td.l { text-align: left; }
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { color: var(--ink-2); }
.grid th .arrow { display: inline-block; width: 0.9em; color: var(--ink); }
.grid th small { font-weight: 400; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.grid td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.grid tbody tr:last-child td { border-bottom: 0; }
#board tbody tr { cursor: pointer; }
#board tbody tr:hover td { background: #fafafa; }
#board tbody tr.sel td { background: var(--accent-soft); }
#board tbody tr.sel td.name { box-shadow: inset 2px 0 0 var(--accent); }
td.name { text-align: left; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
td.name small { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
td.rank { color: var(--ink-3); width: 2.5em; font-size: 12px; }
.score { display: inline-block; min-width: 2.4em; }
.delta { display: inline-block; min-width: 3.3em; font-size: 11.5px; margin-left: 4px; padding: 1px 4px; color: var(--ink-3); }
.delta.up { background: var(--up-soft); color: var(--up); }
.delta.down { background: var(--down-soft); color: var(--down); }
.move { display: inline-block; min-width: 2.6em; font-size: 12px; color: var(--ink-3); }
.move.up { color: var(--up); font-weight: 500; } .move.down { color: var(--down); font-weight: 500; }
td.overall .score { font-weight: 500; color: var(--ink); }
.na { color: var(--ink-3); }

/* error types */
#kinds td.kind { text-align: left; white-space: normal; min-width: 220px; font-family: var(--sans); font-size: 14px; color: var(--ink); }
#kinds td.kind small { color: var(--ink-3); display: block; font-size: 12px; }
#kinds tr.changed td { background: var(--changed); }
.seg { display: inline-flex; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 4px 9px; font-family: var(--sans); font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: #000; color: #f5f5f5; font-weight: 500; }
.seg button.paper:not([aria-pressed="true"]) { text-decoration: underline dotted; text-underline-offset: 3px; }
.cost { display: inline-grid; grid-template-columns: 80px 3.8em; gap: 8px; align-items: center; }
.bar { height: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: #000; }
.bar.paper i { background: var(--ink-3); }

.check { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; margin-top: 10px; }
.check th, .check td { text-align: right; padding: 4px 4px; border-bottom: 1px solid var(--line-soft); }
.check th:first-child, .check td:first-child { text-align: left; }
.check th { color: var(--ink-3); font-weight: 400; }
.ok { color: var(--up); font-weight: 500; } .bad { color: var(--crit); font-weight: 500; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 2.1rem; }
}
@media (max-width: 640px) {
  .top { padding: 32px 16px 20px; }
  .layout { padding: 0 16px 56px; }
  .tiles { grid-template-columns: 1fr; }
  #kind-search { margin-left: 0; width: 100%; }
}

/* profiles: one click sets a whole policy */
.foot.inline { margin: 0; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.profiles button { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: 12px 14px; text-align: left; display: grid; gap: 4px; align-content: start; min-height: 86px; }
.profiles button b { font-weight: 500; font-size: 14px; }
.profiles button span { color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.profiles button:hover { background: var(--surface-2); }
.profiles button[aria-pressed="true"] { background: #000; color: #f5f5f5; }
.profiles button[aria-pressed="true"] span { color: #c9c9c9; }
.profiles button.edited { box-shadow: inset 0 -2px 0 var(--accent); }
.profile-detail { margin-top: 14px; font-size: 0.93rem; color: var(--ink-2); }
.profile-detail b { color: var(--ink); font-weight: 500; }
.profile-detail ul { margin: 6px 0 0; padding-left: 18px; }
.profile-detail li { margin-bottom: 3px; }
.profile-detail p { margin: 6px 0 0; }
.grid th small.wt { color: var(--accent); font-weight: 500; }
