/* ===========================================================================
   חוק פתוח — "Open Daylight"
   ---------------------------------------------------------------------------
   A warm, optimistic civic identity built to make legislation feel handled
   with care — and inviting to people who'd never think to read a law.
     · Palette : ivory paper, midnight ink for trust, saffron for energy.
     · Type    : Heebo (sans) carries the UI via weight (800 display, 400 body);
                 Frank Ruhl Libre is the serif reading face for the law text.
     · Signature: a highlighter swipe under the word that matters.
   Hebrew, RTL. No build step — HTMX + server-rendered Jinja only.
   =========================================================================== */

/* Self-hosted variable fonts — no third-party CDN (privacy + offline-safe), one
   file per family covers the whole weight range. Hebrew + Latin subsets only. */
@font-face {
  font-family: "Heebo"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/heebo-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Heebo"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/heebo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/frankruhl-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/frankruhl-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:           #faf6ee;   /* warm ivory paper */
  --surface:      #ffffff;
  --surface-2:    #f4efe3;
  --ink:          #1f1b16;   /* warm near-black */
  --ink-soft:     #6c6457;
  --ink-faint:    #9b9182;
  --line:         #e8e1d2;
  --line-strong:  #d6ccb8;

  /* Brand / structure — a deep midnight that reads as credible and calm. */
  --primary:      #16284f;
  --primary-dark: #0f1c3a;
  --primary-soft: #e4e8f1;

  /* Energy — saffron daylight. CTAs, highlights, the spark. */
  --accent:       #f5a000;
  --accent-strong:#945800;   /* accent-coloured *text*: AA (>=4.5:1) on accent-soft + white */
  --accent-soft:  #fdeecb;

  /* The base semantic colours double as small badge/pill *text* on their own
     -soft tints, so they're tuned dark enough to clear WCAG AA (4.5:1) there.
     Dark mode overrides them below with its own AA-safe set. */
  --ok:    #157a45;  --ok-soft:    #e1f2e7;
  --stop:  #aa372f;  --stop-soft:  #f8e6e3;
  --merge: #6f4cb8;  --merge-soft: #ece4f8;
  --warn:  #7f590d;  --warn-soft:  #f7eed6;

  /* Item-kind accents (agenda = teal, committee = slate). Two shades each: the
     softer reads as a tile accent, the deeper as chip text/border. */
  --c-agenda:    #1aa0a8;  --c-agenda-chip:    #14868d;
  --c-committee: #64748b;  --c-committee-chip: #56616e;

  /* Type scale — one ramp instead of ~40 ad-hoc rem values. Display/decorative
     one-offs (hero, page heads, the § watermark) keep their responsive clamp()s. */
  --fs-2xs:  .72rem;
  --fs-xs:   .82rem;
  --fs-sm:   .9rem;
  --fs-base: .95rem;
  --fs-md:   1rem;
  --fs-lg:   1.1rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;

  --r:    16px;
  --r-sm: 10px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(31,27,22,.06);
  --shadow:    0 2px 4px rgba(31,27,22,.05), 0 12px 32px rgba(31,27,22,.08);
  --shadow-lg: 0 8px 24px rgba(31,27,22,.10), 0 24px 60px rgba(22,40,79,.12);
  --maxw: 1140px;

  /* Heebo is the UI/display face (weight carries hierarchy). Frank Ruhl Libre is
     a genuine Hebrew serif used for the long-form reading column (law text,
     summaries) — both self-hosted, with robust local fallbacks. */
  --font-body: "Heebo", "Rubik", "Assistant",
               "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew",
               Arial, system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-serif: "Frank Ruhl Libre", "Noto Serif Hebrew", "David Libre",
               "Times New Roman", Georgia, serif;

  color-scheme: light;
}

/* --- Dark mode — "Open Daylight at night": deep midnight, warm light text -- */
[data-theme="dark"] {
  --bg:           #0d1018;
  --surface:      #161b26;
  --surface-2:    #1f2532;
  --ink:          #ece7dc;
  --ink-soft:     #9aa0ab;
  --ink-faint:    #6b727f;
  --line:         #28303d;
  --line-strong:  #3a4452;

  --primary:      #7ea2f0;
  --primary-dark: #a4c0f7;
  --primary-soft: #1b2740;

  --accent:       #ffb52e;
  --accent-strong:#ffc659;
  --accent-soft:  #3a2c12;

  --ok:    #3ac774;  --ok-soft:    #16331f;
  --stop:  #e26358;  --stop-soft:  #381c1a;
  --merge: #a584e8;  --merge-soft: #281d40;
  --warn:  #d9a850;  --warn-soft:  #352a16;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.34);
  --shadow:    0 2px 4px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5), 0 26px 64px rgba(0,0,0,.55);

  color-scheme: dark;
}

/* --ink-soft (not --ink-faint) for any real text: faint fails WCAG AA contrast,
   so it's reserved for decorative, aria-hidden marks only (e.g. the search icon). */
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 1; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;          /* fallback for browsers without `clip` (below) */
  overflow-x: clip;            /* let hero backgrounds bleed full-width safely */
}

/* A whisper of paper grain so flat fills never look plastic. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .03;
}
[data-theme="dark"] body::before { opacity: .045; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; letter-spacing: -0.01em; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.muted { color: var(--ink-soft); font-size: var(--fs-base); }

.visually-hidden, .skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
  position: static; width: auto; height: auto; clip: auto;
  display: inline-block; margin: 8px; padding: 8px 14px;
  background: var(--primary); color: #fff; border-radius: var(--r-sm);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Header ---------------------------------------------------------------- */
.site-header {
  background: var(--surface);   /* fallback where color-mix() is unsupported */
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; gap: 22px;
  padding-block: 13px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  border-radius: 13px; font-family: var(--font-display); font-weight: 800;
  font-size: 1.6rem; line-height: 1;
  box-shadow: inset 0 0 0 2px var(--accent);  /* color-mix fallback */
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 75%, transparent);
}
.brand__mark--sm { width: 38px; height: 38px; font-size: var(--fs-xl); border-radius: 11px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); color: var(--ink); }
.brand__tag { font-size: var(--fs-2xs); color: var(--ink-soft); }

.site-nav { display: flex; gap: 2px; margin-inline-start: 8px; }
.site-nav a {
  color: var(--ink-soft); font-weight: 500; font-size: var(--fs-base);
  padding: 8px 13px; border-radius: var(--r-sm);
  letter-spacing: -0.01em; word-spacing: -0.06em; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.header-search {
  display: flex; flex: 1; min-width: 200px; max-width: 360px;
  margin-inline-start: auto;
}
.header-search input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong); border-inline-end: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 9px 14px; font: inherit; font-size: var(--fs-base);
  background: var(--surface-2); color: var(--ink);
}
/* A visible focus ring (not just a border-colour change) — WCAG 2.4.7. The
   z-index lifts the halo above the adjoining button. */
.header-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); position: relative; z-index: 1; }
.header-search button {
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  padding-inline: 13px; cursor: pointer; display: grid; place-items: center;
  transition: background-color .15s;
}
.header-search button:hover { background: var(--primary-dark); }
/* On the home page the hero owns search — keep the masthead clean. */
body[data-page="home"] .header-search { display: none; }

.theme-toggle {
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 7px 10px; cursor: pointer;
  color: var(--ink-soft); display: grid; place-items: center;
  margin-inline-start: 4px; transition: background-color .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  margin-top: 72px; padding-block: 36px;
  background: var(--surface); border-top: 1px solid var(--line);
  position: relative;
}
.site-footer::before {
  content: ""; position: absolute; inset: -1px 0 auto 0; height: 3px;
  background: linear-gradient(to left, var(--accent), var(--primary) 70%);
}
.site-footer__inner {
  display: grid; gap: 16px 32px; align-items: center;
  grid-template-columns: 1fr auto;
}
.site-footer__brand { display: flex; align-items: center; gap: 12px; }
.site-footer__main { font-family: var(--font-display); font-weight: 700; margin: 0; font-size: var(--fs-lg); }
.site-footer__brand p { margin: 0; }
.site-footer__nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer__nav a { color: var(--ink-soft); font-weight: 500; }
.site-footer__nav a:hover { color: var(--primary); }
.site-footer__fine { grid-column: 1 / -1; margin: 0; max-width: 640px; font-size: var(--fs-sm); }

main.wrap { padding-block: 16px 8px; min-height: 60vh; transition: opacity 0.12s ease; }
main.wrap.htmx-swapping { opacity: 0; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-block; background: var(--primary); color: #fff;
  font-weight: 700; padding: 12px 24px; border-radius: 999px;
  border: none; cursor: pointer; font-size: var(--fs-md);
  transition: background-color .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--accent { background: var(--accent); color: #1f1b16; }
.btn--accent:hover { background: var(--accent-strong); color: #1f1b16; }
.btn--ghost {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary); padding: 10px 22px;
}
.btn--ghost:hover { background: var(--primary); color: #fff; }

/* --- Hero (home) ----------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  padding-block: clamp(40px, 8vw, 92px) clamp(36px, 6vw, 64px);
  text-align: center;
}
/* Full-bleed warm daylight band behind the hero, kept off the layout. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  margin-inline: calc(50% - 50vw); z-index: -1;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 70%);  /* color-mix fallback */
  background:
    radial-gradient(60% 80% at 82% -10%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(70% 90% at 12% 0%, color-mix(in srgb, var(--primary) 12%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)) 0%, var(--bg) 92%);
  border-bottom: 1px solid var(--line);
}
/* A faint oversized § watermark — the mark of the law, in daylight. */
.hero::after {
  content: "§"; position: absolute; z-index: -1;
  top: 50%; inset-inline-start: 50%; transform: translate(50%, -52%);
  font-family: var(--font-display); font-weight: 800; font-size: 30rem; line-height: 1;
  color: var(--primary); opacity: .04; pointer-events: none;
}
.hero__inner { max-width: 760px; margin-inline: auto; padding-inline: 22px; }

.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.05;
  letter-spacing: -0.02em; margin: 0 0 18px; color: var(--ink);
}
/* The signature: a saffron highlighter swipe behind the key phrase. */
.h-mark {
  position: relative; white-space: nowrap;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 100% 86%;
  background-size: 100% 34%;
  padding-inline: .12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero__sub {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem); line-height: 1.7;
  color: var(--ink-soft); margin: 0 auto 30px; max-width: 600px;
}

.hero__search {
  display: flex; align-items: center; max-width: 620px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--line-strong);
  border-radius: 999px; padding: 6px 6px 6px 6px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.hero__search:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft);
}
.hero__search-icon { color: var(--ink-faint); flex: none; margin-inline: 14px 2px; }
.hero__search input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font: inherit; font-size: var(--fs-lg); padding: 12px 8px; color: var(--ink);
}
.hero__search input:focus { outline: none; }
.hero__search button {
  flex: none; border: none; background: var(--primary); color: #fff;
  font-weight: 700; font-size: var(--fs-md); padding: 13px 30px; border-radius: 999px;
  cursor: pointer; transition: background-color .15s;
}
.hero__search button:hover { background: var(--primary-dark); }

.hero__topics {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 9px; margin-top: 22px;
}
.hero__topics-label { font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 600; }
.topic-chip {
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink);
  background: var(--surface);  /* color-mix fallback */
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 15px; transition: all .14s;
}
.topic-chip:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
  text-decoration: none; transform: translateY(-1px);
}

/* Quiet scale row at the foot of the hero — part of the front door, not a strip
   before it. Centred, thin dividers, subdued so the title and search stay the
   loudest things on the screen. */
.hero__stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 40px; margin-top: clamp(30px, 5vw, 48px);
}
.hero__stat { position: relative; text-align: center; min-width: 0; }
.hero__stat strong {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.05; color: var(--ink);
}
.hero__stat span { font-size: var(--fs-sm); color: var(--ink-soft); }
.hero__stat + .hero__stat::before {  /* centred in the 40px column gap */
  content: ""; position: absolute; inset-block: 5px; inset-inline-start: -20px;
  width: 1px; background: var(--line);
}
a.hero__stat { text-decoration: none; transition: transform .12s; }
a.hero__stat:hover { transform: translateY(-2px); }
a.hero__stat:hover strong { color: var(--accent-strong); }

/* Orchestrated page-load reveal — one moment of delight, gated for a11y. */
@media (prefers-reduced-motion: no-preference) {
  .hero__title   { animation: rise .55s cubic-bezier(.2,.7,.3,1) .07s both; }
  .hero__sub     { animation: rise .55s cubic-bezier(.2,.7,.3,1) .14s both; }
  .hero__search  { animation: rise .55s cubic-bezier(.2,.7,.3,1) .21s both; }
  .hero__topics  { animation: rise .55s cubic-bezier(.2,.7,.3,1) .28s both; }
  .hero__stats   { animation: rise .55s cubic-bezier(.2,.7,.3,1) .34s both; }
  .featured      { animation: rise .55s cubic-bezier(.2,.7,.3,1) .40s both; }
  .h-mark { animation: mark-swipe .7s cubic-bezier(.6,0,.3,1) .5s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mark-swipe { from { background-size: 0 34%; } to { background-size: 100% 34%; } }

/* Scroll-reveal for below-the-fold blocks. Armed only when JS is present and
   motion is welcome, so it can never leave content hidden (see enhance.js). */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0; transform: translateY(22px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1);
    will-change: opacity, transform;
  }
  .js [data-reveal].in { opacity: 1; transform: none; }
}

/* --- Featured law (home hero card) ----------------------------------------- */
.featured {
  position: relative; background: var(--surface); border-radius: var(--r-lg);
  margin-top: 30px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); overflow: hidden;
}
.featured__ribbon {
  display: inline-flex; align-items: center; gap: 8px;
  position: absolute; top: 0; inset-inline-start: 28px;
  background: var(--accent); color: #1f1b16;
  font-weight: 700; font-size: var(--fs-xs); letter-spacing: .01em;
  padding: 7px 16px 8px; border-radius: 0 0 12px 12px;
}
.featured__body { padding: 44px 34px 30px; }
.featured__eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 500;
}
.featured__when { color: var(--accent-strong); font-weight: 700; }
[data-theme="dark"] .featured__when { color: var(--accent); }
.featured__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.35rem); line-height: 1.18;
  margin: 8px 0 20px; letter-spacing: -0.015em;
}
.featured__title a { color: var(--ink); }
.featured__title a:hover { color: var(--primary); text-decoration: none; }
.featured__timeline { margin: 4px 0 6px; }
.featured__summary {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-lg); line-height: 1.9; color: var(--ink); margin: 22px 0;
  border-inline-start: 4px solid var(--accent); padding-inline-start: 20px;
}
.featured__meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 16px 0 24px; font-size: var(--fs-base); }
.featured__meta-item .muted { color: var(--ink-soft); margin-inline-end: 4px; }
.featured__actions { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.featured__cta {
  display: inline-block; background: var(--primary); color: #fff;
  font-weight: 700; padding: 12px 26px; border-radius: 999px;
  transition: background-color .15s, transform .12s, box-shadow .15s;
}
.featured__cta:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.featured__hint { font-size: var(--fs-base); color: var(--ink-soft); }
.featured__hint:hover { color: var(--accent-strong); }

/* --- Stats strip ----------------------------------------------------------- */
.stat-strip {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-around;
  background: var(--primary); color: #fff;
  border-radius: var(--r); padding: 24px 26px; margin-top: 28px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 140% at 90% -20%, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 60%);
}
.stat-strip__item { text-align: center; min-width: 120px; position: relative; z-index: 1; }
.stat-strip__item + .stat-strip__item::before {
  content: ""; position: absolute; inset-block: 6px; inset-inline-start: -9px;
  width: 1px; background: rgba(255,255,255,.18);
}
.stat-strip__item strong {
  display: block; font-family: var(--font-display); font-weight: 800; font-size: 2rem;
  line-height: 1.05; color: #fff;
}
.stat-strip__item span { font-size: var(--fs-sm); color: rgba(255,255,255,.78); }
[data-theme="dark"] .stat-strip { background: var(--surface-2); border: 1px solid var(--line); }
[data-theme="dark"] .stat-strip__item strong { color: var(--ink); }
[data-theme="dark"] .stat-strip__item span { color: var(--ink-soft); }

/* --- Home sections --------------------------------------------------------- */
.home-section { margin-top: 56px; }
.home-section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.home-section__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem); margin: 0;
  display: flex; align-items: center; gap: 12px;
}
.home-section__title::before {
  content: ""; width: 6px; height: .92em; border-radius: 3px;
  background: var(--accent); flex: none;
}
.seemore { font-weight: 600; font-size: var(--fs-base); white-space: nowrap; }
.seemore:hover { color: var(--accent-strong); }

/* --- Browse tiles ---------------------------------------------------------- */
.tiles {
  display: grid; gap: 16px;
  /* Six entry points read best as a balanced 3×2 — bigger, friendlier
     targets than a 4+2 orphan row. */
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.tile {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  --tile-accent: var(--primary);
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--tile-accent);
}
.tile:hover {
  transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none;
  border-color: var(--tile-accent);
}
/* Name leads: the tile answers "where do I want to look?" first; the count is
   a quiet supporting detail, not a second wall of big numbers under the strip. */
.tile__name {
  font-family: var(--font-display); font-weight: 800; line-height: 1.1;
  font-size: var(--fs-2xl); color: var(--ink);
}
.tile__count {
  font-size: var(--fs-sm); font-weight: 700; line-height: 1;
  color: var(--tile-accent); margin-bottom: 4px;
}
.tile__desc { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 2px; }
.tile__go {
  margin-top: auto; padding-top: 12px; align-self: flex-start;
  color: var(--tile-accent); font-weight: 700; font-size: var(--fs-xl);
  opacity: 0; transform: translateX(6px); transition: opacity .15s, transform .15s;
}
.tile:hover .tile__go { opacity: 1; transform: none; }
.tile--bill              { --tile-accent: var(--primary); }
.tile--secondary_law     { --tile-accent: var(--merge); }
.tile--agenda            { --tile-accent: var(--c-agenda); }
.tile--query             { --tile-accent: var(--accent-strong); }
.tile--committee_session { --tile-accent: var(--c-committee); }
.tile--plenum_session    { --tile-accent: var(--ok); }

/* --- Activity feed --------------------------------------------------------- */
.feed {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden;
}
.feed__row {
  display: grid; grid-template-columns: 104px max-content 1fr; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: center;
  transition: background-color .12s;
}
.feed__row:last-child { border-bottom: none; }
.feed__row:hover { background: var(--surface-2); }
.feed__when { color: var(--ink-soft); font-size: var(--fs-sm); white-space: nowrap; }
.feed__badge {
  font-size: var(--fs-2xs); font-weight: 700; padding: 4px 11px; border-radius: 999px;
  white-space: nowrap; background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.feed__badge--ok    { background: var(--ok-soft);      color: var(--ok); }
.feed__badge--prog  { background: var(--primary-soft); color: var(--primary); }
.feed__badge--stop  { background: var(--stop-soft);    color: var(--stop); }
.feed__badge--merge { background: var(--merge-soft);   color: var(--merge); }
.feed__name {
  color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed__name:hover { color: var(--primary); }

/* --- Home CTA -------------------------------------------------------------- */
.home-cta {
  margin-top: 56px; border-radius: var(--r-lg); padding: 36px 40px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  background: var(--surface);  /* color-mix fallback */
  background:
    radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 58%);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.home-cta__text { flex: 1; min-width: 260px; }
.home-cta__text h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); margin: 0 0 6px; }
.home-cta__text p { margin: 0; color: var(--ink-soft); font-size: var(--fs-md); }

/* --- Page heading (inner pages) -------------------------------------------- */
.page-head { margin: 8px 0 26px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 6px;
}
.page-head__sub { color: var(--ink-soft); margin: 0; font-size: var(--fs-md); max-width: 680px; }

/* --- Result cards ---------------------------------------------------------- */
.results-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.results-grid--tight { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }

.card-item {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 19px;
  box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .13s, box-shadow .13s, border-color .13s;
}
.card-item::before {
  content: ""; position: absolute; inset-block: 16px; inset-inline-start: 0;
  width: 3px; border-radius: 0 3px 3px 0; background: transparent; transition: background-color .13s;
}
.card-item:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--line-strong); text-decoration: none;
}
.card-item:hover::before { background: var(--accent); }
.card-item__head { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
/* Stage pills can carry long labels (e.g. "לדיון במליאה לקראת קריאה שנייה-שלישית");
   let them wrap inside the card instead of spilling past its edge. */
.card-item__head .pill { white-space: normal; max-width: 100%; }
.card-item__title { font-weight: 700; font-size: var(--fs-lg); margin: 0; line-height: 1.4; }
.card-item__meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  color: var(--ink-soft); font-size: var(--fs-sm); margin-top: auto;
}

/* --- Badges & pills -------------------------------------------------------- */
.badge { font-size: var(--fs-2xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge--bill              { background: var(--primary-soft); color: var(--primary); }
.badge--secondary_law     { background: var(--merge-soft);   color: var(--merge); }
.badge--agenda            { background: #d9eff0;             color: #126b71; }
.badge--query             { background: var(--accent-soft);  color: var(--accent-strong); }
.badge--committee_session { background: var(--surface-2);    color: var(--ink-soft); }
.badge--plenum_session    { background: var(--ok-soft);      color: var(--ok); }
.badge--ai                { background: var(--merge-soft);   color: var(--merge); }

.pill { font-size: var(--fs-2xs); font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-soft); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.pill--ok      { background: var(--ok-soft);      color: var(--ok); }
.pill--prog    { background: var(--primary-soft); color: var(--primary); }
.pill--stop    { background: var(--stop-soft);    color: var(--stop); }
.pill--merge   { background: var(--merge-soft);   color: var(--merge); }
.pill--neutral { background: var(--surface-2);    color: var(--ink-soft); }

/* --- Search & browse layout ----------------------------------------------- */
.search-form__bar {
  display: flex; align-items: center; max-width: 720px; background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 5px 5px 5px 18px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search-form__bar:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.search-form__bar input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font: inherit; font-size: var(--fs-lg); padding: 10px 12px; color: var(--ink);
}
.search-form__bar input:focus { outline: none; }
.search-form__bar button {
  border: none; background: var(--primary); color: #fff; font-weight: 700;
  padding: 11px 26px; border-radius: 999px; cursor: pointer; transition: background-color .15s;
}
.search-form__bar button:hover { background: var(--primary-dark); }

/* Browse quick type-switch (tabs). Scrolls horizontally on narrow screens. */
.type-nav {
  display: flex; gap: 9px; flex-wrap: wrap; margin: 4px 0 18px;
}
.type-nav__chip {
  --chip: var(--primary);
  font-weight: 600; font-size: var(--fs-base); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 16px; white-space: nowrap;
  transition: background-color .14s, color .14s, border-color .14s, transform .12s;
}
.type-nav__chip:hover {
  border-color: var(--chip); color: var(--chip);
  text-decoration: none; transform: translateY(-1px);
}
.type-nav__chip--active {
  background: var(--chip); border-color: var(--chip); color: #fff;
}
.type-nav__chip--active:hover { color: #fff; transform: none; }
.type-nav__chip--bill              { --chip: var(--primary); }
.type-nav__chip--secondary_law     { --chip: var(--merge); }
.type-nav__chip--agenda            { --chip: var(--c-agenda-chip); }
.type-nav__chip--query             { --chip: var(--accent-strong); }
.type-nav__chip--committee_session { --chip: var(--c-committee-chip); }
.type-nav__chip--plenum_session    { --chip: var(--ok); }

.search-body {
  display: grid; grid-template-columns: 252px 1fr; gap: 24px; margin-top: 22px; align-items: start;
}
.filters {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm);
  position: sticky; top: 86px;
}
/* The "סינון" heading is the <details>'s <summary>. On the desktop sidebar it's an
   inert heading with the panel always shown; ≤880px (below) it becomes the tap target
   that reveals the collapsed panel. Force-show the panel here so a closed <details>
   still renders its controls on desktop (author styles beat the UA collapse rule). */
.filters > :not(summary) { display: block; }
/* Chromium 131+ (Chrome/Edge/Brave) rewrote <details>: a closed one hides its
   content via content-visibility on a ::details-content wrapper, which the
   display:block above lays out but never PAINTS — so the desktop panel rendered
   blank and, with the inert summary, was unreachable. Reveal that wrapper. The
   pseudo-element shipped in the same change that caused the bug, so it targets
   exactly the affected engines; Firefox/Safari/older Chromium ignore it and keep
   using the display:block rule above (they still hide via display, not c-v). */
.filters::details-content { content-visibility: visible; }
.filters__toggle {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl);
  margin-bottom: 16px; cursor: default; pointer-events: none; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.filters__toggle::-webkit-details-marker { display: none; }
/* No-JS apply button: changing a dropdown can't auto-refresh without JS, so a plain
   submit is offered, then hidden once enhance.js arms the `change`-driven refresh. */
.filter-submit {
  width: 100%; margin-top: 10px; font: inherit; font-weight: 700; font-size: var(--fs-base);
  padding: 10px 16px; border: none; border-radius: var(--r-sm);
  background: var(--primary); color: #fff; cursor: pointer;
  transition: background-color .15s;
}
.filter-submit:hover { background: var(--primary-dark); }
.js .filter-submit { display: none; }
.filter-group { margin-bottom: 15px; }
.filter-group label, .filter-group .muted {
  display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); margin-bottom: 6px;
}
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="search"],
.filter-group input[type="date"] {
  width: 100%; font: inherit; font-size: var(--fs-base); padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink);
}
.filter-group select:focus,
.filter-group input[type="text"]:focus,
.filter-group input[type="search"]:focus,
.filter-group input[type="date"]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Two dates sharing a row under one "טווח תאריכים" label; wraps when cramped. */
.filter-range { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-range > input[type="date"] { flex: 1 1 122px; width: auto; min-width: 0; }
/* Keep the native date picker glyph legible on the dark theme. */
[data-theme="dark"] .filter-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(.7);
}
/* JS typeahead for the MK filter (combobox.js). The wrapper anchors the popup;
   the input keeps its .filter-group styling. The native <datalist> fallback needs
   no styling — the browser draws it. */
.combobox { position: relative; }
.combobox__list {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30;
  margin: 0; padding: 4px; list-style: none;
  max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
}
.combobox__opt {
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-base); color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.combobox__opt.is-active, .combobox__opt:hover { background: var(--accent-soft); }
/* Inline checkbox toggle (e.g. "show empty items") — overrides the block label above. */
.filter-group .filter-check {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); cursor: pointer;
}
.filter-group .filter-check input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; cursor: pointer; }
/* Removable active-filter pills shown above the results. */
.active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
}
.active-filters__label { font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 600; }
.active-filters__clear { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
.active-filters__clear:hover { color: var(--stop); text-decoration: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; padding: 5px 13px; font-size: var(--fs-sm); font-weight: 600;
  transition: background-color .14s, color .14s;
}
.filter-chip:hover { background: var(--primary); color: #fff; text-decoration: none; }
.filter-chip__x { font-weight: 800; font-size: 1.05em; line-height: 1; opacity: .75; }
.filter-chip:hover .filter-chip__x { opacity: 1; }

.results { min-height: 200px; transition: opacity .15s; }
.results.htmx-request { opacity: .5; }
.results__bar { margin-bottom: 14px; }
.results__count { font-weight: 600; color: var(--ink-soft); font-size: var(--fs-base); }
.results__q { color: var(--ink); font-weight: 700; }

/* --- Empty / notice -------------------------------------------------------- */
.empty {
  background: var(--surface); border: 2px dashed var(--line-strong);
  border-radius: var(--r); padding: 48px 24px; text-align: center;
}
.empty__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); margin: 0 0 6px; }
.notice {
  background: var(--accent-soft); color: var(--ink);
  border-radius: var(--r-sm); padding: 14px 16px; font-size: var(--fs-base);
  margin-bottom: 16px; border-inline-start: 4px solid var(--accent);
}

/* --- Pagination ------------------------------------------------------------ */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 28px; }
.pager__btn {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 18px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: border-color .12s, color .12s, background-color .12s;
}
.pager__btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pager__btn--off { opacity: .4; pointer-events: none; }
.pager__page { font-size: var(--fs-sm); color: var(--ink-soft); }

/* --- Breadcrumbs ----------------------------------------------------------- */
.crumbs {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 16px;
}
.crumbs__here { color: var(--ink); }

/* --- Item page ------------------------------------------------------------- */
.item__header { margin-bottom: 22px; }
.item__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.item__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.18; letter-spacing: -0.015em;
}
.item__sub { display: flex; gap: 8px; flex-wrap: wrap; color: var(--ink-soft); font-size: var(--fs-base); }
.item__cols { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px 26px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.panel__title {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl);
  margin-bottom: 16px; display: flex; align-items: center; gap: 9px;
}
.panel__title .count {
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700;
  background: var(--surface-2); color: var(--ink-soft); border-radius: 999px; padding: 2px 10px;
}
.summary-text { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-lg); line-height: 1.9; margin: 0 0 6px; }
.summary-src { margin: 0; font-size: var(--fs-xs); }
.panel__hint { margin: -8px 0 16px; font-size: var(--fs-sm); }

/* --- Timeline -------------------------------------------------------------- */
.timeline-wrap { overflow-x: auto; padding-bottom: 6px; }
.timeline { display: flex; list-style: none; margin: 8px 0 0; padding: 0; min-width: 480px; }
.timeline__step { flex: 1; text-align: center; position: relative; padding-top: 32px; }
.timeline__step::before {
  content: ""; position: absolute; top: 12px; left: 50%; width: 100%;
  height: 3px; background: var(--line); border-radius: 2px; z-index: 0;
}
.timeline__step:first-child::before { display: none; }
.timeline__step--done::before,
.timeline__step--current::before { background: var(--primary); }
.timeline__step--next::before {
  background: linear-gradient(to left,
      var(--primary) 0%, var(--primary) 50%, var(--line-strong) 68%, var(--line) 100%);
}
.timeline__step--next::after {
  content: ""; position: absolute; top: 8px; right: -36%;
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent); z-index: 2;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 24%, transparent);
  animation: timeline-pulse 1.6s ease-in-out infinite;
}
@keyframes timeline-pulse {
  0%   { right: -36%; opacity: 0; transform: scale(.4); }
  25%  { opacity: 1; transform: scale(1); }
  70%  { opacity: 1; transform: scale(1); }
  100% { right: 32%; opacity: 0; transform: scale(.4); }
}
.timeline__dot {
  position: absolute; top: 4px; right: calc(50% - 10px);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--line-strong); z-index: 1;
}
.timeline__step--done .timeline__dot { background: var(--primary); border-color: var(--primary); }
.timeline__step--current .timeline__dot {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}
.timeline__label { font-size: var(--fs-sm); color: var(--ink-soft); }
.timeline__step--done .timeline__label,
.timeline__step--current .timeline__label { color: var(--ink); font-weight: 700; }
.timeline__step--next .timeline__label { color: var(--ink-soft); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .timeline__step--next::after { animation: none; right: 6%; opacity: 1; transform: scale(1); }
}

.terminal-banner {
  border-radius: var(--r); padding: 16px 20px; font-weight: 700; margin-bottom: 20px;
  border: 1px solid transparent;
}
.terminal-banner--stop  { background: var(--stop-soft);  color: var(--stop); }
.terminal-banner--merge { background: var(--merge-soft); color: var(--merge); }
.terminal-banner--neutral { background: var(--surface-2); color: var(--ink-soft); }
/* Inherit the banner's colour so the merge-target link stays legible on the
   coloured background, but keep it underlined to read as a link. */
.terminal-banner__link { color: inherit; text-decoration: underline; }
.terminal-banner__link:hover { text-decoration: none; }
/* שאילתה: the minister's-answer callout — a prominent link to the reply (or a
   quiet "awaiting" note when no answer has been filed yet). */
.answer-callout {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 18px; border-radius: var(--r);
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.answer-callout__label { font-weight: 800; color: var(--ink); }
.answer-callout__links { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.answer-callout__link { font-weight: 700; color: var(--accent-strong); }
.answer-callout__src { color: var(--ink-soft); font-size: var(--fs-sm); }
.answer-callout--pending { background: var(--surface-2); border-color: var(--line); }
.answer-callout--pending .answer-callout__label { color: var(--ink-soft); }
.answer-callout__pending { color: var(--ink-soft); }

/* Reverse merge list ("proposals merged into this one"). */
.merged-into-list { list-style: none; margin: 0; padding: 0; }
.merged-into-list li { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.merged-into-list li:last-child { border-bottom: none; }

/* --- Documents ------------------------------------------------------------- */
.doc-group { margin-bottom: 18px; }
.doc-group:last-child { margin-bottom: 0; }
.doc-group__name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: none; }
.doc-row__main { flex: 1; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.doc-row__link { font-weight: 600; }
.doc-row__src { font-size: var(--fs-sm); color: var(--ink-soft); white-space: nowrap; }
.doc-fmt {
  flex: none; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .03em;
  width: 44px; text-align: center; padding: 5px 0; border-radius: 7px;
  background: var(--surface-2); color: var(--ink-soft);
}
.doc-fmt--pdf  { background: var(--stop-soft); color: var(--stop); }
.doc-fmt--doc, .doc-fmt--docx { background: var(--primary-soft); color: var(--primary); }
.doc-fmt--pic  { background: var(--warn-soft); color: var(--warn); }
.doc-tag { font-size: var(--fs-2xs); font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.doc-tag--soft { background: var(--surface-2); color: var(--ink-soft); }

/* --- Side facts ------------------------------------------------------------ */
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; }
.facts dt { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; }
.facts dd { margin: 0; font-size: var(--fs-base); }
.people, .links, .namehist { list-style: none; margin: 0; padding: 0; }
.people li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-base); }
.people li:last-child { border-bottom: none; }
.links li { padding: 5px 0; font-size: var(--fs-base); }
.namehist li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.namehist li:last-child { border-bottom: none; }
.namehist__type {
  display: inline-block; font-size: var(--fs-2xs); font-weight: 700;
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px; padding: 1px 9px; margin-bottom: 4px;
}
.namehist__name { display: block; }

/* --- Document text page (the law itself, set like a printed page) ---------- */
/* Centre the head + text as one focused reading column. */
.document { max-width: 760px; margin-inline: auto; }
.document__head { margin-bottom: 20px; }
.document__head h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 3vw, 2rem); }
.document__meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); font-size: var(--fs-sm); }
.doc-text {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 38px 42px; box-shadow: var(--shadow-sm);
  white-space: pre-wrap; word-wrap: break-word;
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-lg); line-height: 1.95; max-width: 760px;
}

/* --- Prose (about) --------------------------------------------------------- */
.prose {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 32px 36px; box-shadow: var(--shadow-sm); max-width: 760px;
}
.prose p:first-child { font-size: var(--fs-lg); line-height: 1.85; }
.prose h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); margin-top: 28px; }
.prose ul { padding-inline-start: 22px; }
.prose li { margin-bottom: 7px; }

/* --- How a law is born ----------------------------------------------------- */
.how { max-width: 840px; }
.how__lede {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-lg); line-height: 1.95; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 30px; box-shadow: var(--shadow-sm); margin-bottom: 32px;
  border-inline-start: 5px solid var(--accent);
}
.how__h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); margin: 36px 0 12px; }
.how__list { padding-inline-start: 22px; }
.how__list li { margin-bottom: 9px; line-height: 1.75; }

.how-steps { list-style: none; padding: 0; margin: 0; position: relative; }
/* A journey line threading the step circles — visible through the gaps between
   cards, so the six steps read as one continuous path. (Circle centre sits at
   right: 24px + 25px = 49px.) */
.how-steps::before {
  content: ""; position: absolute; top: 50px; bottom: 50px; right: 48px;
  width: 3px; border-radius: 2px; z-index: 0;
  background: repeating-linear-gradient(var(--line-strong) 0 8px, transparent 8px 16px);
}
.how-step {
  position: relative; z-index: 1; padding: 26px 96px 26px 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
  transition: transform .13s, box-shadow .13s;
}
.how-step:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.how-step__num {
  position: absolute; top: 26px; right: 24px;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--primary); color: #fff; font-family: var(--font-display); font-weight: 800;
  display: grid; place-items: center; font-size: var(--fs-2xl);
  box-shadow: 0 0 0 6px var(--primary-soft);
}
.how-step__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); margin: 0 0 8px; }
.how-step p { margin: 0; color: var(--ink); line-height: 1.8; }
.how-step--final { border-color: var(--ok); border-width: 2px; }
.how-step--final .how-step__num { background: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.how-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

/* --- Error page ------------------------------------------------------------ */
.error-page { text-align: center; padding: 80px 20px; }
.error-page__code {
  font-family: var(--font-display); font-weight: 800; font-size: 5rem; line-height: 1;
  color: var(--primary); margin: 0; letter-spacing: -0.02em;
}
.error-page__title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); margin: 12px 0 26px; }

/* --- Semantic-search toggle (only when the model is reachable) ------------- */
.search-mode {
  border: 0; padding: 0; margin: 14px 0 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: var(--fs-base);
}
.search-mode__opt { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.search-mode__opt input { accent-color: var(--accent); }
.search-mode__hint { font-size: var(--fs-sm); }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 880px) {
  /* Single column: results first, filters collapsed behind a sticky "סינון" tap
     target — nobody on a phone should scroll past five dropdowns to reach what they
     searched for, nor hunt below the fold to find the filters at all. */
  .search-body { grid-template-columns: 1fr; }
  .search-body .results { order: 1; }
  .search-body .filters {
    order: 2; position: static; padding: 0; border: none;
    background: none; box-shadow: none;
  }
  .filters[open] {
    padding: 16px; border: 1px solid var(--line);
    background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm);
  }
  .filters:not([open]) > :not(summary) { display: none; }   /* collapse the panel */
  .filters__toggle {
    cursor: pointer; pointer-events: auto; justify-content: center;
    margin: 0; padding: 13px 18px;
    position: sticky; bottom: 12px; z-index: 5;
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r); box-shadow: var(--shadow);
  }
  .filters[open] .filters__toggle { margin-bottom: 16px; }
  .item__cols { grid-template-columns: 1fr; }
  .featured__body { padding: 40px 24px 28px; }
  .how-step { padding: 26px 86px 26px 22px; }
}
@media (max-width: 560px) {
  .site-header__inner { gap: 12px; }
  .site-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-inline-start: 0; }
  .site-nav a { padding: 7px 10px; }
  .brand__tag { display: none; }
  .hero__search { flex-wrap: wrap; border-radius: var(--r); padding: 10px; }
  .hero__search button { flex-basis: 100%; }
  .hero::after { font-size: 16rem; }
  .doc-text { padding: 24px; }
  .doc-text, .featured__summary, .summary-text { font-size: var(--fs-md); }
  .feed__row { grid-template-columns: auto 1fr; row-gap: 6px; }
  .feed__when { grid-column: 1 / -1; font-size: var(--fs-xs); }
  .stat-strip { gap: 12px; padding: 18px 14px; }
  .stat-strip__item { min-width: 88px; }
  .stat-strip__item + .stat-strip__item::before { display: none; }
  .stat-strip__item strong { font-size: var(--fs-2xl); }
  /* Force a real 2×2 on phones: flex with min-width:0 otherwise squeezes all
     four onto one cramped row. Drop the dividers so none dangle at a row edge. */
  .hero__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .hero__stat + .hero__stat::before { display: none; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .how-steps::before { display: none; }
  .how-step { padding: 22px; }
  .how-step__num { position: static; margin-bottom: 12px; width: 42px; height: 42px; font-size: var(--fs-xl); }
  .compass-stage { min-block-size: clamp(380px, 60vh, 520px); }
  .compass-card { padding: 20px; }
  /* Immersive game screen — the sticky header's nav+search row and the full
     footer were eating enough of a phone viewport that the stage/buttons sat
     below the fold, forcing a scroll before the game was even playable. */
  body[data-page="compass-play"] .site-nav,
  body[data-page="compass-play"] .header-search,
  body[data-page="compass-play"] .site-footer { display: none; }
  body[data-page="compass-play"] main.wrap { min-height: 0; padding-block: 10px 6px; }
  body[data-page="compass-play"] .compass-stage { min-block-size: clamp(320px, 52dvh, 480px); }
}

/* --- Dark-mode fixed-colour badge tweaks for AA on dark surfaces ----------- */
[data-theme="dark"] .badge--agenda            { background: #1c3739; color: #7ad0d6; }
[data-theme="dark"] .badge--committee_session { background: #232b36; color: #aebcc9; }

/* --- Print: a clean, citable page of the law itself ------------------------ */
/* People print and cite legislation. Strip the app chrome, force a light,
   ink-frugal palette (regardless of the on-screen theme), and let the content
   reflow to the page. The forced custom-property block neutralises the whole
   token-driven palette in one place. */
@media print {
  :root, [data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #fff;
    --ink: #000; --ink-soft: #333; --ink-faint: #555;
    --line: #cfcfcf; --line-strong: #aaa;
    color-scheme: light;
  }
  body { background: #fff; color: #000; }
  body::before { display: none; }                 /* paper-grain texture */
  .hero::before, .hero::after { display: none; }  /* hero band + § watermark */

  /* App chrome and interactive-only bits don't belong on paper. */
  .site-header, .site-footer, .theme-toggle, .header-search, .skip-link,
  .hero__search, .hero__topics, .crumbs, .pager, .type-nav, .filters,
  .active-filters, .search-mode, .home-cta, .seemore { display: none !important; }

  main.wrap { max-width: none; margin: 0; padding: 0; min-height: 0; }
  .item__cols, .search-body { grid-template-columns: 1fr; gap: 0; }

  /* Flatten cards/panels: no shadows or fills, and keep each block whole. */
  .panel, .featured, .card-item, .tile, .doc-text, .prose, .how-step,
  .stat-strip, .feed {
    box-shadow: none !important; background: #fff !important;
    border: 1px solid #cfcfcf; break-inside: avoid;
  }
  a { color: #000; text-decoration: underline; }
  .results.htmx-request { opacity: 1; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }

  /* Make linked sources citable on paper: show the URL after the link. */
  .doc-row__src[href^="http"]::after,
  .links a[href^="http"]::after {
    content: " — " attr(href); font-size: .8em; color: #555; word-break: break-all;
  }
  @page { margin: 1.8cm; }
}

/* --- Plenum votes (compact, collapsible) --------------------------------- */
.small { font-size: var(--fs-xs); }
.t-ok  { color: var(--ok); }
.t-stop{ color: var(--stop); }
.t-mut { color: var(--ink-soft); }

.vote__nums b { font-weight: 700; }

/* Outer disclosure: the whole panel is one tap-to-open control. */
.votes-disc > summary { list-style: none; cursor: pointer; }
.votes-disc > summary::-webkit-details-marker { display: none; }
.votes-disc__btn {
  display: flex; align-items: center; gap: 8px;
}
.votes-disc__btn::after {
  content: "›"; margin-inline-start: auto; color: var(--ink-soft);
  transition: transform .15s ease;
}
.votes-disc[open] > .votes-disc__btn::after { transform: rotate(90deg); }
.votes-disc__btn .panel__title { margin: 0; }

.votes { list-style: none; margin: 10px 0 0; padding: 0; }

/* Each vote: a tight one-line summary that opens to its breakdown. */
.vote { border-top: 1px solid var(--line); }
.votes > li:first-child .vote { border-top: 0; }
.vote > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
}
.vote > summary::-webkit-details-marker { display: none; }
.vote__dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-soft);
}
.vote__dot--ok   { background: var(--ok); }
.vote__dot--stop { background: var(--stop); }
.vote__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vote__reading {
  font-size: var(--fs-2xs); font-weight: 700; color: var(--ink-soft);
  letter-spacing: .01em;
}
.vote__title {
  font-size: var(--fs-sm); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.vote__nums {
  flex: 0 0 auto; font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vote__nums .sep { color: var(--line); margin: 0 2px; }

.vote__body { padding: 2px 0 10px 0; }

/* A vote with no per-MK record (show-of-hands): static row, method instead of tallies. */
.vote--nodata { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.vote__method { flex: 0 0 auto; white-space: nowrap; }

/* Breakdown: a block per faction, each split into vote-group rows. */
.vbreak__sum { margin-bottom: 8px; }
.vbreak__f { padding: 7px 0; border-top: 1px dashed var(--line); }
.vbreak__f:first-of-type { border-top: 0; }
.vbreak__name { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 3px; }
.vbreak__name .muted { font-weight: 400; font-size: var(--fs-xs); }
.vbreak__g { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.vbreak__names { line-height: 1.6; }
.vote-tag {
  flex: 0 0 auto; font-size: var(--fs-2xs); font-weight: 700; padding: 1px 8px;
  border-radius: 999px; white-space: nowrap; min-width: 3.6em; text-align: center;
  background: var(--surface-2); color: var(--ink-soft);
}
.vote-tag--ok      { background: var(--ok-soft);   color: var(--ok); }
.vote-tag--stop    { background: var(--stop-soft); color: var(--stop); }
.vote-tag--neutral { background: var(--surface-2); color: var(--ink-soft); }

/* --- MK profile (/mk/{id}) ------------------------------------------------- */
/* At-a-glance figures; each is a jump link to its section below. */
.mk-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.mk-stat {
  flex: 1 1 120px; min-width: 110px; text-align: center;
  padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.mk-stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.mk-stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); color: var(--primary); }
.mk-stat span { font-size: var(--fs-sm); color: var(--ink-soft); }
.mk-stat small { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-faint); }

.mk-vsum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mk-vsum .vote-tag { min-width: 0; font-size: var(--fs-xs); padding: 3px 11px; }
.mk-align { font-size: var(--fs-base); margin-bottom: 6px; }
.mk-align b { color: var(--primary); }
.mk-subhead { font-weight: 700; font-size: var(--fs-base); margin: 16px 0 8px; }
.mk-subnote { margin: -8px 0 12px; }

.mk-votes { list-style: none; margin: 0; padding: 0; }
.mk-vote {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; border-top: 1px dashed var(--line);
}
.mk-vote:first-child { border-top: 0; }
.mk-vote__main { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.mk-vote__main a { color: var(--ink); text-decoration: none; }
.mk-vote__main a:hover { color: var(--primary); text-decoration: underline; }
.mk-vote__tag {
  display: inline-block; margin-inline-start: 6px; font-size: var(--fs-2xs); font-weight: 600;
  padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
  white-space: nowrap;
}
.mk-vote__count { margin-inline-start: 6px; white-space: nowrap; }
.mk-vote__date { flex: 0 0 auto; white-space: nowrap; }

.mk-caveat { margin-top: 14px; }
.mk-more { margin-top: 14px; font-size: var(--fs-sm); }
.mk-more a { color: var(--primary); font-weight: 600; text-decoration: none; }
.mk-more a:hover { text-decoration: underline; }

/* Initiator names on the item page link to MK profiles. */
.people a { color: var(--primary); text-decoration: none; }
.people a:hover { text-decoration: underline; }

/* Link from the MK filter to that member's profile. */
.filter-mklink { display: inline-block; margin-top: 6px; font-size: var(--fs-sm); color: var(--primary); text-decoration: none; }
.filter-mklink:hover { text-decoration: underline; }

/* Per-term filter on the MK profile: a segmented row of toggle chips. */
.mk-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mk-filter__chip {
  font-size: var(--fs-sm); font-weight: 600; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--line);
}
.mk-filter__chip:hover { border-color: var(--line-strong); color: var(--ink); }
.mk-filter__chip.is-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
[data-theme="dark"] .mk-filter__chip.is-active { color: var(--bg); }

/* --- Standalone vote page (/vote/{id}) ------------------------------------ */
.vote-tally { display: flex; flex-wrap: wrap; gap: 12px; }
.vote-tally__num {
  flex: 1 1 90px; min-width: 80px; text-align: center;
  padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.vote-tally__num b { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); }
.vote-tally__num span { font-size: var(--fs-sm); color: var(--ink-soft); }
.vote-tally__margin { margin-top: 12px; }

/* Permalink to the standalone vote page, under each vote row on the item page. */
.vote__perma { display: inline-block; margin: 2px 0 6px; text-decoration: none; color: var(--ink-soft); }
.vote__perma:hover { color: var(--primary); text-decoration: underline; }

/* --- Weekly digest (/recent) ---------------------------------------------- */
/* A highlighted panel for the (rare) no-confidence callout. */
.panel--alert { border-color: var(--stop, var(--line-strong)); }
/* Per-stage count chips above the "updated bills" grid. */
.stage-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stage-chip {
  font-size: var(--fs-sm); color: var(--ink-soft); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px;
}
.stage-chip:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.stage-chip b { color: var(--ink); font-weight: 700; margin-inline-start: 4px; }

/* --- Share row (item pages) ----------------------------------------------- */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.share__label { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; }
.share__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.share__btn:hover {
  border-color: var(--primary); background: var(--primary-soft);
  text-decoration: none; transform: translateY(-1px);
}

/* --- Faction page (/faction/{id}) ----------------------------------------- */
/* A neutral identity band — slate, deliberately not party colours. */
.faction-head {
  border-inline-start: 4px solid var(--c-committee);
  padding-inline-start: 16px;
  background: linear-gradient(to inline-start, transparent, color-mix(in srgb, var(--c-committee) 7%, transparent));
  border-radius: var(--r-sm);
}
/* Roster as member chips, not a phone-book of bare links. */
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.roster__chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  transition: border-color .12s, transform .12s, background .12s;
}
.roster__chip:hover {
  border-color: var(--primary); background: var(--primary-soft);
  text-decoration: none; transform: translateY(-1px);
}

/* --- Weekly digest, refined (/recent) ------------------------------------- */
.recent-head { margin: 6px 0 4px; }
.recent-head__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); line-height: 1.1; margin: 0;
}
.recent-head__sub { margin: 6px 0 0; max-width: 56ch; }

/* Lead stat strip reused from home, here as in-page jump links. */
.stat-strip--links { margin-top: 18px; margin-bottom: 28px; }
.stat-strip--links .stat-strip__item { text-decoration: none; transition: transform .12s; }
.stat-strip--links .stat-strip__item:hover { transform: translateY(-2px); }
.stat-strip--links .stat-strip__item:hover strong { color: var(--accent); }
[data-theme="dark"] .stat-strip--links .stat-strip__item:hover strong { color: var(--accent); }
/* A single linked stat (e.g. "חוקים בתוקף" → /laws) sitting among plain ones:
   match the siblings (no underline/colour shift) with a subtle clickable hover. */
a.stat-strip__item { color: inherit; text-decoration: none; transition: transform .12s; }
a.stat-strip__item:hover { transform: translateY(-2px); }
a.stat-strip__item:hover strong { color: var(--accent); }

/* Two shorter sections side by side on wide screens. */
.recent-cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .recent-cols { grid-template-columns: 1fr 1fr; } }

/* Vote rows — each a small card: title plus a tally/outcome/date footer. */
.vote-list { list-style: none; margin: 0; padding: 0; }
.vote-list > li + li { margin-top: 10px; }
.vote-row {
  display: block; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2);
  text-decoration: none; color: var(--ink); transition: border-color .12s, transform .12s;
}
.vote-row:hover { border-color: var(--line-strong); transform: translateY(-1px); text-decoration: none; }
.vote-row__title { display: block; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.vote-row__foot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.vote-row__date { margin-inline-start: auto; }
.vote-out { font-weight: 700; font-size: var(--fs-sm); }
.vote-out--ok { color: var(--ok); }
.vote-out--stop { color: var(--stop); }
.vote-out--tie { color: var(--ink-soft); }

/* Committee rows — name + a session count, deliberately unlike the vote rows. */
.comm-list { list-style: none; margin: 0; padding: 0; }
.comm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.comm-row:first-child { border-top: 0; }
.comm-row__name { flex: 1 1 auto; min-width: 0; font-weight: 600; text-decoration: none; }
.comm-row__name:hover { color: var(--primary); text-decoration: underline; }
.comm-row__count {
  flex: none; font-size: var(--fs-sm); color: var(--ink-soft);
  background: var(--surface-2); border-radius: 999px; padding: 3px 11px;
}
.comm-row__count b { color: var(--ink); font-family: var(--font-display); font-weight: 800; }

/* --- Rankings, refined: per-board accent + a spotlit #1 ------------------- */
.rank-board { --rank-accent: var(--primary); }
.rank-board--initiated    { --rank-accent: var(--primary); }
.rank-board--enacted      { --rank-accent: var(--ok); }
.rank-board--queries      { --rank-accent: var(--c-agenda-chip); }
.rank-board--independence { --rank-accent: var(--merge); }
.rank-board__mark {
  display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  background: var(--rank-accent); margin-inline-end: 9px; vertical-align: middle;
}
/* The #1 row gets the spotlight: accent wash, a bigger number, a louder metric. */
.rank-row--lead {
  margin: 2px 0 6px; padding: 12px 14px; border-top: 0; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--rank-accent) 9%, var(--surface));
}
.rank-row--lead .rank-row__num {
  background: var(--rank-accent); color: #fff; width: 30px; height: 30px;
}
[data-theme="dark"] .rank-row--lead .rank-row__num { color: var(--bg); }
.rank-row--lead .rank-row__name { font-size: var(--fs-lg); }
.rank-row--lead .rank-row__metric b { font-size: var(--fs-2xl); color: var(--rank-accent); }

/* --- Committee sessions: a date-led timeline ----------------------------- */
.sess-list { list-style: none; margin: 0; padding: 0; }
.sess-row__link {
  display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 4px 14px;
  align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.sess-row:first-child .sess-row__link { border-top: 0; }
.sess-row__date {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
  color: var(--accent-strong); white-space: nowrap;
}
[data-theme="dark"] .sess-row__date { color: var(--accent); }
.sess-row__name { color: var(--ink-soft); line-height: 1.35; }
.sess-row__link:hover .sess-row__name { color: var(--primary); text-decoration: underline; }

/* === ספר החוקים — the book of in-force laws =============================== */
.hero--laws { padding-block: clamp(28px, 5vw, 56px) clamp(18px, 3vw, 30px); }
.hero--laws .hero__title { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin-bottom: 10px; }
/* Drop the faint § watermark behind this hero — it reads as a stray "SS". */
.hero--laws::after { content: none; }

.panel__lead { margin: -8px 0 16px; font-size: var(--fs-sm); }

/* Basic Laws — an inviting card grid (2-up on mobile, fills wider screens). */
.laws-basic {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.basic-law {
  display: flex; flex-direction: column; gap: 5px; min-height: 78px;
  padding: 14px 16px; color: var(--ink);
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 70%);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.basic-law:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: var(--primary); box-shadow: var(--shadow-sm);
}
.basic-law__kicker {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .02em;
  color: var(--accent-strong, var(--primary)); text-transform: none;
}
.basic-law__name {
  font-family: var(--font-display); font-weight: 800; line-height: 1.2;
  font-size: var(--fs-base);
}
@media (max-width: 360px) { .laws-basic { grid-template-columns: 1fr 1fr; } }

.laws-recent { list-style: none; margin: 0; padding: 0; }
.laws-recent__row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 14px; padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.laws-recent__row:last-child { border-bottom: 0; }
.laws-recent__name { font-weight: 600; color: var(--ink); }
.laws-recent__name:hover { color: var(--primary); }
.laws-recent__meta { display: inline-flex; gap: 12px; align-items: baseline; font-size: var(--fs-sm); }
.laws-recent__tally { color: var(--ink-soft); white-space: nowrap; }
.laws-recent__tally .t-ok   { color: var(--ok);   font-weight: 700; }
.laws-recent__tally .t-stop { color: var(--stop); font-weight: 700; }

.laws-search {
  width: 100%; box-sizing: border-box; margin-bottom: 14px;
  font: inherit; font-size: var(--fs-base); padding: 11px 14px;
  background: var(--surface); border: 2px solid var(--line-strong);
  border-radius: var(--r); color: var(--ink);
}
.laws-search:focus { outline: none; border-color: var(--primary); }

.laws-rows { display: flex; flex-direction: column; }
.law-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.law-row:last-child { border-bottom: 0; }
.law-row:hover { color: var(--primary); text-decoration: none; }
.law-row__name { flex: 1; font-weight: 500; }
.law-row__tag {
  font-size: var(--fs-2xs); font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 9px;
}
.law-row__year { font-size: var(--fs-xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.laws-empty { padding: 14px 2px; }

.load-more {
  margin-top: 14px; align-self: center; cursor: pointer;
  font: inherit; font-weight: 600; font-size: var(--fs-sm); color: var(--primary);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 20px; transition: all .14s;
}
.load-more:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Law dossier — amendment history. */
.amend-list { list-style: none; margin: 0; padding: 0; }
.amend-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.amend-row:last-child { border-bottom: 0; }
.amend-row__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 3px 12px;
}
.amend-row__name { font-weight: 600; color: var(--ink); }
.amend-row__name:hover { color: var(--primary); }
.amend-row__date {
  font-size: var(--fs-xs); color: var(--ink-soft);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.amend-row__sum { margin: 5px 0 0; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.6; }
.amend-more > summary {
  cursor: pointer; list-style: none; display: inline-block;
  margin-top: 6px; padding: 8px 0;
  font-weight: 600; font-size: var(--fs-sm); color: var(--primary);
}
.amend-more > summary::-webkit-details-marker { display: none; }
.amend-more > summary::before { content: "▾ "; }
.amend-more[open] > summary::before { content: "▴ "; }
.amend-more[open] > summary { color: var(--ink-soft); }

/* --- כמו מי הצבעת? — the voting game (/compass) --------------------------- */
.compass-intro, .compass-game, .compass-results {
  --c-for: #1f8a4c; --c-against: #c0392b;
  --c-for-soft: #e7f3ec; --c-against-soft: #fbeae7;
}
[data-theme="dark"] .compass-intro,
[data-theme="dark"] .compass-game,
[data-theme="dark"] .compass-results { --c-for-soft: #13291f; --c-against-soft: #2e1a17; }

/* Intro — a quiet lead-in, the game itself is the hero. */
.compass-intro { max-width: 46ch; margin: 6vh auto 8vh; text-align: center; }
.compass-intro__eyebrow { color: var(--accent-strong); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .06em; }
.compass-intro__title {
  font-family: var(--font-display); font-weight: 800; line-height: 1.05;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); margin: 6px 0 14px;
}
.compass-intro__lead { color: var(--ink-soft); font-size: var(--fs-lg); line-height: 1.6; }
.compass-intro__start { margin-top: 24px; font-size: var(--fs-lg); padding: 14px 30px; }
.compass-intro__how { margin-top: 16px; }
.compass-intro__note { color: var(--ink-soft); margin-top: 18px; }

/* Game shell. */
.compass-game { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.compass-game__top { display: flex; align-items: center; gap: 12px; }
.compass-game__exit { color: var(--ink-faint); text-decoration: none; font-size: var(--fs-lg); line-height: 1; }
.compass-game__exit:hover { color: var(--ink); }
.compass-game__progress { flex: 1; block-size: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.compass-game__bar { display: block; block-size: 100%; inline-size: 0; background: var(--accent); transition: inline-size .3s ease; }
.compass-game__count { color: var(--ink-soft); font-weight: 700; font-variant-numeric: tabular-nums; min-inline-size: 3.6em; text-align: center; direction: ltr; }

/* The card stage: one live card, with two static silhouettes behind for depth.
   overflow:hidden keeps a dragged/thrown card from creating page-level horizontal
   scroll (the mobile 'whole screen slides sideways' bug); touch-action stops the drag
   from panning the page. */
.compass-stage { position: relative; min-block-size: clamp(460px, 68vh, 640px); perspective: 1000px; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
.compass-stage::before, .compass-stage::after {
  content: ""; position: absolute; inset-inline: 6%; inset-block-start: 6px; block-size: 92%;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); z-index: 0;
}
.compass-stage::before { transform: translateY(16px) scale(.95); opacity: .45; }
.compass-stage::after { transform: translateY(8px) scale(.975); opacity: .7; }
.compass-stage__loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }

.compass-card {
  position: absolute; inset: 0; z-index: 2; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 26px; display: flex; flex-direction: column;
  touch-action: none; cursor: grab; user-select: none;
  opacity: 0; transform: translateY(14px) scale(.94);
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .28s ease;
}
.compass-card.is-in { opacity: 1; transform: none; }
.compass-card.is-dragging { cursor: grabbing; transition: none; }
.compass-card__kicker { color: var(--ink-faint); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; }
.compass-card__title {
  font-family: var(--font-display); font-weight: 800; line-height: 1.2; margin: 10px 0;
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
}
.compass-card__summary {
  color: var(--ink-soft); line-height: 1.55; margin: 0;
  white-space: pre-line;
  flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; -webkit-overflow-scrolling: touch;
}
.compass-card__src { margin-top: auto; padding-top: 14px; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.compass-card__src:hover { color: var(--primary); }

/* Lean feedback: a stamp + an edge glow as you drag toward a choice. */
.compass-card__stamp {
  position: absolute; inset-block-start: 22px; padding: 6px 14px; border-radius: 8px; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg);
  opacity: 0; transition: opacity .1s ease; pointer-events: none;
}
.compass-card__stamp--for { inset-inline-end: 22px; background: var(--c-for); transform: rotate(-8deg); }
.compass-card__stamp--against { inset-inline-start: 22px; background: var(--c-against); transform: rotate(8deg); }
.compass-card__stamp--skip { inset-inline: 0; margin-inline: auto; inline-size: max-content; background: var(--ink-soft); }
.compass-card.lean-for .compass-card__stamp--for,
.compass-card.lean-against .compass-card__stamp--against,
.compass-card.lean-skip .compass-card__stamp--skip { opacity: 1; }
.compass-card.lean-for { border-color: var(--c-for); box-shadow: 0 0 0 3px var(--c-for-soft), var(--shadow-lg); }
.compass-card.lean-against { border-color: var(--c-against); box-shadow: 0 0 0 3px var(--c-against-soft), var(--shadow-lg); }

/* Controls (DOM order for/skip/against => RTL: בעד on the right, matching swipe-right). */
.compass-controls { display: flex; gap: 10px; justify-content: center; }
.compass-btn {
  flex: 1; max-inline-size: 160px; padding: 13px; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: var(--fs-md); border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s ease, background .12s, border-color .12s;
}
.compass-btn:hover { transform: translateY(-1px); }
.compass-btn--for { color: var(--c-for); border-color: var(--c-for); }
.compass-btn--for:hover { background: var(--c-for-soft); }
.compass-btn--against { color: var(--c-against); border-color: var(--c-against); }
.compass-btn--against:hover { background: var(--c-against-soft); }
.compass-btn--skip { color: var(--ink-soft); max-inline-size: 108px; }

.compass-game__hint { text-align: center; margin: 2px 0 0; }
.compass-game__noscript { text-align: center; padding: 20px; }

@media (prefers-reduced-motion: reduce) {
  .compass-card { transition: opacity .2s ease; }
  .compass-game__bar { transition: none; }
}

/* Results. */
.compass-results { max-width: 620px; margin: 0 auto; }
.compass-results__head { text-align: center; }
.compass-results__eyebrow { color: var(--accent-strong); font-weight: 700; font-size: var(--fs-sm); }
.compass-results__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.3rem); margin: 4px 0 8px; }
.compass-note { background: var(--accent-soft); color: var(--accent-strong); padding: 8px 12px; border-radius: var(--r-sm); }

/* Top match — the headline result. */
.cr-top {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 26px 20px; margin: 22px 0;
  border: 1px solid var(--c-for); border-radius: var(--r-lg); background: var(--c-for-soft);
}
.cr-top__label { color: var(--ink-soft); font-weight: 600; }
.cr-top__faction { font-family: var(--font-display); font-weight: 800; line-height: 1.1; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.cr-top__pct { font-family: var(--font-display); font-weight: 800; font-size: 3.2rem; line-height: 1; color: var(--c-for); margin-top: 4px; }
.cr-top__sub { font-size: var(--fs-sm); margin-top: 4px; }

.agree-list { list-style: none; margin: 18px 0; padding: 0; }
.agree { border-top: 1px solid var(--line); }
.agree-list > li:last-child .agree { border-bottom: 1px solid var(--line); }
.agree__summary { display: grid; grid-template-columns: 1.6em minmax(72px, 1fr) 2.4fr auto; align-items: center; gap: 12px; padding: 13px 2px; cursor: pointer; }
.agree__summary::-webkit-details-marker { display: none; }
.agree__summary::marker { content: ""; }
.agree__rank { color: var(--ink-faint); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.agree__faction { font-weight: 700; }
.agree__bar { block-size: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.agree__fill { display: block; block-size: 100%; background: var(--c-for); border-radius: 999px; }
.agree__pct { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agree__count { font-weight: 600; }
.compass-results__rank-note { margin: 10px 0 0; }
.agree__votes { list-style: none; margin: 0 0 12px; padding: 4px 0 8px 8px; }
.agree-vote { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 6px 0; }
.agree-vote.is-match .agree-vote__mark { color: var(--c-for); font-weight: 800; }
.agree-vote.is-miss .agree-vote__mark { color: var(--c-against); font-weight: 800; }
.agree-vote__title { font-weight: 600; text-decoration: none; grid-column: 2; }
.agree-vote__stances { grid-column: 2; }
.compass-results__cta { text-align: center; margin-top: 18px; }
