:root {
  --bg: #fbfbfa; --fg: #1d1f21; --muted: #5f6368; --line: #dadce0; --panel: #ffffff;
  --accent: #1a5fb4; --accent-fg: #ffffff; --warn: #a15c00; --bad: #b3261e; --good: #1e7b34;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* charts: one hue for magnitude, a grid one step off the surface */
  --viz-1: #2a78d6; --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-marker: #e34948; --viz-hit: rgba(42,120,214,.10);
  --tip-bg: #1d1f21; --tip-fg: #f0efec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161718; --fg: #e8eaed; --muted: #9aa0a6; --line: #3c4043; --panel: #1f2022;
    --accent: #8ab4f8; --accent-fg: #0b1a33; --warn: #f2b14c; --bad: #f28b82; --good: #81c995;
    --viz-1: #3987e5; --viz-grid: #2c2c2a; --viz-axis: #383835; --viz-marker: #e66767; --viz-hit: rgba(57,135,229,.14);
    --tip-bg: #f0efec; --tip-fg: #1d1f21;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* a class with display:flex/grid must not defeat the hidden attribute (nav, flag forms, review bar) */
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.bar { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap;
  padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a { text-decoration: none; }
nav a.active { font-weight: 600; text-decoration: underline; }
.who { margin-left: auto; color: var(--muted); font-size: .9em; display: flex; gap: .6rem; align-items: center; }
.who a.me { color: var(--muted); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 .75rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.lead { font-size: 1.05em; max-width: 60rem; margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.dim { color: var(--muted); font-weight: normal; }
.msg { min-height: 1.5em; margin: .5rem 0; }
.msg.bad { color: var(--bad); } .msg.good { color: var(--good); }
.stack { display: grid; gap: .6rem; max-width: 26rem; margin-bottom: 1rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .75rem; }
.row.tight { gap: .3rem; align-items: center; margin: 0; }
.row.between { justify-content: space-between; align-items: center; }
label { display: grid; gap: .2rem; font-size: .9em; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: .4rem .55rem; min-width: 0; }
button { font: inherit; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-fg); border-radius: 6px; padding: .4rem .8rem; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); }
button.small { padding: .2rem .6rem; font-size: .9em; }
button.tiny { padding: 0 .4rem; font-size: .8em; border-color: var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1rem; margin-bottom: 1rem; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9em; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line);
  vertical-align: top; }
table.compact th, table.compact td { padding: .2rem .45rem; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
th.num, td.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--fg); }
tr.click { cursor: pointer; } tr.click:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
code, .mono { font-family: var(--mono); font-size: .88em; }
code.small { font-size: .8em; overflow-wrap: anywhere; }
.codeline code { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .8em;
  border: 1px solid var(--line); white-space: nowrap; }
.pill.unreviewed { color: var(--warn); border-color: var(--warn); }
.pill.verified { color: var(--good); border-color: var(--good); }
.pill.state { color: var(--accent); border-color: var(--accent); }
.caveat { border-left: 3px solid var(--warn); padding: .3rem .7rem; color: var(--muted); font-size: .92em; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.val .unit { color: var(--muted); font-size: .9em; }
.val .vc { color: var(--warn); font-size: .8em; }
.val.raw { color: var(--muted); font-style: italic; }
@media (max-width: 640px) { .who { margin-left: 0; width: 100%; } dl.kv { grid-template-columns: 1fr; } }
ol.steps { padding-left: 1.3rem; } ol.steps li { margin-bottom: .6rem; }
.cmd { display: flex; gap: .5rem; align-items: stretch; margin-top: .35rem; max-width: 100%; }
.cmd pre { flex: 1; min-width: 0; margin: 0; padding: .45rem .6rem; overflow-x: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.cmd button.copy { flex: none; }
blockquote.prompt { margin: .5rem 0; padding: .5rem .8rem; border-left: 3px solid var(--accent);
  background: var(--bg); border-radius: 0 6px 6px 0; }

/* navigation furniture */
.crumbs { color: var(--muted); font-size: .9em; margin: 0 0 .25rem; }
.crumbs a { text-decoration: none; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; padding: .7rem .9rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1rem; }
.filters label { font-size: .85em; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.chip { display: inline-block; padding: .05rem .55rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .85em; text-decoration: none; color: var(--fg); background: var(--panel); white-space: nowrap; }
a.chip:hover { border-color: var(--accent); }
.chips.small .chip { font-size: .78em; }
.toc { color: var(--muted); }
section.about { max-width: 62rem; scroll-margin-top: 4rem; } section.about h2 { margin-top: 2rem; }
h1, h2, h3 { scroll-margin-top: 4rem; }

/* home */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .75rem .9rem; text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--accent); }
.tile-value { font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.tile-label { color: var(--muted); margin-top: .15rem; }
.tile-sub { color: var(--muted); font-size: .82em; margin-top: .25rem; }
.starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.start { display: grid; gap: .25rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); text-decoration: none; color: inherit; }
.start:hover { border-color: var(--accent); }
.start span { color: var(--muted); font-size: .9em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1rem; align-items: start; }
.grid2 > .panel { margin-bottom: 0; }

/* charts */
.viz-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem .5rem; min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.viz-head h3 { margin: 0 0 .4rem; font-size: .95rem; }
svg.viz { display: block; max-width: 100%; height: auto; font: 12px system-ui, sans-serif; overflow: visible; }
svg.viz-heat { height: auto; }
.viz-bar, .viz-cell { fill: var(--viz-1); transition: filter .1s; }
.viz-row:hover .viz-bar, .viz-col:hover .viz-bar, .viz-cell:hover { filter: brightness(1.15); }
.viz-cell-empty { fill: var(--viz-grid); fill-opacity: 1 !important; }
.viz-hit { fill: transparent; }
.viz-row:hover .viz-hit, .viz-col:hover .viz-hit { fill: var(--viz-hit); }
.viz-click { cursor: pointer; }
.viz-label { fill: var(--fg); font-size: 12px; }
.viz-value, .viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1; }
.viz-marker { stroke: var(--viz-marker); stroke-width: 2; stroke-linecap: round; }
.viz-tip { position: absolute; z-index: 20; background: var(--tip-bg); color: var(--tip-fg); padding: .35rem .6rem;
  border-radius: 6px; font-size: .85em; pointer-events: none; max-width: 22rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.viz-tip strong { font-weight: 600; } .viz-tip span { opacity: .8; }
.viz-table { margin-top: .3rem; } .viz-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
svg.structure { color: var(--fg); display: block; max-width: 100%; height: auto; }

/* units panel */
.units-panel { position: fixed; right: 1rem; top: 3.2rem; z-index: 10; width: min(34rem, calc(100vw - 2rem));
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem .9rem; }
.units-badge.on { display: inline-block; background: var(--accent); color: var(--accent-fg); border-radius: 999px; padding: 0 .4rem; font-size: .8em; margin-left: .2rem; }

/* polymers */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: inherit; overflow: hidden; }
.card:hover { border-color: var(--accent); }
.thumb { height: 7rem; display: flex; align-items: center; justify-content: center; background: var(--bg); border-bottom: 1px solid var(--line); color: var(--fg); }
.thumb.none { color: var(--muted); font-size: .85em; }
.card-body { padding: .6rem .8rem; display: grid; gap: .2rem; align-content: start; }
.structure-block { display: grid; gap: .6rem; }
.propblock { margin-bottom: .6rem; } .propblock h3 { margin: .9rem 0 .3rem; }
.facts dl.kv { grid-template-columns: max-content minmax(0, 1fr); }

/* compare */
.verdict .big { font-size: 1.1em; }
.verdict.good { border-left: 4px solid var(--good); } .verdict.warn { border-left: 4px solid var(--warn); } .verdict.bad { border-left: 4px solid var(--bad); }

/* curation */
.pill.flag { color: var(--warn); border-color: var(--warn); }
.pill.flag.hi { background: var(--warn); color: var(--panel); }
.flagwrap { display: inline-flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.flagform { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
label.inline { display: inline-flex; align-items: center; gap: .3rem; }
.tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .4rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; margin-bottom: -1px; padding: .4rem .8rem; font: inherit; cursor: pointer; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
button.verdict { border-color: var(--line); color: var(--fg); }
button.verdict.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.verdict.confirmed.on { background: var(--good); border-color: var(--good); color: #fff; }
button.verdict.rejected.on { background: var(--bad); border-color: var(--bad); color: #fff; }
button.verdict.corrected.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.verdictcell { display: inline-flex; gap: .15rem; white-space: nowrap; }
.reviewbar { position: sticky; top: 3rem; z-index: 4; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .5rem .8rem; margin-bottom: .6rem;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.panel.review { border-left: 4px solid var(--accent); }
.corrbox { padding: .5rem .7rem; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: .6rem; }
a.button { display: inline-block; text-decoration: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); border-radius: 6px; padding: .4rem .8rem; }
a.button.ghost { background: transparent; color: var(--accent); }
a.button.small { padding: .2rem .6rem; font-size: .9em; }
.nosmiles { color: var(--bad); text-decoration: underline dotted; }
.pill.src { font-size: .72em; color: var(--muted); }
.pill.src.figure_digitized, .pill.src.figure_label { color: var(--accent); border-color: var(--accent); }
.pill.src.secondary { color: var(--warn); border-color: var(--warn); }
