/* The design system of every page: tokens, font, header bar, card, table, links, footer notice.
   One source for each value. The home dashboard adds static/dash.css; every other page adds static/pages.css.
   Official-site style: a navy bar with the brand, the information and the section rail, white cards with a thin header row on a light background.
   Design: Manuel Lima decides what to show, Swiss Neue Grafik how it looks, Dieter Rams is the veto.
   No gradients, no pies, no images. Faction colours are data, not style: live.json carries a neutral categorical
   palette (live.py) and dash.js paints it; the content pages name factions in text only.
   No inline styles anywhere (CSP style-src 'self'). */

@font-face { font-family: "IBM Plex Sans Hebrew"; src: url("fonts/IBMPlexSansHebrew-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Hebrew"; src: url("fonts/IBMPlexSansHebrew-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Hebrew"; src: url("fonts/IBMPlexSansHebrew-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #eef1f6; --card: #fff; --line: #dbe2ec; --ink: #1b2430; --mute: #5d6878; --head: #0b2a5b; --blue: #1d5fd0;
  --ok: #14853f; --no: #c62828; --ab: #b58300; --live: #6d28d9; --cmt: #e07b39; --track: #e9eef5; --absent: .16;
  --topbg: #0b2a5b; --topink: #fff; --warn: #ffd54f; --warnink: #3b2f00;
  --font: "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --gap: .6rem;               /* between cards, and the page's edge */
  --pad-x: .8rem;             /* inside a card, left and right */
  --pad-y: .6rem;             /* the body of a card, top and bottom */
  --row-y: .42rem;            /* a list or table row, top and bottom */
  --radius: .5rem; --radius-s: .3rem;
  /* weekly toxicity levels 1-5, amber. Not party colours. */
  --tox-1: #FAEEDA; --tox-2: #FAC775; --tox-3: #EF9F27; --tox-4: #BA7517; --tox-5: #854F0B;
}
body.tv {
  --bg: #07122a; --card: #0e1d3d; --line: #1d3160; --ink: #e9eefb; --mute: #93a3c4; --head: #fff; --blue: #4d8eff;
  --ok: #2ebd6b; --no: #ff5a52; --ab: #e0a800; --live: #b794ff; --track: #17284d; --absent: .2; --topbg: #040b1c;
}
body.staging { --topbg: #0d5c32; }       /* review builds only: a green bar, never the public navy */
body.staging.tv { --topbg: #083d22; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--ink); }
body.tv ::selection { background: color-mix(in srgb, var(--blue) 32%, transparent); color: var(--ink); }
html { font-size: clamp(12px, .55vw + 6px, 28px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: color-mix(in srgb, var(--mute) 45%, transparent) transparent; }
body { margin: 0; width: 100%; max-width: 100%; overflow-x: clip; min-height: 100vh; min-height: 100dvh; font-family: var(--font); background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; font-feature-settings: "tnum" 1; }
h1, h2, h3, p, ul { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
code { font-family: inherit; font-size: .92em; overflow-wrap: anywhere; }
span[dir="ltr"], code.nw { white-space: nowrap; }  /* a figure, or a short code sample, never breaks across lines */
.vh:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Links: the text colour, underlined; a table cell that is only a link is plain until pointed at */
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.top a:focus-visible, .top button:focus-visible, .top select:focus-visible, .top input:focus-visible { outline-color: var(--warn); }
.stale a:focus-visible { outline-color: var(--warnink); }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; inset-inline-start: .6rem; top: .4rem; z-index: 10; background: var(--card); color: var(--ink); padding: .4rem .7rem; border-radius: var(--radius-s); }

/* Header bar: information only (brand, and on the home the clock and controls), frozen at the top while the page scrolls.
   The section menu is the rail under it on the right (the start side of this right-to-left site): symbols only while
   collapsed, symbols and labels expanded. The state is the checkbox before the header (#menu-toggle), so it needs no
   script. Expanded, the rail covers the page's edge; the page keeps a fixed gap for the collapsed rail only. */
:root { --rail-w: 3.5rem; --rail-open: 12.5rem; scroll-padding-top: 4.5rem; }
.top { position: sticky; top: 0; z-index: 30; width: 100%; max-width: 100%; background: var(--topbg); color: var(--topink); display: flex; align-items: center; gap: .4rem 1.2rem; padding: .5rem 1rem; flex-wrap: wrap; min-height: 3.3rem; }
.top-row { display: flex; flex: 0 1 auto; align-items: center; flex-wrap: wrap; gap: .4rem 1.2rem; min-width: 0; }
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; position: relative; }
.brand::after { content: ""; position: absolute; inset: -.5rem -.3rem; }  /* a hit area of at least 24 px on a pointer screen, drawn outside the label */
.menu-toggle { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.menu-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin-inline-start: -.5rem; border-radius: var(--radius-s); cursor: pointer; transition: background-color 130ms ease; }
.menu-btn:hover { background: #ffffff26; }
.menu-toggle:focus-visible ~ .top .menu-btn { outline: 2px solid var(--warn); outline-offset: 2px; }
.ic { width: 1.4rem; height: 1.4rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail { position: absolute; top: 100%; inset-inline-start: 0; z-index: 2; width: var(--rail-w); overflow: hidden; display: flex; flex-direction: column; gap: .15rem; padding: .3rem .3rem .5rem;
  background: var(--topbg); color: var(--topink); border-end-start-radius: var(--radius); box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 22%, transparent); transition: width 160ms ease; }
.menu-toggle:checked ~ .top .rail { width: var(--rail-open); }
.rail a { position: relative; display: flex; align-items: center; gap: .85rem; min-height: 2.75rem; padding-inline: .7rem; border-radius: var(--radius-s); text-decoration: none; white-space: nowrap; opacity: .82; transition: opacity 130ms ease, background-color 130ms ease; }
.rail a:hover { opacity: 1; background: #ffffff1f; }
.rail a[aria-current="page"] { opacity: 1; font-weight: 500; background: #ffffff2e; box-shadow: inset -3px 0 0 currentColor; }
.rail a:focus-visible { outline: 2px solid var(--warn); outline-offset: -2px; }
/* Collapsed: the label leaves the screen but stays in the page, so the symbol keeps its name */
.rail a > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.menu-toggle:checked ~ .top .rail a > span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.rail .xlogo { width: 1.25rem; height: 1.25rem; flex: none; vertical-align: baseline; margin-inline: .075rem; color: currentColor; }  /* .xlogo alone is dark ink: unreadable on the bar */
body > main[id], body > .stale { padding-inline-start: calc(var(--gap) + var(--rail-w)); }  /* [id]: outranks .page and .grid, which set their own padding */
body > .stale { padding-inline-start: calc(1rem + var(--rail-w)); }
body > .indep { padding-inline-start: calc(max(16px, calc(var(--gap) + var(--pad-x))) + var(--rail-w)); }
/* The TV wall and a fullscreen window are the monitoring screens: no menu, the bar is information only there too */
body.monitor { --rail-w: 0px; }
body.monitor .menu-btn, body.monitor .rail { display: none; }

/* The bar's status on every page of the current season: the ON AIR sign and the clock (in .top-row), then the date (and on the
   home the data time and controls). Filled by static/dash.js on the home and static/topbar.js elsewhere. Beside the brand on a
   wide screen; .stamp only groups the date and the data time, so it takes no box there. */
.stamp { display: contents; }
.chip { display: flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .85rem; background: #ffffff1a; padding: .2rem .6rem; border-radius: 1rem; white-space: nowrap; }
.chip.warn { background: var(--warn); color: var(--warnink); }
.pulse { width: .6rem; height: .6rem; border-radius: 50%; background: var(--live); animation: p 1.4s infinite; }
.chip.replay .pulse { animation: none; border-radius: .1rem; background: var(--warn); }
.chip.off .pulse { animation: none; background: #ffffff66; }
.chip.on-air { background: var(--no); color: var(--card); border-radius: var(--radius-s);
  padding: .4rem .8rem; font-size: 1rem; font-weight: 700; letter-spacing: .06em; direction: ltr; }
.chip.on-air .pulse { background: currentColor; animation: none; }
@keyframes p { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); }
  70% { box-shadow: 0 0 0 .5rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.clock { font-size: 1.9rem; line-height: 1.2; font-weight: 700; letter-spacing: .02em; }
.date { opacity: .85; font-size: .95rem; }
.asof { opacity: .75; font-size: .8rem; }

/* Card: a thin header row with the title, then a body, a list or a note */
.w { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.w > h1, .w > h2, .w > h3 { margin: 0; font-size: .85rem; font-weight: 500; color: var(--mute); padding: .5rem var(--pad-x); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; }
.w > h1 { font-size: 1.15rem; font-weight: 700; color: var(--head); }
.w > h1 + .note, .w > h2 + .note, .w > h3 + .note { padding-top: var(--pad-y); }
.w > h2 .k { margin-inline-start: auto; display: flex; gap: .7rem; font-size: .75rem; font-weight: 400; overflow: hidden; }
.w > h2 .k > span { display: flex; align-items: center; gap: .25rem; }
.w > h2 .c { color: var(--head); font-weight: 700; }
.body { flex: 1; min-height: 0; padding: var(--pad-y) var(--pad-x); display: flex; flex-direction: column; }
.note { padding: 0 var(--pad-x) var(--pad-y); font-size: .85rem; line-height: 1.5; color: var(--mute); overflow-wrap: anywhere; }
.note p + p, .note ul + p, .note p + ul { margin-top: .4rem; }
.note ul { padding-inline-start: 1.2rem; }
.note li + li { margin-top: .3rem; }
.list { flex: 1; overflow: auto; padding: 0; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--mute) 45%, transparent) transparent; position: relative; }
.list[tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.empty { color: var(--mute); font-size: max(13px, .85rem); padding: .6rem .8rem; }
.sb { color: var(--mute); font-size: .78rem; }
.big { font-size: 4.2rem; font-weight: 700; color: var(--head); line-height: 1; }
.big small { font-size: 1.4rem; color: var(--mute); font-weight: 400; }

/* Table inside a card: the dashboard's rows, a hairline between them, figures tabular, the head row quiet */
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
caption { text-align: start; font-size: .75rem; color: var(--mute); padding: var(--row-y) var(--pad-x); border-bottom: 1px solid var(--line); }
th { font-size: .75rem; font-weight: 500; text-align: start; color: var(--mute); padding: var(--row-y) var(--pad-x); border-bottom: 1px solid var(--line); vertical-align: middle; }
td { padding: var(--row-y) var(--pad-x); border-bottom: 1px solid var(--line); vertical-align: middle; text-align: start; }
tbody tr:last-child td { border-bottom: 0; }
td, th { overflow-wrap: anywhere; }
th.n, td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Rank column: room for three digits and a change triangle beside the cell padding (border-box), units aligned, never wrapped */
th.rk, td.rk { width: 5.2rem; min-width: 5.2rem; white-space: nowrap; text-align: start; color: var(--mute); font-variant-numeric: tabular-nums; }
td > a:only-child { text-decoration: none; }
td > a:only-child:hover { text-decoration: underline; }

/* The notice on every page: independent, unofficial, draft */
.indep { font-size: max(12px, .78rem); color: var(--mute); padding: .2rem max(16px, calc(var(--gap) + var(--pad-x))) .5rem; }
.indep p + p { margin-top: .2rem; }
.indep .draft { font-weight: 500; color: var(--ink); }
.indep a { padding-block: .45rem; }  /* the links sit in a sentence: padding widens the hit area, not the line */

@media (max-width: 699px) {
  html { font-size: 14px; }
  :root { --rail-w: 0px; }
  /* The bar alone is frozen on a phone (the home's controls scroll away): the header itself is no box */
  .top { display: contents; }
  .top-row { position: sticky; top: 0; z-index: 30; flex: none; width: 100%; gap: .2rem .4rem; padding: .35rem .6rem; background: var(--topbg); color: var(--topink); }
  .brand { display: inline-flex; align-items: center; justify-content: center; align-self: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; font-size: 16px; }
  .menu-btn { width: 44px; height: 44px; margin-inline-start: -.2rem; }
  .brand::after { content: none; }
  /* The hamburger opens a panel under the bar: every target is at least 44 px and the labels are shown */
  .rail { display: none; inset-inline: 0; width: auto; border-radius: 0; padding: .4rem .6rem .7rem; }
  .menu-toggle:checked ~ .top .rail { display: flex; width: auto; }
  .rail a { min-height: 48px; font-size: 1rem; padding-inline: .8rem; }
  .rail a > span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .rail a[aria-current="page"] { text-decoration: none; }
  .indep a { padding-block: .95rem; }
  /* The status beside the brand in the frozen bar; the date is a row of its own under it and scrolls away with the page */
  .clock { font-size: 1.5rem; order: 2; }
  .chip { order: 2; }
  .stamp { display: flex; align-items: baseline; flex: none; width: 100%; gap: .2rem .6rem; flex-wrap: wrap; padding: .1rem .6rem .2rem; background: var(--topbg); color: var(--topink); }
  .date { flex: 1 1 auto; min-width: 0; }
  .date, .asof, .chip { font-size: 14px; }
  .indep a.foot-new { padding-block: .95rem; }  /* the What's new link: a 44 px target on a phone */
  .w > h2, .w > h3 { font-size: 16px; }
  .w > h2 .k, .sb { font-size: 14px; }
  .note, .empty { font-size: 16px; line-height: 1.5; }
  .indep { font-size: 14px; line-height: 1.5; }
  .big { font-size: 3.2rem; }
}
@media print {
  .rail, .menu-btn, .menu-toggle, .skip { display: none; }
  .top { position: static; }
  .w { break-inside: avoid; }
}

/* Posts of MKs on X (static/x-feed.js): the dashboard strip, the X page and the profile card share these rows. */
.xstatus { margin: 0; padding: .4rem var(--pad-x); font-size: max(12px, .8rem); color: var(--mute); border-bottom: 1px solid var(--line); }
#xList, .xall { list-style: none; margin: 0; padding: 0; }
.xp { display: flex; gap: .55rem; padding: .6rem var(--pad-x); border-bottom: 1px solid var(--line); }
.xp.new { animation: xnew 2.4s cubic-bezier(.16, 1, .3, 1); }
@keyframes xnew { 0% { opacity: 0; transform: translateY(-.4rem); background: color-mix(in srgb, var(--blue) 14%, transparent); } 12% { opacity: 1; transform: translateY(0); } 100% { background: transparent; } }
.xa { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.xa img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.xi { font-weight: 700; color: var(--mute); }
.xm { min-width: 0; flex: 1; }
.xn { color: var(--head); text-decoration: none; overflow-wrap: anywhere; font-size: max(13px, .9rem); }
.xn:hover b { text-decoration: underline; }
.xu, .xf { color: var(--mute); font-size: max(12px, .8rem); }
.xu { direction: ltr; unicode-bidi: isolate; text-decoration: none; }
.xu:hover { text-decoration: underline; }
.xh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4rem; }
.xf a { color: inherit; }
.xt { margin: .2rem 0 .3rem; font-size: max(14px, .9rem); line-height: 1.45; max-width: 75ch; white-space: pre-wrap; overflow-wrap: anywhere; text-align: right; }
.xt a.xe { color: var(--blue); text-decoration: none; unicode-bidi: isolate; }
.xt a.xe:hover { text-decoration: underline; }
.xexp { display: none; background: none; border: none; padding: 0; margin: -.1rem 0 .25rem; min-height: 24px; font: inherit; font-size: max(12px, .8rem); font-weight: 500; color: var(--blue); cursor: pointer; }
.xexp:hover { text-decoration: underline; }
.xf { display: flex; gap: .8rem; align-items: baseline; }
.xf .xv { margin-inline-start: auto; }
#xList .empty, .xall .empty { padding: .8rem var(--pad-x); color: var(--mute); }
.xmore { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .5rem var(--pad-x); font-size: .85rem; border-top: 1px solid var(--line); }
.xmore a { display: inline-flex; align-items: center; min-height: 24px; }
.xmore button { font: inherit; min-height: 24px; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color 130ms ease, color 130ms ease, background-color 130ms ease; }
.xmore button:hover { border-color: var(--blue); color: var(--blue); }
.xlogo { display: inline-block; vertical-align: -1px; color: var(--ink); line-height: 1; }
.xmore .xlogo { margin-inline-start: auto; }
@media (max-width: 699px) { .xexp, .xmore a, .xmore button { min-height: 44px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .pulse, .xp.new { animation: none; } .rail, .rail a, .menu-btn, .xmore button { transition: none; } }

/* A member's name links to the member's page and is underlined only while hovered or focused. Numbers and
   other links keep their underline. (The match is the link target mk/<id>.html, so it covers every table,
   the standings, the seat tooltip and the script-built links alike.) */
a[href$=".html"][href*="mk/"]:not([href$="index.html"]) { text-decoration: none; }
a[href$=".html"][href*="mk/"]:not([href$="index.html"]):is(:hover, :focus-visible),
a.member-link:is(:hover, :focus-visible) > span:last-child { text-decoration: underline; }

/* Party marks (the 26th Knesset's scoreboard marks, static/marks/): a 24 px square beside a faction's name, decorative.
   Two images per mark, one for light surfaces and one for dark; the TV screen is the one dark surface. */
.mark-wrap { display: inline-flex; flex: none; align-items: center; }
.mark { flex: none; width: 24px; height: 24px; vertical-align: middle; }
.mark-dark, body.tv .mark-light { display: none; }
body.tv .mark-dark { display: inline-block; }
.fac-cell { display: inline-flex; align-items: center; gap: .45rem; }
/* In running text (the MK card's meta line) the pair stays inline on the text baseline and the 24px mark does not make the line taller. */
td > .fac-cell { vertical-align: middle; }  /* in a table cell the pair centres with the other cells' text, not on a baseline the 24px mark skews */
.meta .fac-cell { display: inline; }
.meta .mark-wrap { display: inline-block; vertical-align: middle; margin-block: -.35rem; margin-inline-end: .4rem; }
