/* k26polls — view: the seat model («מודל מנדטים»), and en/model.html, which loads this
 * same file so the two pages cannot drift apart in how they draw a card, a chart or a bar.
 *
 * The design is the model page Tal chose on 2026-09-24 ("prettier than the tab"): white
 * cards on the site's ground, large figures over a coloured rule, three bloc colours used
 * the same way in every chart, pill switches, and a tooltip on every mark. It departs from
 * the site's no-radius rule inside this tab only, because that page is the design asked
 * for; the site's chrome around it (masthead, tabs, footer) is untouched.
 *
 * Colour carries one meaning each, on every chart of the tab:
 *   teal      a run where the coalition has 61 or more (the histograms), and the controls
 *   --s1 blue the coalition's lists and lines
 *   --s3 green עמך ישראל, and the coalition with it
 *   --s2 orange everyone outside the coalition, and the Zionist opposition
 * Colour is never the only carrier: every chart has a legend or labels its lines, and the
 * figures are printed.
 *
 * Everything is addressed with logical properties (inset-inline, margin-inline) because
 * the Hebrew page is RTL and the English one LTR. The charts themselves are LTR on both
 * (.mdl-svg): seats and time run left to right.
 */

.mdl{
  display:block;
  --ink-2:#4b5359;
  --grid:#ECE6E4;
  --axis:#CFC5C2;
  --teal-band:rgba(49,145,162,.16);
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a;
  --tip-bg:#313131; --tip-ink:#FFFFFF;
}

/* ---- head -------------------------------------------------------------------------- */
.mdl-head{margin-bottom:6px}
/* The first thing on the tab, and it has to be read before any number: this is a
   simulation, not something an institute filed. */
.mdl-kind{display:inline-block;margin:0 0 10px;font-size:12.5px;font-weight:600;
  color:var(--rose-text);background:var(--rose-tint);padding:3px 10px;border-radius:999px}
.mdl-head .view-head{font-size:clamp(26px,4vw,34px);font-weight:700;line-height:1.2;margin:0 0 8px;
  color:var(--ink);text-wrap:balance}
.mdl-head .view-sub{margin:0 0 6px;font-size:16px;line-height:1.6;color:var(--ink-2);max-width:74ch}
.mdl-asof{margin:0;font-size:13px;color:var(--muted)}
.mdl-switch{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.mdl-switch button{font:inherit;font-size:14px;padding:7px 14px;border-radius:999px;
  border:1px solid var(--axis);background:var(--surface);color:var(--ink);cursor:pointer}
.mdl-switch button[aria-pressed="true"]{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.mdl-scenario-note{margin:8px 0 0;font-size:13px;color:var(--muted);max-width:80ch}

/* ---- the Arab-turnout slider --------------------------------------------------------- */
.mdl-turnout{margin-top:16px;max-width:560px}
.mdl-turnout-label{display:block;font-size:14px;font-weight:500;margin-bottom:4px;color:var(--ink)}
.mdl-turnout-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
/* LTR like every axis on the tab: the lowest turnout on the left. */
.mdl-turnout-track{position:relative;flex:1 1 240px;min-width:0;direction:ltr;padding-bottom:46px}
.mdl-turnout-track input[type=range]{width:100%;margin:0;accent-color:var(--teal);cursor:pointer}
.mdl-turnout-ticks{position:absolute;top:22px;left:0;right:0;display:flex;justify-content:space-between;
  font-size:11px;color:var(--muted)}
/* The 2019-2022 turnouts, under the track (Tal, 2026-09-24). */
.mdl-turnout-band{position:absolute;top:40px;height:6px;border-radius:3px;background:var(--teal-band)}
.mdl-turnout-band span{position:absolute;top:7px;left:50%;transform:translateX(-50%);font-size:11px;
  color:var(--muted);white-space:nowrap}
.mdl-turnout-value{font-size:15px;font-weight:700;min-width:5.5em;color:var(--ink)}
.mdl-turnout-note{margin:6px 0 0;font-size:13px;line-height:1.6;color:var(--muted);max-width:74ch}
.mdl-btn{font:inherit;font-size:13px;padding:3px 10px;border-radius:4px;border:1px solid var(--axis);
  background:transparent;color:var(--ink-2);cursor:pointer}
.mdl-btn:hover{border-color:var(--ink-2)}

/* ---- cards ------------------------------------------------------------------------- */
.mdl-section{background:var(--surface);border-radius:6px;padding:24px 22px 20px;margin-top:24px}
.mdl-section > h2,.mdl-section > h3{font-size:21px;font-weight:700;margin:0 0 4px;color:var(--ink);text-wrap:balance}
.mdl-lede{margin:0 0 14px;color:var(--ink-2);max-width:78ch;font-size:15px;line-height:1.6}
.mdl-h4{font-size:15px;font-weight:700;margin:0 0 6px;color:var(--ink)}
.mdl-caption{font-size:13px;line-height:1.6;color:var(--muted);margin:10px 0 0;max-width:90ch}
.mdl-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:28px}
.mdl-cols > *{min-width:0}
@media (max-width:760px){.mdl-cols{grid-template-columns:1fr}}
@media (max-width:520px){.mdl-section{padding:18px 14px}}

/* ---- headline figures -------------------------------------------------------------- */
.mdl-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:6px 0 18px}
.mdl-stat{border-top:3px solid var(--axis);padding-top:10px}
.mdl-stat .value{font-size:40px;font-weight:700;line-height:1.05;color:var(--ink)}
.mdl-stat .label{font-size:14px;line-height:1.5;color:var(--ink-2);margin-top:2px}
.mdl-stat.s-co{border-color:var(--s1)}
.mdl-stat.s-conr{border-color:var(--s3)}
.mdl-stat.s-opp{border-color:var(--s2)}
@media (max-width:520px){.mdl-stat .value{font-size:32px}}

/* ---- legends ----------------------------------------------------------------------- */
.mdl-legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:14px;color:var(--ink-2);margin:0 0 8px}
.mdl-legend span{display:inline-flex;align-items:center;gap:6px}
.mdl-sw{width:14px;height:8px;border-radius:2px;display:inline-block}
.mdl-sw.s-co{background:var(--s1)} .mdl-sw.s-conr{background:var(--s3)} .mdl-sw.s-opp{background:var(--s2)}
.mdl-sw.maj{background:var(--teal)} .mdl-sw.min{background:var(--mark)}

/* ---- charts (markup from assets/model-data.js) --------------------------------------- */
.mdl-chart{position:relative;width:100%}
.mdl-svg{direction:ltr;display:block;width:100%;height:auto;overflow:visible}
.mdl-svg text{font-family:var(--font);fill:var(--muted);font-size:12px}
.mdl-svg .lbl{fill:var(--ink);font-weight:500;font-size:13px}
.mdl-svg .grid{stroke:var(--grid);stroke-width:1}
.mdl-svg .base{stroke:var(--axis);stroke-width:1}
.mdl-svg .ref{stroke:var(--rose-text);stroke-width:1.4;stroke-dasharray:4 3}
.mdl-svg .reft{fill:var(--rose-text);font-weight:600}
.mdl-svg .bar{fill:var(--mark)}
.mdl-svg .bar.maj{fill:var(--teal)}
.mdl-svg .hit{fill:transparent}
.mdl-svg .pass{fill:var(--rose-text);font-size:12px}
/* per list: the 90% band light, the 80% band dark, the middle result a dot */
.mdl-svg .r90{stroke-width:9;stroke-linecap:round;stroke-opacity:.2}
.mdl-svg .r80{stroke-width:9;stroke-linecap:round;stroke-opacity:.55}
.mdl-svg .med{stroke:var(--surface);stroke-width:2}
.mdl-svg .s-co line{stroke:var(--s1)} .mdl-svg .s-co .med{fill:var(--s1)}
.mdl-svg .s-conr line{stroke:var(--s3)} .mdl-svg .s-conr .med{fill:var(--s3)}
.mdl-svg .s-opp line{stroke:var(--s2)} .mdl-svg .s-opp .med{fill:var(--s2)}
/* the trend */
.mdl-svg path.line{fill:none;stroke-width:2;stroke-linejoin:round}
.mdl-svg .end{font-weight:600;font-size:12px}
.mdl-svg path.s-co{stroke:var(--s1)} .mdl-svg circle.s-co,.mdl-svg text.end.s-co{fill:var(--s1)}
.mdl-svg path.s-conr{stroke:var(--s3)} .mdl-svg circle.s-conr,.mdl-svg text.end.s-conr{fill:var(--s3)}
.mdl-svg path.s-opp{stroke:var(--s2)} .mdl-svg circle.s-opp,.mdl-svg text.end.s-opp{fill:var(--s2)}
.mdl-svg [data-tip]{cursor:default}

.mdl-tip{position:absolute;pointer-events:none;background:var(--tip-bg,#313131);color:var(--tip-ink,#fff);
  font-family:var(--font);font-size:13px;line-height:1.45;padding:7px 10px;border-radius:4px;
  white-space:pre-line;max-width:min(340px,90vw);z-index:50;transform:translate(-50%,calc(-100% - 10px))}
.mdl-tip::first-line{font-weight:700}

/* ---- tables ------------------------------------------------------------------------ */
.mdl-scroll{overflow-x:auto}
table.mdl-table{border-collapse:collapse;width:100%;font-size:14px}
table.mdl-table th,table.mdl-table td{padding:7px 10px;text-align:start;border-bottom:1px solid var(--grid);
  vertical-align:top}
table.mdl-table th{font-weight:500;color:var(--muted);font-size:13px;vertical-align:bottom}
table.mdl-table td.n,table.mdl-table th.n{text-align:end;white-space:nowrap}
table.mdl-table td.name{font-weight:500;color:var(--ink)}
table.mdl-table td.name .sub{display:block;font-size:11.5px;font-weight:400;color:var(--muted)}
.mdl-pill{display:inline-block;font-size:12px;padding:1px 8px;border-radius:999px;margin:1px 0 1px 4px;
  background:var(--rose-tint);color:var(--rose-text)}
.mdl-pill.ok{background:var(--teal-band);color:var(--teal-text)}
/* A pass probability that is neither near 0 nor near 1 is the row's finding. */
.mdl-pass-mid{color:var(--rose-text);font-weight:600}

/* The turnout table: turnouts left to right like the slider, the row names at the side
   the page is read from. */
table.mdl-to{direction:ltr;min-width:600px}
table.mdl-to th,table.mdl-to td{text-align:center}
table.mdl-to .rl{text-align:start;white-space:nowrap}
table.mdl-to.rtl .rl{direction:rtl;text-align:right}
table.mdl-to.rtl td{unicode-bidi:plaintext}
/* the combinations: the pills of lists that fall need room to sit side by side */
#mdl-thresholds table.mdl-table td.name{min-width:170px}
#mdl-thresholds table.mdl-table th.n{white-space:normal;min-width:64px}
table.mdl-to .on{background:var(--teal-band);color:var(--ink);font-weight:700}

/* The small range bar inside the per-list table ("הנתונים"). */
td.mdl-range-cell{width:180px;min-width:140px}
.mdl-range{direction:ltr;position:relative;height:16px}
.mdl-range .axis{position:absolute;top:8px;inset-inline:0;height:1px;background:var(--line-soft)}
.mdl-range .r90{position:absolute;top:5px;height:7px;background:var(--teal-tint)}
.mdl-range .r80{position:absolute;top:5px;height:7px;background:var(--teal);opacity:.45}
.mdl-range .med{position:absolute;top:3px;width:10px;height:10px;margin-left:-5px;
  border-radius:50%;background:var(--teal);border:1.5px solid var(--surface)}

details.mdl-data{margin-top:12px}
details.mdl-data > summary{cursor:pointer;font-size:13px;color:var(--teal-text);width:max-content}
details.mdl-data[open] > summary{margin-bottom:8px}

/* ---- threshold combinations -------------------------------------------------------- */
.mdl-bars{direction:ltr;display:grid;gap:8px;align-items:end;height:130px;max-width:420px;margin:30px 0 4px}
.mdl-bars div{background:var(--teal);border-radius:3px 3px 0 0;position:relative;min-height:2px}
.mdl-bars div span{position:absolute;top:-20px;inset-inline:0;text-align:center;font-size:12px;
  color:var(--ink);white-space:nowrap}
.mdl-bars-x{direction:ltr;display:grid;gap:8px;max-width:420px;font-size:12px;color:var(--muted);text-align:center}
.mdl-facts{margin:14px 0 0;padding:0;list-style:none;display:grid;gap:6px;font-size:14px;color:var(--ink-2)}
.mdl-facts b{font-weight:600;color:var(--ink)}

/* ---- build a bloc ------------------------------------------------------------------ */
.mdl-note{font-size:13px;color:var(--muted);margin:0 0 10px}
.mdl-presets{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.mdl-picks-label{font-size:13px;color:var(--muted);margin:4px 0 0}
.mdl-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 14px}
.mdl-chips button{font:inherit;font-size:13px;padding:5px 11px;border-radius:999px;border:1.5px solid var(--axis);
  background:var(--surface);color:var(--ink);cursor:pointer}
.mdl-chips button.s-co{border-color:var(--s1)} .mdl-chips button.s-conr{border-color:var(--s3)}
.mdl-chips button.s-opp{border-color:var(--s2)}
.mdl-chips button[aria-pressed="true"]{color:#fff;border-color:transparent}
.mdl-chips button.s-co[aria-pressed="true"]{background:var(--s1)}
.mdl-chips button.s-conr[aria-pressed="true"]{background:var(--s3)}
.mdl-chips button.s-opp[aria-pressed="true"]{background:var(--s2)}
.mdl-bb{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:24px;align-items:start}
.mdl-bb > *{min-width:0}
@media (max-width:760px){.mdl-bb{grid-template-columns:1fr}}
.mdl-bb .mdl-stats{margin:0}
.mdl-result-line{font-size:14px;color:var(--ink-2);margin:10px 0 0}

/* ---- method ------------------------------------------------------------------------ */
.mdl-method{margin:6px 0 14px;padding-inline-start:20px;max-width:80ch;font-size:15px;line-height:1.7;color:var(--ink-2)}
.mdl-method li{margin-bottom:6px}
.mdl-method strong{color:var(--ink);font-weight:500}
.mdl-section .mdl-method-p{max-width:80ch;color:var(--ink-2);font-size:15px;line-height:1.7;margin:0 0 10px}

.mdl-error{padding:30px 20px;text-align:center;color:var(--rose-text);font-size:14px;
  background:var(--rose-tint);border:1px solid var(--rose)}
