/* Balfour: editorial style (newsprint, rules, serif headlines). Logical properties keep it ready for Hebrew (RTL). */

/* ───────── Tokens ───────── */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eeebe4;
  --surface-3: #e2ded4;
  --ink: #131417;
  --ink-2: #4b4d55;
  --ink-3: #868892;
  --line: #d7d4cc;
  --rule: #131417;
  --accent: #0038b8;
  --accent-ink: #ffffff;
  --accent-soft: #e3eafb;
  --good: #1e7a43;
  --bad: #c0292b;
  --warn: #b36b00;
  --good-bg: #e3f0e6;
  --bad-bg: #f8e2e1;
  --warn-bg: #f6ecd6;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111215; --surface: #1a1b1f; --surface-2: #232429; --surface-3: #2f3036;
    --ink: #eeeef1; --ink-2: #b2b3bb; --ink-3: #7e808a; --line: #34353b; --rule: #eeeef1;
    --accent: #5b8cff; --accent-ink: #0b0c10; --accent-soft: #1d2740; --good: #4db373; --bad: #ef6461; --warn: #e0a43a;
    --good-bg: #1a2e21; --bad-bg: #3a1d1d; --warn-bg: #362b16;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #111215; --surface: #1a1b1f; --surface-2: #232429; --surface-3: #2f3036;
  --ink: #eeeef1; --ink-2: #b2b3bb; --ink-3: #7e808a; --line: #34353b; --rule: #eeeef1;
  --accent: #5b8cff; --accent-ink: #0b0c10; --accent-soft: #1d2740; --good: #4db373; --bad: #ef6461; --warn: #e0a43a;
  --good-bg: #1a2e21; --bad-bg: #3a1d1d; --warn-bg: #362b16;
  color-scheme: dark;
}

/* ───────── Base ───────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 22px; }
h3 { font-size: 15.5px; font-family: var(--serif); font-weight: 700; margin: 0; }
p { margin: 0 0 8px; }
button { font: inherit; color: inherit; }
b { font-weight: 600; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.serif { font-family: var(--serif); }
[hidden] { display: none !important; }
a { color: var(--accent); }

/* ───────── Buttons ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); background: transparent; border-radius: 2px; padding: 7px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 13px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn.ghost { border-color: transparent; }
.btn.icon { width: 34px; height: 34px; padding: 0; font-size: 16px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───────── Top bar ───────── */
.masthead { position: sticky; top: 0; z-index: 30; background: var(--surface); }
.topbar { display: flex; align-items: stretch; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; min-width: 0; padding: 10px 0; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1; }
.brand-name::after { content: ''; display: block; width: 26px; height: 3px; background: var(--accent); margin-top: 5px; }
.brand-sub { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; margin-top: 3px; }
.hdr-stats { display: flex; flex: 1; justify-content: center; overflow: hidden; }
.chip { display: flex; flex-direction: column; justify-content: center; padding: 6px 14px; border-inline-start: 1px solid var(--line); min-width: 80px; }
.chip:last-child { border-inline-end: 1px solid var(--line); }
.chip[data-action] { cursor: pointer; }
.chip[data-action]:hover { background: var(--surface-2); }
.chip .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.chip .v { font-weight: 700; font-size: 16px; white-space: nowrap; font-family: var(--serif); }
.chip .v .sub { font-size: 11px; font-weight: 500; color: var(--ink-3); font-family: var(--sans); }
.hdr-actions { display: flex; gap: 4px; align-items: center; }
.tabs { display: flex; padding: 0 16px; border-bottom: 2px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 17px; padding: 0 5px; margin-inline-start: 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; }

/* ───────── Layout ───────── */
main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 80px; outline: none; }
.grid { display: grid; gap: 16px; align-content: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--rule); padding: 14px 16px; min-width: 0; }
.card.flat { border-top-width: 1px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-h .sub { font-size: 12px; color: var(--ink-3); }
.kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.lede { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.section-h { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.section-h:first-child { margin-top: 0; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.note { background: var(--surface-2); border-inline-start: 3px solid var(--accent); padding: 8px 12px; font-size: 13px; margin: 8px 0; }
.note.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--ink); }
.note.good { border-color: var(--good); background: var(--good-bg); color: var(--ink); }
.note.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--ink); }

/* ───────── Rows & lists ───────── */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .val { font-weight: 700; white-space: nowrap; font-family: var(--serif); }
.row .meta { font-size: 12px; color: var(--ink-3); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-2); white-space: nowrap; }
.tag.law { border-color: var(--accent); color: var(--accent); }
.tag.good { border-color: var(--good); color: var(--good); }
.tag.bad { border-color: var(--bad); color: var(--bad); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: -1px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.pchip .dot { width: 9px; height: 9px; }

/* ───────── Meters ───────── */
.bar { position: relative; height: 8px; background: var(--surface-3); border-radius: 1px; overflow: hidden; min-width: 60px; }
.bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--ink-2); }
.bar.mood > i { background: var(--good); }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 9px; height: 9px; background: var(--surface-3); display: inline-block; }
.meter i.on { background: var(--accent); }
.meter.off { font-size: 11px; color: var(--ink-3); font-style: italic; }
.seatbar { position: relative; display: flex; height: 26px; background: var(--surface-3); margin: 6px 0 18px; }
.seatbar > span { height: 100%; display: block; position: relative; }
.seatbar > span.support { opacity: .45; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.seatbar .mark { position: absolute; inset-block: -4px; width: 2px; background: var(--ink); }
.seatbar .mark::after { content: attr(data-label); position: absolute; top: 32px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.big-num { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.stat .v { font-family: var(--serif); font-weight: 700; font-size: 22px; }
.trend { font-size: 11px; font-weight: 600; }
.trend.up, .trend.good { color: var(--good); } .trend.down, .trend.bad { color: var(--bad); }

/* ───────── Charts ───────── */
.spark { display: block; }
.linechart, .hemicycle, .sankey { width: 100%; height: auto; display: block; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .ref { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.linechart .axis { fill: var(--ink-3); font-size: 10px; }
.linechart .endlab { font-size: 10.5px; font-weight: 700; }
.hemicycle .empty-seat { fill: var(--surface-3); }
.hemi-num { font-family: var(--serif); font-size: 26px; font-weight: 700; fill: var(--ink); }
.hemi-sub { font-size: 10.5px; fill: var(--ink-3); }
.chart-empty { color: var(--ink-3); font-size: 12px; padding: 20px 0; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.posmap { width: 100%; height: auto; display: block; }
.posmap .axisline { stroke: var(--line); }
.posmap text { font-size: 10px; fill: var(--ink-3); }
.posmap .plab { font-size: 10.5px; font-weight: 700; fill: var(--ink); }
.stack { display: flex; height: 14px; overflow: hidden; background: var(--surface-3); }
.stack span { height: 100%; }

/* ───────── Fronts ───────── */
.front { display: flex; flex-direction: column; gap: 10px; }
.front .gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.gauge { border: 1px solid var(--line); padding: 8px 10px; cursor: pointer; background: var(--surface); }
.gauge:hover { background: var(--surface-2); }
.gauge .k { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.gauge .v { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.gauge .bar { margin-top: 5px; height: 5px; }
.ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.op { border: 1px dashed var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.op .t { font-weight: 700; }
.op .d { font-size: 12px; color: var(--ink-2); flex: 1; }
.int-0 { color: var(--good); } .int-1 { color: var(--good); } .int-2 { color: var(--warn); } .int-3 { color: var(--bad); } .int-4 { color: var(--bad); }

/* ───────── Parties ───────── */
.parties { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--ink)); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.pcard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pcard .pname { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.pcard .seats { font-family: var(--serif); font-weight: 700; font-size: 22px; }
.pcard .who { font-size: 12px; color: var(--ink-3); }
.pcard ul { margin: 0; padding-inline-start: 16px; font-size: 12.5px; color: var(--ink-2); }
.pcard.signed { background: linear-gradient(var(--accent-soft), var(--accent-soft)) top / 100% 3px no-repeat, var(--surface); }
.status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ministry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.mbox { border: 1px solid var(--line); border-inline-start: 4px solid var(--c, var(--line)); padding: 5px 8px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; }
.mbox .h { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* ───────── Policies ───────── */
.area { margin-bottom: 18px; }
.area-h { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--rule); padding-bottom: 4px; margin-bottom: 2px; cursor: pointer; }
.area-h h3 { font-size: 17px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.prow:hover { background: var(--surface-2); }
.prow .lvl { font-size: 12px; color: var(--ink-2); text-align: end; }
.prow.changed .name::after { content: ' •'; color: var(--accent); }

/* ───────── Drawer ───────── */
#drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(480px, 100vw); background: var(--surface); border-inline-start: 2px solid var(--rule); z-index: 50; transform: translateX(105%); transition: transform .22s ease; overflow-y: auto; padding: 18px 20px 40px; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
[dir='rtl'] #drawer { transform: translateX(-105%); }
#drawer.open { transform: none; }
#drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 49; display: none; }
#drawer-scrim.open { display: block; }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.d-head h2 { font-size: 21px; }
.levels { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.lvl-btn { text-align: start; border: 1px solid var(--line); background: var(--surface); padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.lvl-btn:hover { background: var(--surface-2); }
.lvl-btn.cur { border-color: var(--ink); font-weight: 700; }
.lvl-btn.sel { border-color: var(--accent); background: var(--accent-soft); }
.fx-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.fx-row:last-child { border-bottom: 0; }
.slider { width: 100%; accent-color: var(--accent); }

/* ───────── Modal ───────── */
.modal-wrap { position: fixed; inset: 0; background: rgba(10,12,18,.5); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-top: 4px solid var(--accent); width: min(640px, 100%); padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(940px, 100%); }
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.choice { display: block; width: 100%; text-align: start; border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; margin: 6px 0; cursor: pointer; }
.choice:hover { border-color: var(--ink); background: var(--surface-2); }
.choice .t { font-weight: 700; }
.choice .s { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.check input { margin-top: 3px; }
.check.dis { opacity: .5; cursor: not-allowed; }
.verdict { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.verdict.yes { color: var(--good); } .verdict.close { color: var(--warn); } .verdict.no, .verdict.never { color: var(--bad); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.start-sc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sc-card { border: 1px solid var(--line); padding: 12px; cursor: pointer; text-align: start; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.sc-card:hover { border-color: var(--ink); }
.sc-card.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.sc-card .t { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.seg button.on { background: var(--ink); color: var(--surface); }

/* ───────── News & feed ───────── */
.news-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.news-item .t { font-weight: 700; font-family: var(--serif); font-size: 15px; }
.news-item .d { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.news-item.bad .t::before { content: '▼ '; color: var(--bad); font-size: 11px; }
.news-item.good .t::before { content: '▲ '; color: var(--good); font-size: 11px; }
.post { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.post .av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.post .who { font-weight: 700; font-size: 13px; }
.post .h { color: var(--ink-3); font-weight: 400; }
.post .txt { font-size: 13.5px; margin-top: 2px; }
.now-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.now-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ink-3); }
.sit { border: 1px solid var(--line); background: var(--surface); padding: 4px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sit.bad { border-color: var(--bad); color: var(--bad); }
.sit.good { border-color: var(--good); color: var(--good); }
.log { max-height: 260px; overflow-y: auto; font-size: 12.5px; }
.log div { padding: 5px 0; border-bottom: 1px dotted var(--line); }
.log .good { color: var(--good); } .log .bad { color: var(--bad); }

/* ───────── Toasts ───────── */
#toasts { position: fixed; inset-block-end: 16px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 9px 14px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .chip.opt { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; flex-wrap: wrap; }
  .hdr-stats { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; }
  .chip { padding: 4px 10px; min-width: 0; }
  .chip .v { font-size: 14px; }
  main { padding: 14px 16px 80px; }
  .hide-sm { display: none; }
  .split, .start-sc { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 18px 16px; }
  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow .lvl { display: none; }
}

/* ───────── Seats as bars ───────── */
.blocstrip { position: relative; display: flex; height: 30px; background: var(--surface-3); margin: 4px 0 22px; }
.blocstrip > span { height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; border-inline-end: 1px solid var(--surface); }
.blocstrip em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.35); padding: 0 2px; }
.blocstrip .mark { position: absolute; inset-block: -4px; width: 2px; background: var(--ink); }
.blocstrip .mark::after { content: attr(data-label); position: absolute; top: 36px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; }
.bloc-h { display: flex; justify-content: space-between; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); border-bottom: 1px solid var(--line); padding: 10px 0 3px; }
.bloc-h b { color: var(--ink); font-size: 12px; }
.srow { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(60px, 2fr) 28px auto; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.srow.click { cursor: pointer; } .srow.click:hover { background: var(--surface-2); }
.srow .sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sbar { height: 12px; background: var(--surface-2); position: relative; }
.srow .sbar i { position: absolute; inset-block: 0; inset-inline-start: 0; }
.srow .snum { font-family: var(--serif); font-weight: 700; text-align: end; }
@media (max-width: 640px) { .srow { grid-template-columns: minmax(110px, 1fr) minmax(40px, 1fr) 24px auto; } .srow .sname .faint { display: none; } }

/* ───────── Peace tracks ───────── */
.psteps { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.pstep { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 8px 3px 3px; border: 1px solid var(--line); color: var(--ink-3); }
.pstep .pdot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.pstep.done { color: var(--good); border-color: var(--good); }
.pstep.done .pdot { background: var(--good); color: #fff; }
.pstep.next { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.pstep.next .pdot { background: var(--accent); color: #fff; }

/* ───────── War and peace ───────── */
.ladder { display: flex; gap: 2px; margin: 2px 0 4px; }
.rung { flex: 1; min-width: 0; font-size: 10.5px; line-height: 1.2; padding: 5px 4px; text-align: center; background: var(--surface-2); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung:nth-child(1) { background: var(--bad-bg); }
.rung.deal { background: var(--surface-2); }
.rung.past { color: var(--ink-2); }
.rung.past.deal { background: var(--good-bg); color: var(--good); }
.rung.here { background: var(--accent); color: var(--accent-ink); font-weight: 700; white-space: normal; flex: 1.6; }
.talks { border-top: 2px solid var(--accent); padding-top: 8px; margin-top: 6px; }

/* ───────── Policies in columns ───────── */
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; align-items: start; }
.card.area { padding-top: 10px; }
.card.area .area-h { cursor: default; }

/* ───────── Voters matrix ───────── */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: collapse; width: 100%; font-size: 12px; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; white-space: nowrap; }
.matrix th { font-weight: 600; background: var(--surface); }
.matrix th a { color: inherit; text-decoration: none; }
.matrix th.sticky { position: sticky; inset-inline-start: 0; text-align: start; z-index: 1; }
.matrix td.cell { cursor: pointer; }
.matrix td.cell:hover { outline: 2px solid var(--ink); outline-offset: -2px; }

/* ───────── Budget session ───────── */
.budget-sum { display: flex; gap: 22px; flex-wrap: wrap; padding: 10px 0; border-block: 1px solid var(--line); margin: 8px 0; }
.budget-sum .stat .v { font-size: 19px; }
.brow { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dotted var(--line); }
.brow.chg { background: var(--accent-soft); }
.brow .bamt { width: 74px; text-align: end; font-family: var(--serif); font-weight: 700; }
.brow .btn.sm { padding: 1px 9px; min-width: 26px; }

/* ───────── Fronts as rows ───────── */
.axis { padding: 7px 0; border-bottom: 1px dotted var(--line); }
.axis-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.axis-h a { color: inherit; text-decoration: none; }
.axis-bar { position: relative; overflow: visible; margin: 4px 0 2px; height: 7px; }
.axis-bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.opchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.opchip { border: 1px solid var(--line); background: var(--surface); padding: 3px 8px; font-size: 12px; cursor: pointer; border-radius: 12px; }
.opchip:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-2); }
.opchip:disabled { opacity: .45; cursor: not-allowed; }
.opchip b { color: var(--accent); margin-inline-start: 2px; }
.needs { display: flex; flex-wrap: wrap; gap: 4px; }
.need { font-size: 11.5px; padding: 2px 7px; border: 1px solid var(--bad); color: var(--bad); text-decoration: none; }
.need.ok { border-color: var(--good); color: var(--good); }
details.pols { margin-top: 8px; }
details.pols summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.talks .btn-row .bar { flex: 1; min-width: 60px; }

/* ───────── Knesset table ───────── */
.krow { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(60px, 2fr) 30px 30px 48px; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.krow.head { font-size: 11px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.krow.click { cursor: pointer; } .krow.click:hover { background: var(--surface-2); }
.krow .sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.krow .sbar { height: 12px; position: relative; }
.krow .sbar i { position: absolute; inset-block: 0; inset-inline-start: 0; opacity: .9; }
.krow .sbar u { position: absolute; inset-block: -2px; inset-inline-start: 0; border: 1.5px dashed; text-decoration: none; }
.krow .snum { font-family: var(--serif); font-weight: 700; text-align: end; }
.matrix .click { cursor: pointer; }
.matrix th.click:hover, .matrix td.click:hover { background: var(--surface-2); }
.req { border-bottom: 1px solid var(--line); padding: 6px 0; }
.req .check { border-bottom: 0; padding: 2px 0; }
.dealsel { max-width: 180px; font: inherit; font-size: 12px; padding: 2px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 640px) { .krow { grid-template-columns: minmax(100px, 1fr) minmax(40px, 1fr) 24px 24px 40px; gap: 6px; } .krow .sname .faint { display: none; } }

/* ───────── Party names in colour ───────── */
.pn { color: var(--pc); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .pn { color: color-mix(in srgb, var(--pc) 60%, white); } }
:root[data-theme='dark'] .pn { color: color-mix(in srgb, var(--pc) 60%, white); }
.pchip .pn { font-weight: 600; }

/* ───────── Pills ───────── */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 11px; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.big { font-size: 13px; padding: 4px 12px; border-radius: 14px; }
.pill.toggle { cursor: pointer; border-color: var(--line); background: var(--surface); font: inherit; font-size: 12px; }
.pill.toggle:hover { border-color: var(--ink-3); }
.pill.toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 600; }

/* ───────── Policy preview ───────── */
.preview { margin: 10px 0; }
.stat-row.compact { gap: 18px; margin-bottom: 6px; }
.stat-row.compact .v { font-size: 18px; }
.imp { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 44px; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.imp .b { font-weight: 600; }
.imp > span:last-child { text-align: end; font-weight: 600; }
.impbar { position: relative; height: 8px; background: var(--surface-2); }
.impbar::before { content: ''; position: absolute; inset-block: -2px; inset-inline-start: 50%; width: 1px; background: var(--ink-3); }
.impbar i { position: absolute; inset-block: 0; }
.impbar i.up { inset-inline-start: 50%; background: var(--good); }
.impbar i.down { inset-inline-end: 50%; background: var(--bad); }

/* ───────── Budget, cleaner ───────── */
.modal.budget .budget-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.modal.budget .budget-top h2 { margin: 0; }
.modal.budget .brow { gap: 8px; padding: 6px 0; }
.modal.budget .bamt { width: 64px; }
.bdelta { width: 44px; text-align: end; }
.seg.mini button { padding: 2px 9px; font-size: 13px; }
.req { padding: 8px 0; }
.req .chips { margin-top: 5px; }
.pcard ul { margin: 2px 0; }
.pcard li.good { color: var(--good); }
.toast .pn, .tag .pn, .pill.good .pn, .pill.bad .pn { color: inherit; text-decoration: underline; text-decoration-color: var(--pc); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.toast .pn { text-decoration-color: currentColor; }
.brow .grow { flex: 1; min-width: 0; }
.brow > .dot { flex: none; }

/* ───────── Icons ───────── */
.ic { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; flex: none; }
.ic.ok circle { fill: var(--good); }
.ic.ok path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic.no circle { fill: none; stroke: var(--bad); stroke-width: 1.8; }
.ic.no path { stroke: var(--bad); stroke-width: 2; stroke-linecap: round; }
.ic.wait circle { fill: none; stroke: var(--warn); stroke-width: 1.8; }
.ic.wait .dotc { fill: var(--warn); stroke: none; }
.need .ic { margin-inline-end: 3px; }

/* ───────── Policy links ───────── */
a.plink { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a.plink:hover { text-decoration-color: var(--accent); color: var(--accent); }
#drawer { z-index: 95; }
#drawer-scrim { z-index: 94; }
#toasts { z-index: 100; }

/* ───────── Deal terms and decisive paths ───────── */
.terms { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.term { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.term > .tiny { width: 64px; }
.term .seg.mini button { font-size: 11.5px; padding: 2px 7px; }
.axis.endgame { border-bottom: 0; }

/* ───────── Toasts, more visible ───────── */
#toasts { inset-block-end: auto; inset-block-start: 96px; }
.toast { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; padding: 12px 18px; border-radius: 4px; min-width: 260px; max-width: min(560px, 92vw); box-shadow: 0 10px 30px rgba(0,0,0,.28); animation: toast-in .25s ease-out; }
.toast.good { background: var(--surface); color: var(--ink); border: 2px solid var(--good); border-inline-start-width: 6px; }
.toast.bad { background: var(--surface); color: var(--ink); border: 2px solid var(--bad); border-inline-start-width: 6px; }
.toast .ic { width: 18px; height: 18px; }
.toast .pn { color: color-mix(in srgb, var(--pc) 75%, var(--ink)); text-decoration: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.card.area .area-h { align-items: center; }

/* ───────── Fronts: neutral ladder, one checklist ───────── */
.rung:nth-child(1), .rung.deal, .rung.past.deal { background: var(--surface-2); color: var(--ink-3); }
.rung.past { color: var(--ink-3); opacity: .55; }
.rung.here { background: var(--accent); color: var(--accent-ink); opacity: 1; }
.axis-bar i { background: color-mix(in srgb, var(--accent) 70%, var(--surface-2)); }
.checklist { display: grid; gap: 4px; margin: 4px 0 2px; }
.chk { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; line-height: 1.35; color: var(--ink); }
.chk.ok { color: var(--ink-3); }
.chk .ic { margin-top: 1px; }
.chk a { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
details.endgame { margin-top: 8px; border-top: 1px dotted var(--line); padding-top: 6px; }
details.endgame summary { cursor: pointer; font-size: 13px; }
.endgame-done { margin-top: 8px; color: var(--good); font-weight: 600; }
/* ───────── Term review ───────── */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 10px 0 6px; }
.review-grid .v { font-size: 16px; }
.moves { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-move { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-inline-start: 3px solid var(--ink-3); }
.pill-move.good { border-inline-start-color: var(--good); }
.pill-move.bad { border-inline-start-color: var(--bad); }
.pill-move a { color: inherit; text-decoration: none; }

/* ───────── Dilemma effects ───────── */
.fxline { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 3px; }
.fx { font-size: 11.5px; padding: 1px 6px; border-radius: 3px; background: var(--surface-2); }
.fx.good { color: var(--good); background: var(--good-bg); }
.fx.bad { color: var(--bad); background: var(--bad-bg); }

/* ───────── Short feed on the overview ───────── */
.post.short { padding: 7px 0; gap: 8px; }
.post.short .av { width: 26px; height: 26px; font-size: 11px; }
.post.short .who { font-size: 12px; }
.post.short .txt { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.feed .post:last-child { border-bottom: 0; }
a.plink.glink { text-decoration-style: dotted; }
.lvl-btn .faint.small { font-variant-numeric: tabular-nums; }

/* ───────── Language switch ───────── */
.lang-seg { display: inline-flex; margin-bottom: 12px; }
.lang-seg button { flex: 0 0 auto; padding: 4px 12px; }
/* ───────── Hebrew ───────── */
html[lang="he"] {
  --serif: 'Frank Ruhl Libre', 'Frank Ruehl CLM', 'David', 'Times New Roman', serif;
  --sans: 'Heebo', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
}
html[lang="he"] .kicker, html[lang="he"] .chip .k, html[lang="he"] .stat .k, html[lang="he"] .tag, html[lang="he"] .status,
html[lang="he"] .news-item .d, html[lang="he"] .now-h, html[lang="he"] .bloc-h { letter-spacing: 0; }
html[lang="he"] .kicker { font-size: 11.5px; }
html[lang="he"] h1, html[lang="he"] h2 { letter-spacing: 0; }
html[dir="rtl"] svg { direction: ltr; }
html[dir="rtl"] input, html[dir="rtl"] select { text-align: right; }
/* ───────── Policy rows: the name reads as a title, its state as a value ───────── */
.prow .name { font-weight: 600; color: var(--ink); }
.prow .meta { margin-top: 2px; font-size: 12px; color: var(--accent); font-weight: 500; }
html[data-theme="dark"] .prow .meta { color: color-mix(in srgb, var(--accent) 55%, var(--ink)); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .prow .meta { color: color-mix(in srgb, var(--accent) 55%, var(--ink)); } }
/* Header chips keep their width; if they don't fit, the strip scrolls instead of overlapping */
.chip { flex: 0 0 auto; }
.hdr-stats { justify-content: safe center; overflow-x: auto; scrollbar-width: none; }
.hdr-stats::-webkit-scrollbar { display: none; }
html[lang="he"] .chip .v { font-family: var(--sans); font-size: 15px; }
html[lang="he"] .chip { padding: 6px 12px; }
