/* Palette: huashu "paper" (light) and "ink" (dark); chart ramps from the dataviz reference palette. */
:root {
  color-scheme: light;
  --bg: #F3EDE2;
  --surface: #FBF8F2;
  --ink: #1B1A17;
  --sub: #6B655B;
  --muted: #8E877B;
  --line: #E2DACB;
  --accent: #C8402F;
  --accent2: #2F5D62;
  --map-sea: #E7DFD0;
  --map-land: #F7F2E8;
  --map-edge: #FBF8F2;
  --state-edge: #2B2722;  /* state boundaries: bold ink on a paper halo, readable over any fill */
  --state-halo: #FBF8F2;
  --nodata: #DCD4C5;
  --hover: #1B1A17;
  --seq: #cde2fb, #9ec5f4, #6da7ec, #3987e5, #256abf, #184f95, #0d366b;
  /* diverging (compare: swing, margin change): red loss, gray no change, blue gain */
  --div: #a32b2b, #d65a58, #f0aaa7, #f0efec, #9ec5f4, #3987e5, #184f95;
  --matrix: #3987e5;
  --net: rgba(27, 26, 23, .09);
  --net-node: rgba(27, 26, 23, .2);
  --cat-gen: #D8CFBF;
  --cat-sc: #eb6834;
  --cat-st: #1baf7a;
  --cat-bl: #eda100;
  --woman: #C8402F;
  --woman-tint: #EBC3B3;
  --shadow: 0 1px 2px rgba(27, 26, 23, .06), 0 8px 24px rgba(27, 26, 23, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121417; --surface: #1E2226; --ink: #F2EFE8; --sub: #A39E93; --muted: #7D786F; --line: #2C3136;
    --accent: #F2B33D; --accent2: #5FB3A1;
    --map-sea: #0E1012; --map-land: #1A1D21; --map-edge: #121417; --state-edge: #ECE7DC; --state-halo: #0E1012; --nodata: #2A2E33; --hover: #F2EFE8;
    --seq: #104281, #184f95, #256abf, #3987e5, #6da7ec, #9ec5f4, #cde2fb;
    --div: #e66767, #a84443, #5c2b2b, #383835, #1d3a63, #2a6bc0, #5598e7;
    --net: rgba(242, 239, 232, .08); --net-node: rgba(242, 239, 232, .2);
    --cat-gen: #3A3F45; --cat-sc: #d95926; --cat-st: #199e70; --cat-bl: #c98500;
    --woman: #F2B33D; --woman-tint: #6B5A33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417; --surface: #1E2226; --ink: #F2EFE8; --sub: #A39E93; --muted: #7D786F; --line: #2C3136;
  --accent: #F2B33D; --accent2: #5FB3A1;
  --map-sea: #0E1012; --map-land: #1A1D21; --map-edge: #121417; --state-edge: #ECE7DC; --state-halo: #0E1012; --nodata: #2A2E33; --hover: #F2EFE8;
  --seq: #104281, #184f95, #256abf, #3987e5, #6da7ec, #9ec5f4, #cde2fb;
  --div: #e66767, #a84443, #5c2b2b, #383835, #1d3a63, #2a6bc0, #5598e7;
  --net: rgba(242, 239, 232, .08); --net-node: rgba(242, 239, 232, .2);
  --cat-gen: #3A3F45; --cat-sc: #d95926; --cat-st: #199e70; --cat-bl: #c98500;
  --woman: #F2B33D; --woman-tint: #6B5A33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.app { display: grid; grid-template-rows: auto 1fr; height: 100%; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand .sub { margin: 2px 0 0; color: var(--sub); font-size: 12px; }
/* filters cascade: type -> year -> state; the colour-by row and search act on the chosen view */
/* row 1: name + filters; row 2: colour-by + search (the filters choose the view, the rest acts on it) */
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.metricrow { order: 3; display: flex; align-items: center; gap: 10px; min-width: 0; }
.tools { order: 4; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rowlabel { font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 3px; color: var(--sub); font-size: 11.5px; }
.field b { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 3px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 650; }
select, input[type="search"] {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 0 10px; color: var(--ink);
}
select { cursor: pointer; }
#f-type { width: 150px; }
#f-year { width: 132px; }
#f-state { width: 190px; }
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.chip {
  border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--sub);
  font-size: 12.5px; transition: background-color .2s, color .2s;
}
.chip:hover { color: var(--ink); }
.chip[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.search { position: relative; }
.search input { width: 270px; }
.tools .results { width: 380px; max-height: 70vh; }
.results {
  position: absolute; z-index: 20; top: 40px; right: 0; width: 320px; max-height: 360px; overflow: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.results li { padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.results li[aria-selected="true"], .results li:hover { background: var(--bg); }
.results small { display: block; color: var(--sub); font-size: 12px; }
.results .dot { margin-right: 6px; }
.results .full { color: var(--sub); }
.results li.grp { cursor: default; padding: 8px 10px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.results li.empty { cursor: default; color: var(--sub); font-size: 12.5px; }
.results li.grp:hover, .results li.empty:hover { background: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  display: grid; place-items: center; color: var(--sub);
}

/* body */
.body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.map-wrap { position: relative; min-height: 0; background: var(--map-sea); }
#map { position: absolute; inset: 0; }
.maplibregl-canvas { outline: none; }
.loading {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px;
  background: var(--surface); color: var(--sub); font-size: 12px; box-shadow: var(--shadow); transition: opacity .3s;
}
.loading.done { opacity: 0; pointer-events: none; }
.tip {
  position: absolute; z-index: 10; pointer-events: none; min-width: 200px; max-width: 280px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px;
  transition: opacity .12s;
}
.tip h4 { margin: 0 0 2px; font-size: 13.5px; }
.tip .meta { color: var(--sub); font-size: 11.5px; margin-bottom: 6px; }
.tip .row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.tip .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 5; max-width: min(420px, calc(100% - 28px)); padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px;
}
.legend h5 { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; color: var(--sub); }
.legend .items { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .ramp { height: 10px; border-radius: 3px; width: 260px; max-width: 100%; }
.legend .ticks { display: flex; justify-content: space-between; width: 260px; max-width: 100%; color: var(--sub); font-variant-numeric: tabular-nums; margin-top: 3px; }
.mapnote {
  position: absolute; right: 14px; top: 14px; z-index: 5; max-width: 320px; padding: 9px 12px; font-size: 12px; color: var(--sub);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; box-shadow: var(--shadow);
}
.reset {
  position: absolute; left: 14px; top: 14px; z-index: 5; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-size: 12.5px;
}

/* panel */
.panel { overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: 18px 20px 28px; }
.panel h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.panel h3 { margin: 22px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); font-weight: 600; }
.lede { color: var(--sub); margin: 4px 0 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tally { position: relative; margin-top: 14px; }
.tally .bar { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; }
.tally .seg { height: 100%; width: 0; transition: width .7s cubic-bezier(.37, 0, .63, 1); }
.tally .maj { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--ink); opacity: .55; }
.tally .majlabel { margin-top: 6px; font-size: 11.5px; color: var(--sub); }
table.parties { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; table-layout: fixed; }
.parties col.c-seats { width: 42px; }
.parties col.c-share { width: 52px; }
.parties col.c-bar { width: 64px; }
.parties td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.parties tr { cursor: pointer; transition: opacity .25s, background-color .2s; }
.parties tr:hover td { background: var(--bg); }
.parties tr.dimmed { opacity: .38; }
.parties tr.focused td { background: var(--bg); }
.parties .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.parties .name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parties .full { color: var(--sub); font-size: 11.5px; }
.parties .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.parties .share { padding-left: 10px; }
.minibar { height: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.minibar i { display: block; height: 100%; width: 0; border-radius: 2px; transition: width .7s cubic-bezier(.37, 0, .63, 1); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.tile { padding: 10px 12px; border-radius: 10px; background: var(--bg); min-width: 0; }
.tile .k { font-size: 11.5px; color: var(--sub); }
.tile .v { font-size: 18px; font-weight: 650; margin-top: 2px; }
.tile .s { font-size: 11.5px; color: var(--sub); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.link { cursor: pointer; }
.tile.link:hover { outline: 1px solid var(--line); }
.listtools { display: flex; gap: 8px; }
.listtools input { flex: 1; min-width: 0; }
.listtools select { min-width: 0; width: 140px; }
.seats { list-style: none; margin: 8px 0 0; padding: 0; }
.seats li button {
  width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 7px 4px; cursor: pointer;
}
.seats li button:hover { background: var(--bg); }
.seats .no { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.seats .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seats .nm small { color: var(--sub); }
.seats .rt { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sub); }
.more { margin-top: 8px; width: 100%; padding: 7px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; color: var(--sub); }
.notes { margin-top: 22px; font-size: 12px; color: var(--sub); }
.notes p { margin: 6px 0; }

/* detail */
.back { border: 0; background: transparent; color: var(--sub); padding: 0; cursor: pointer; font-size: 12.5px; }
.back:hover { color: var(--ink); }
.kicker { margin-top: 10px; color: var(--sub); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--sub); }
.winner { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bg); display: grid; gap: 4px; }
.winner .who { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.winner .how { color: var(--sub); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.facts .tile .v { font-size: 15px; }
.cands { list-style: none; margin: 0; padding: 0; }
.cands li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.cands .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cands .who { min-width: 0; }
.cands .who b { font-weight: 600; }
.cands .who small { color: var(--sub); display: block; }
.cands .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.cands .n small { display: block; color: var(--sub); }
.cands .bar { margin-top: 5px; height: 8px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cands .bar i { display: block; height: 100%; width: 0; border-radius: 2px 4px 4px 2px; transition: width .7s cubic-bezier(.37, 0, .63, 1); }
.cands li.nota { color: var(--sub); }
.warn { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg); color: var(--sub); font-size: 12px; border-left: 3px solid var(--accent); }

@media (max-width: 900px) {
  .topbar { padding: 10px 16px; gap: 8px; }
  .brand .sub { display: none; }
  .filters { width: 100%; display: grid; grid-template-columns: 1.1fr .9fr 1.2fr; gap: 6px; }
  .field { min-width: 0; font-size: 10.5px; }
  .field select { width: 100%; min-width: 0; padding: 0 6px; }
  .tools { width: 100%; margin-left: 0; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .results { width: 100%; }
  .tools .results { width: 100%; }
  .modes { width: 100%; }
  .modes button { flex: 1; padding: 5px 4px; font-size: 12.5px; }
  .home { align-items: start; padding-top: 12vh; }
  .metricrow .rowlabel { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .chip { white-space: nowrap; }
  .body { grid-template-columns: 1fr; grid-template-rows: 58vh auto; overflow-y: auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 16px; }
  .legend { left: 8px; right: 52px; bottom: 8px; max-width: none; padding: 8px 10px; font-size: 11px; }
  .legend .ramp, .legend .ticks { width: 100%; }
  .mapnote { left: 8px; right: 8px; top: 8px; max-width: none; }
  .reset { top: auto; bottom: calc(100% - 52px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; }
  .brain .nodes .pulse { animation: none; }
}

/* ---------- views: home, modes, seat history, compare, party, export ---------- */
.homelink { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.homelink:hover h1 { color: var(--accent2); }
.modes { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.modes button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--sub); font-size: 13px; white-space: nowrap; }
.modes button:hover { color: var(--ink); }
.modes button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
body:not([data-mode="map"]) .filters { display: none; }
body.at-home { overflow: hidden; }

.link { border: 0; background: none; padding: 0; color: var(--accent2); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.link:hover { color: var(--ink); }
button.tile { border: 0; font: inherit; color: inherit; text-align: left; width: 100%; }
.filters2 { margin-top: 6px; }
.filters2 select { flex: 1; width: auto; }
.count { margin: 6px 0 0; font-size: 12px; color: var(--sub); }
.count:empty { display: none; }
.h3note { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.actions { margin: 10px 0 0; }
.related { margin: 6px 0 0; font-size: 13px; color: var(--sub); }
.panel h2 .full { font-size: 14px; font-weight: 400; color: var(--sub); }
.pickers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pickers .field { flex: 1; min-width: 120px; }
.pickers select { width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; color: var(--sub); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#view { position: relative; }

.exportbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.exportbar button { border: 1px solid var(--line); background: var(--bg); border-radius: 7px; padding: 3px 9px; font-size: 12px; color: var(--sub); cursor: pointer; }
.exportbar button:hover { color: var(--ink); border-color: var(--muted); }
.exportbar button[hidden] { display: none; }
.xmsg { font-size: 12px; color: var(--sub); }
.xlink { flex-basis: 100%; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 0 8px; color: var(--ink); font-size: 12px; }

/* seat history */
.history { list-style: none; margin: 0; padding: 0; }
.hrow { border-bottom: 1px solid var(--line); padding: 8px 0; }
.hrow.hl { box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.hhead { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; align-items: start; color: inherit; }
.hhead:hover .hw b { text-decoration: underline; text-underline-offset: 2px; }
.hhead.static { cursor: default; }
.hhead.static:hover .hw b { text-decoration: none; }
.hy { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.hrow.bye .hy { color: var(--sub); font-weight: 500; }
.hw { display: block; min-width: 0; }
.hw .dot { margin-right: 6px; vertical-align: -1px; }
.hw small { display: block; color: var(--sub); font-size: 12px; }
.sharebar { display: flex; gap: 2px; height: 8px; margin: 6px 0 0 74px; }
.sharebar i { display: block; height: 100%; min-width: 1px; }
.sharebar i:first-child { border-radius: 2px 0 0 2px; }
.sharebar i:last-child { border-radius: 0 2px 2px 0; }
.hmeta { margin: 4px 0 0 74px; font-size: 11.5px; color: var(--sub); }
.was { color: var(--muted); }
.hbody { margin: 8px 0 4px 74px; }
.era { list-style: none; margin: 10px 0; padding: 6px 10px; font-size: 12px; color: var(--sub); background: var(--bg); border-radius: 8px; border-left: 3px solid var(--accent); }
.era.light { border-left-color: var(--line); }

/* compare */
.parties th { font-size: 11px; color: var(--muted); font-weight: 500; text-align: left; padding: 4px; }
.parties th.num { text-align: right; }
.cmp col.c-n { width: 38px; }
.cmp col.c-p { width: 54px; }
.matrix { border-collapse: separate; border-spacing: 2px; font-size: 12px; width: 100%; table-layout: fixed; }
.matrix th { font-weight: 500; color: var(--sub); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 3px; }
.matrix th .dot { margin-right: 4px; }
.matrix thead th { font-size: 11px; }
.matrix td { text-align: center; padding: 5px 0; border-radius: 4px; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--matrix) calc(var(--a, 0) * 100%), transparent); }
.flips li { display: flex; align-items: center; }
.flips li > button[data-k] { flex: 1; min-width: 0; }
.seats li button.hist { width: auto; display: inline; border: 0; padding: 0 4px 0 8px; font-size: 11.5px; grid-template-columns: none; }
.unpaired { margin-top: 14px; font-size: 12.5px; color: var(--sub); }
.unpaired summary { cursor: pointer; }

/* party */
.charts { display: grid; gap: 4px; }
.charts figure { margin: 0; }
.charts figcaption { font-size: 12px; color: var(--sub); margin: 4px 0 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .dlabel { fill: var(--ink); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--ink); fill-opacity: .05; }
.ctip { position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 6px 9px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 12px; }
.ptab tr { cursor: default; }
.ptab tr[data-state] { cursor: pointer; }
.ptab td { padding: 4px; }

/* home */
.home {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: auto; padding: 24px 16px;
  background: radial-gradient(ellipse at 50% 42%, var(--surface) 0%, var(--bg) 72%);
}
.home[hidden] { display: none; }
.home-art { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.brain { width: min(1100px, 135vw); height: auto; }
.brain .links line { stroke: var(--net); stroke-width: 1; }
.brain .folds path { fill: none; stroke: var(--net); stroke-width: 2.5; stroke-linecap: round; opacity: .55; }
.brain .nodes circle { fill: var(--net-node); }
.brain .nodes .pulse { fill: var(--accent); opacity: .2; animation: pulse 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: .12; transform: scale(1); } 50% { opacity: .5; transform: scale(1.7); } }
.home-inner { position: relative; width: min(680px, 100%); text-align: center; }
.home h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.02em; margin: 0; font-weight: 680; }
.home-sub { color: var(--sub); margin: 10px auto 22px; max-width: 540px; font-size: 15px; }
.prompt { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px 6px 6px 16px; }
.prompt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.prompt input[type="search"] { flex: 1; min-width: 0; width: auto; border: 0; background: transparent; height: 44px; font-size: 16px; padding: 0; }
.prompt input:focus-visible { outline: none; }
.go { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--ink); color: var(--surface); cursor: pointer; display: grid; place-items: center; }
.prompt .results { left: 0; right: 0; top: calc(100% + 6px); width: auto; text-align: left; max-height: 52vh; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.example { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--sub); }
.example:hover { color: var(--ink); border-color: var(--muted); }
.browse { margin: 22px 0 0; color: var(--sub); font-size: 13px; }
.status { margin: 8px 0 0; color: var(--muted); font-size: 12px; min-height: 1.4em; }
