/* Vote Right — editorial system
   Ink on paper, one ochre accent. Party colours appear only as data swatches. */

:root {
  --ink: #17222e;
  --ink-soft: #46525f;
  --paper: #f7f4ee;
  --paper-deep: #efeadf;
  --rule: #d9d2c4;
  --accent: #8f650b;        /* ochre, AA on paper */
  --accent-bright: #b07c10;
  --band: #e4d9bd;          /* uncertainty band fill */
  --p-con: #0f6cbd; --p-ref: #0e9aad; --p-lab: #c9114f;
  --p-ld: #c77d00; --p-green: #1e7d43; --p-snp: #b39b00;
  --p-pc: #0a5a52; --p-other: #6b7280;
  --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }

/* masthead */
header.site { border-bottom: 2px solid var(--ink); }
header.site .wrap { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.1rem; padding-bottom: .8rem; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 3.25rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; line-height: 1; }
.wordmark .tick { color: var(--accent-bright); }
nav.site a { font-family: var(--sans); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; margin-left: 1rem; }
nav.site a:hover { color: var(--ink); }

/* illustrative-data notice */
.notice { background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: .8rem; }
.notice .wrap { padding: .5rem 1.1rem; }
.notice strong { color: #eeca6b; }

footer.site { border-top: 1px solid var(--rule); margin-top: 4rem; padding: 1.5rem 0 2.5rem; color: var(--ink-soft); font-family: var(--sans); font-size: .8rem; }
footer.site a { color: var(--ink-soft); }
footer.site .imprint { margin-top: .8rem; font-size: .74rem; }

/* type */
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .6rem; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.25rem; margin-top: 2.2rem; }
p  { margin: .7rem 0; }
.eyebrow { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }

/* home */
.hero { padding: 3.2rem 0 1rem; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); max-width: 20ch; }
.hero p.lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 34rem; }
.searchbox { margin: 1.6rem 0 .4rem; }
.searchbox form { display: flex; gap: .55rem; flex-wrap: wrap; }
.searchbox input[type=text] {
  flex: 1 1 14rem; font-family: var(--sans); font-size: 1.05rem; padding: .78rem .9rem;
  border: 1.5px solid var(--ink); border-radius: 3px; background: #fff; color: var(--ink);
}
.searchbox input::placeholder { color: #98a0a9; }
button.primary {
  font-family: var(--sans); font-size: .95rem; font-weight: 600; letter-spacing: .02em;
  padding: .78rem 1.25rem; border: 1.5px solid var(--ink); border-radius: 3px;
  background: var(--ink); color: var(--paper); cursor: pointer;
}
button.primary:hover { background: #223140; }
button.ghost {
  font-family: var(--sans); font-size: .85rem; padding: .55rem .9rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 3px; background: transparent; color: var(--ink-soft);
}
.search-alt { font-family: var(--sans); font-size: .84rem; color: var(--ink-soft); margin-top: .55rem; }
.search-msg { font-family: var(--sans); font-size: .9rem; margin-top: .8rem; color: var(--ink); min-height: 1.3em; }
.search-msg.err { color: #93262c; }
.privacy-line { font-family: var(--sans); font-size: .76rem; color: var(--ink-soft); margin-top: 1.1rem; }

.autocomplete { position: relative; }
.autocomplete ul {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: .25rem 0 0; padding: 0;
  list-style: none; background: #fff; border: 1px solid var(--rule); border-radius: 3px;
  max-height: 15rem; overflow: auto; box-shadow: 0 4px 14px rgba(23,34,46,.08);
}
.autocomplete li { padding: .5rem .8rem; font-family: var(--sans); font-size: .95rem; cursor: pointer; }
.autocomplete li[aria-selected=true], .autocomplete li:hover { background: var(--paper-deep); }

.steps { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 2.4rem 0; }
.steps div { border-top: 2px solid var(--ink); padding-top: .6rem; }
.steps h3 { font-size: .95rem; font-family: var(--sans); letter-spacing: .02em; }
.steps p { font-size: .9rem; color: var(--ink-soft); margin: .3rem 0 0; }

/* verdict */
.verdict { padding: 2.4rem 0 0; }
.verdict .state { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.state.s-rec { color: var(--accent); }
.state.s-neutral { color: var(--ink-soft); }
.verdict h1 { font-size: clamp(2rem, 7vw, 3rem); margin: .35rem 0 .55rem; }
.verdict .oneline { font-size: 1.08rem; max-width: 36rem; }
.metaline { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); letter-spacing: .02em; margin: 1.1rem 0 0; }
.metaline b { color: var(--ink); font-weight: 600; }
.interim { font-family: var(--sans); font-size: .8rem; color: var(--accent); margin-top: .4rem; }

/* the gap scale — signature device */
.gapscale { margin: 1.8rem 0 .4rem; }
.gapscale .track { position: relative; height: 58px; }
.gapscale .axis { position: absolute; left: 0; right: 0; top: 38px; height: 1.5px; background: var(--ink); }
.gapscale .bandzone { position: absolute; top: 26px; height: 25px; background: var(--band); border-left: 1px dashed var(--accent-bright); border-right: 1px dashed var(--accent-bright); }
.gapscale .mark { position: absolute; top: 30px; width: 2.5px; height: 17px; transform: translateX(-50%); }
.gapscale .mark span { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-family: var(--sans); font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--ink); }
.gapscale .winmark { position: absolute; top: 24px; width: 0; height: 0; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; }
.gapscale .winmark span { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); font-family: var(--sans); font-size: .68rem; color: var(--ink-soft); white-space: nowrap; }
.gapscale .caption { font-family: var(--sans); font-size: .74rem; color: var(--ink-soft); margin-top: .2rem; }

/* evidence table */
table.evidence { width: 100%; border-collapse: collapse; margin: 1.4rem 0 .3rem; font-family: var(--sans); font-size: .95rem; }
table.evidence th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; border-bottom: 1.5px solid var(--ink); padding: 0 0 .35rem; }
table.evidence th:last-child, table.evidence td:last-child { text-align: right; }
table.evidence td { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.swatch { display: inline-block; width: .65rem; height: .65rem; border-radius: 1px; margin-right: .5rem; vertical-align: baseline; }
.numbers { display: flex; gap: 2.2rem; flex-wrap: wrap; margin: 1.2rem 0; font-family: var(--sans); }
.numbers .n b { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }
.numbers .n span { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

/* why + actions */
.why ol { padding-left: 1.2rem; margin: .5rem 0; }
.why li { margin: .45rem 0; }
.trustline { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: .9rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.6rem 0 0; font-family: var(--sans); }
.report { margin-top: 2.2rem; font-family: var(--sans); font-size: .85rem; }
details.reportbox { border: 1px solid var(--rule); border-radius: 3px; padding: .7rem .9rem; margin-top: .5rem; background: #fff; }
details.reportbox textarea, details.reportbox input { width: 100%; font-family: var(--sans); font-size: .9rem; padding: .5rem; border: 1px solid var(--rule); border-radius: 3px; margin: .3rem 0 .6rem; background: var(--paper); }

/* index + content pages */
ul.constlist { list-style: none; padding: 0; column-width: 16rem; column-gap: 2.5rem; font-family: var(--sans); font-size: .92rem; }
ul.constlist li { margin: .28rem 0; break-inside: avoid; }
.content { padding-top: 2.2rem; }
.content h1 { font-size: 1.8rem; }
.content ul, .content ol { padding-left: 1.25rem; }
.content li { margin: .35rem 0; }

/* update tool */
.tool textarea { width: 100%; min-height: 14rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; border: 1.5px solid var(--ink); border-radius: 3px; padding: .8rem; background: #fff; }
.tool .panel { border: 1px solid var(--rule); background: #fff; border-radius: 3px; padding: 1rem 1.1rem; margin: 1.1rem 0; font-family: var(--sans); font-size: .9rem; }
.tool .ok { color: #1e6b38; } .tool .err { color: #93262c; } .tool .warn { color: #8a5a00; }
.tool table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tool table td, .tool table th { padding: .35rem .4rem; border-bottom: 1px solid var(--rule); text-align: left; }

@media (max-width: 540px) {
  .numbers { gap: 1.3rem; }
  nav.site a { margin-left: .7rem; }
  .gapscale .mark span { font-size: .66rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* constituency index filters */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .4rem; font-family: var(--sans); }
button.chip { font-family: var(--sans); font-size: .8rem; padding: .4rem .75rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink); }
button.chip[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.chip .ct { color: var(--ink-soft); margin-left: .3rem; }
button.chip[aria-pressed=true] .ct { color: var(--paper-deep); }
#otherfilters select, #otherfilters input { font-family: var(--sans); font-size: .85rem; padding: .42rem .6rem;
  border: 1px solid var(--rule); border-radius: 3px; background: #fff; color: var(--ink); }
.badge { font-family: var(--sans); font-size: .64rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  margin-left: .45rem; color: var(--ink-soft); }
.badge.b-rec { color: var(--accent); }
.badge.b-chg { color: var(--accent-bright); }

/* homepage emphasis */
.hero-xl { font-size: clamp(2.1rem, 8vw, 3.3rem); max-width: 22ch; }
.searchbox-lg input[type=text] { font-size: 1.18rem; padding: .95rem 1.05rem; }
.searchbox-lg button.primary { font-size: 1.05rem; padding: .95rem 1.4rem; }
.searchbox-lg .lede { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); max-width: 38rem; margin-top: 1.1rem; }

/* last-updated strip */
.notice-light { background: var(--paper-deep); color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.notice-light .wrap { padding: .35rem 1.1rem; }

/* all seats table */
.tablewrap { overflow-x: auto; margin: 1rem 0; }
table.seats { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .88rem; }
table.seats th { text-align: left; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; border-bottom: 1.5px solid var(--ink); padding: 0 .7rem .35rem 0; white-space: nowrap; }
table.seats td { padding: .42rem .7rem .42rem 0; border-bottom: 1px solid var(--rule); }
table.seats th.num, table.seats td.num { text-align: right; }
table.seats .cname a { color: var(--ink); text-decoration: none; }
table.seats .cname a:hover { color: var(--accent); }
table.seats .badge { margin-left: 0; margin-right: .3rem; }

/* table polish */
table.seats tbody tr:nth-child(even) { background: rgba(23,34,46,.025); }
table.seats tbody tr:hover { background: var(--paper-deep); }
table.seats thead th { cursor: pointer; user-select: none; vertical-align: bottom; line-height: 1.25; }
table.seats thead th[aria-sort=ascending]::after { content: " \2191"; color: var(--accent); }
table.seats thead th[aria-sort=descending]::after { content: " \2193"; color: var(--accent); }
.legend { border-top: 1px solid var(--rule); margin-top: 1rem; padding-top: .7rem; }
.legend p { margin: .3rem 0; }

/* threshold explorer */
details.explorer { border: 1px solid var(--rule); border-radius: 3px; background: #fff; padding: .8rem 1rem; margin: 1.4rem 0; font-family: var(--sans); }
details.explorer summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
details.explorer .sliders { display: grid; gap: 1rem; margin: 1rem 0; }
details.explorer label { font-size: .9rem; }
details.explorer input[type=range] { width: 100%; max-width: 26rem; display: block; margin-top: .35rem; accent-color: var(--accent-bright); }
details.explorer table { max-width: 30rem; margin: .6rem 0; }

/* verdict lean line */
.leanline { font-family: var(--serif); font-size: 1.35rem; margin: -.1rem 0 .6rem; }
.leanline b { color: var(--accent); }

/* projected-share bar chart */
.bars { margin: 1.6rem 0 .2rem; }
.barrow { display: grid; grid-template-columns: 8.5rem 1fr 3.4rem; align-items: center; gap: .6rem; padding: .28rem 0; font-family: var(--sans); font-size: .88rem; }
.barrow.cr .blabel { font-weight: 600; }
.blabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btrack { background: rgba(23,34,46,.06); border-radius: 2px; height: 14px; }
.bfill { display: block; height: 100%; border-radius: 2px; min-width: 2px; }
.bval { text-align: right; font-variant-numeric: tabular-nums; }
.bars + .caption, .caption { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); margin: .5rem 0 0; }
@media (max-width: 480px) { .barrow { grid-template-columns: 6.2rem 1fr 3.1rem; font-size: .82rem; } }

@media (max-width: 540px) { .wordmark { font-size: 2.6rem; } header.site .wrap { flex-wrap: wrap; } nav.site { width: 100%; margin-top: .35rem; } nav.site a:first-child { margin-left: 0; } }

/* All seats: grouped header + phone cards */
table.seats-wide { font-size: .84rem; }
table.seats-wide th, table.seats-wide td { padding-right: .55rem; }
table.seats-wide thead tr.grp th { border-bottom: 1px solid var(--rule); font-size: .64rem; letter-spacing: .1em; color: var(--accent); cursor: default; padding-bottom: .2rem; }
table.seats-wide thead tr.grp th.grp-l { border-left: 1px solid var(--rule); padding-left: .55rem; }
table.seats-wide td.c-con, table.seats-wide td.c-gap { border-left: 1px solid var(--rule); padding-left: .55rem; }
table.seats-wide th:nth-child(3), table.seats-wide th:nth-child(6) { border-left: 1px solid var(--rule); padding-left: .55rem; }
table.seats-wide .swatch { margin-right: .35rem; }
@media (max-width: 720px) {
  table.seats-wide, table.seats-wide tbody, table.seats-wide tr, table.seats-wide td { display: block; }
  table.seats-wide thead { display: none; }
  table.seats-wide tr { border: 1px solid var(--rule); border-radius: 3px; background: #fff; margin: .6rem 0; padding: .55rem .75rem; }
  table.seats-wide tbody tr:nth-child(even) { background: #fff; }
  table.seats-wide td { border: 0; padding: .15rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  table.seats-wide td.cname { display: block; font-size: 1rem; font-weight: 600; padding-bottom: .2rem; }
  table.seats-wide td.cres { display: block; padding-bottom: .35rem; border-bottom: 1px solid var(--rule); margin-bottom: .3rem; }
  table.seats-wide td:not(.cname):not(.cres)::before { content: attr(data-label); color: var(--ink-soft); font-size: .78rem; }
  table.seats-wide td.c-con, table.seats-wide td.c-gap { border-left: 0; padding-left: 0; }
  table.seats-wide td.num { text-align: right; }
}

/* custom-thresholds bar */
.custombar { background: #fff4d6; color: var(--ink); border-bottom: 2px solid var(--accent-bright); font-family: var(--sans); font-size: .84rem; }
.custombar .wrap { padding: .5rem 1.1rem; }
.custombar a { color: var(--accent); font-weight: 600; }
