/* מצב השחיתות בליכוד — public dashboard
 *
 * Dark instrument panel. One hue per legal tier, used consistently everywhere
 * that tier appears — KPI card, chart bar, section marker, record badge — so
 * colour carries the legal distinction rather than decorating it. Red belongs
 * to convictions and to nothing else.
 *
 * All spacing uses logical properties: this document is RTL-native, not an
 * LTR layout with overrides bolted on.
 */

:root {
  --bg:         #0B1017;
  --bg-2:       #0E141D;
  --panel:      #131B26;
  --panel-2:    #18222F;
  --line:       #23303F;
  --line-soft:  #1B2734;

  --text:       #E9EFF6;
  --muted:      #92A5BA;
  --faint:      #63768B;

  --convicted:     #FF4D5E;
  --trial:         #FFB53D;
  --investigation: #56A8FF;
  --closed:        #34D399;
  --unresolved:    #B98CFF;

  --serif: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --sans:  'Heebo', system-ui, 'Arial Hebrew', 'Noto Sans Hebrew', sans-serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --shell: 82rem;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 85% -8%, #16202D 0%, transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: 1.25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.muted { color: var(--faint); }
.sep { color: var(--line); margin-inline: 0.45em; }

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--investigation); }
:focus-visible { outline: 2px solid var(--investigation); outline-offset: 3px; }

/* ── Masthead ─────────────────────────────────────────────────────── */

.masthead {
  border-block-end: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,77,94,0.06), transparent 70%);
}
.masthead__inner {
  display: flex; align-items: flex-start; gap: 1.5rem;
  padding-block: clamp(1.75rem, 4vw, 2.75rem) 1.5rem;
}
.masthead__text { flex: 1 1 auto; min-width: 0; }

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em;
  color: var(--faint);
}
.masthead__title {
  margin: 0;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.1rem); line-height: 1.05;
  letter-spacing: -0.015em;
}
.lede {
  margin: 0.75rem 0 0; max-width: 46rem;
  color: var(--muted); font-size: 0.98rem;
}
.masthead__stamp {
  margin: 0; flex: 0 0 auto; text-align: center;
  font-size: 0.68rem; color: var(--faint); line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.5rem 0.8rem; background: var(--panel);
}
.masthead__stamp b { display: block; font-family: var(--mono); font-size: 0.85rem; color: var(--text); }

/* ── Controls ─────────────────────────────────────────────────────── */

.controls {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--line);
}
.controls__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding-block: 0.7rem;
}
.field { display: block; }
.field--search { flex: 1 1 15rem; min-width: 0; }

input[type="search"], select {
  width: 100%; font: inherit; font-size: 0.88rem;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; appearance: none;
}
input[type="search"]::placeholder { color: var(--faint); }
select { cursor: pointer; padding-inline-end: 1.6rem; }
select option { background: var(--panel); color: var(--text); }

.reset {
  font: inherit; font-size: 0.82rem; cursor: pointer;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
}
.reset:hover { color: var(--text); border-color: var(--faint); }

.controls__status {
  margin: 0; flex: 0 0 auto;
  font-family: var(--mono); font-size: 0.72rem; color: var(--faint);
}

/* ── KPI cards ────────────────────────────────────────────────────── */

.kpis {
  display: grid; gap: 0.7rem; margin-block: 1.5rem;
  grid-template-columns: repeat(6, 1fr);
}
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1rem;
  position: relative; overflow: hidden;
}
/* The tier hue enters as a top edge, not a fill — the number stays readable. */
.kpi::before {
  content: ''; position: absolute; inset-block-start: 0; inset-inline: 0;
  height: 2px; background: var(--faint);
}
.kpi--convicted::before     { background: var(--convicted); }
.kpi--trial::before         { background: var(--trial); }
.kpi--investigation::before { background: var(--investigation); }
.kpi--closed::before        { background: var(--closed); }
.kpi--unresolved::before    { background: var(--unresolved); }

.kpi__value {
  font-family: var(--serif); font-weight: 800;
  font-size: 2.1rem; line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}
.kpi--convicted .kpi__value { color: var(--convicted); }
.kpi__label { font-size: 0.75rem; color: var(--muted); margin-block-start: 0.15rem; }

/* ── Panels and charts ────────────────────────────────────────────── */

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  margin-block-end: 0.7rem;
}
.panel--wide { margin-block-start: 0; }
.panel__title {
  margin: 0 0 0.9rem;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.03em; color: var(--muted);
}
.panel__note { margin: 0.9rem 0 0; font-size: 0.72rem; color: var(--faint); }
.chart__empty { color: var(--faint); font-size: 0.85rem; margin: 0; }

.bar-row {
  display: grid; grid-template-columns: 9.5rem 1fr 2rem;
  align-items: center; gap: 0.7rem; margin-block-end: 0.5rem;
}
.bar-row__label {
  font-size: 0.78rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar {
  display: block; height: 9px;
  background: var(--panel-2); border-radius: 99px; overflow: hidden;
}
.bar__fill {
  display: block; height: 100%; border-radius: 99px;
  background: var(--investigation);
  transition: width 0.3s ease;
}
.bar__fill--convicted     { background: var(--convicted); }
.bar__fill--trial         { background: var(--trial); }
.bar__fill--investigation { background: var(--investigation); }
.bar__fill--closed        { background: var(--closed); }
.bar__fill--unresolved    { background: var(--unresolved); }
.bar-row__value {
  font-family: var(--mono); font-size: 0.82rem;
  text-align: end; font-variant-numeric: tabular-nums;
}

/* ── Decade histogram ─────────────────────────────────────────────── */

.histogram {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 0.5rem; align-items: end;
}
.histogram__col { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.histogram__count { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* The bar's height is a percentage, so it needs a track with a definite
   height to resolve against — against a content-sized column it collapses. */
.histogram__track {
  display: flex; align-items: flex-end;
  width: 100%; height: 7rem;
}
.histogram__bar {
  display: block; width: 100%; min-height: 3px;
  background: linear-gradient(180deg, var(--investigation), color-mix(in srgb, var(--investigation) 35%, transparent));
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}
.histogram__label {
  font-family: var(--mono); font-size: 0.7rem; color: var(--faint);
  padding-block-start: 0.3rem; border-block-start: 1px solid var(--line); width: 100%; text-align: center;
}

/* ── Notice ───────────────────────────────────────────────────────── */

.notice {
  border: 1px solid var(--line); border-inline-start: 3px solid var(--trial);
  border-radius: var(--radius); background: var(--panel);
  padding: 0.85rem 1.1rem; margin-block: 1.4rem 1.75rem;
}
.notice p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.notice strong { color: var(--text); }

/* ── Tier sections ────────────────────────────────────────────────── */

.tier { margin-block-end: 1.75rem; }
.tier[hidden] { display: none; }

.tier__head { display: flex; align-items: center; gap: 0.6rem; }
.tier__marker {
  width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto;
  background: var(--faint);
}
.tier--convicted     .tier__marker { background: var(--convicted); }
.tier--trial         .tier__marker { background: var(--trial); }
.tier--investigation .tier__marker { background: var(--investigation); }
.tier--closed        .tier__marker { background: var(--closed); }
.tier--unresolved    .tier__marker { background: var(--unresolved); }

.tier__title {
  margin: 0; flex: 1 1 auto;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
}
.tier__count {
  font-family: var(--mono); font-size: 0.95rem; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tier--convicted .tier__count { color: var(--convicted); }
.tier__blurb { margin: 0.3rem 0 0.7rem; font-size: 0.8rem; color: var(--faint); }

.recs {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
}

/* ── Record rows ──────────────────────────────────────────────────── */

.rec { border-block-end: 1px solid var(--line-soft); }
.rec:last-child { border-block-end: 0; }
.rec[hidden] { display: none; }

.rec summary {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1.25fr) 4rem minmax(0, 1fr) 1.2rem;
  align-items: center; gap: 0 0.9rem;
  padding: 0.7rem 1rem; cursor: pointer; list-style: none;
}
.rec summary::-webkit-details-marker { display: none; }
.rec summary:hover { background: var(--panel-2); }
.rec[open] summary { background: var(--panel-2); }

.badge {
  display: inline-block; text-align: center; white-space: nowrap;
  font-size: 0.68rem; font-weight: 500;
  padding: 0.22rem 0.5rem; border-radius: 99px;
  border: 1px solid currentColor;
}
.badge--convicted     { color: var(--convicted); }
.badge--trial         { color: var(--trial); }
.badge--investigation { color: var(--investigation); }
.badge--closed        { color: var(--closed); }
.badge--unresolved    { color: var(--unresolved); }

.rec__main { min-width: 0; }
.rec__name {
  display: block; font-weight: 500; font-size: 1rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec__role {
  display: block; font-size: 0.76rem; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec__year {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rec__headline {
  font-size: 0.8rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec__chevron {
  width: 0.45rem; height: 0.45rem; justify-self: center;
  border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg); margin-block-start: -0.2rem;
  transition: transform 0.15s ease;
}
[open] .rec__chevron { transform: rotate(-135deg); margin-block-start: 0.15rem; }

.rec__body { padding: 0 1rem 1.1rem; background: var(--panel-2); }
.rec__body dl { margin: 0; }

.detail {
  display: grid; grid-template-columns: 8rem 1fr; gap: 0.3rem 1rem;
  padding-block: 0.45rem; border-block-start: 1px solid var(--line);
  font-size: 0.85rem;
}
.detail dt { font-size: 0.72rem; color: var(--faint); padding-block-start: 0.15rem; }
.detail dd { margin: 0; color: var(--text); }

.rec__sources {
  margin: 0.9rem 0 0; font-size: 0.8rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem;
}
.rec__sources-label { font-size: 0.72rem; color: var(--faint); }
.rec__sources a { color: var(--investigation); }
.rec__updated {
  margin-inline-start: auto; font-family: var(--mono);
  font-size: 0.7rem; color: var(--faint);
}

.empty {
  margin-block: 3rem; padding-block: 2.5rem; text-align: center;
  color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ── Colophon ─────────────────────────────────────────────────────── */

.colophon {
  margin-block-start: 3rem; padding-block: 2.5rem 3.5rem;
  border-block-start: 1px solid var(--line); background: var(--bg-2);
  font-size: 0.85rem; color: var(--muted);
}
.colophon h2 { margin: 0 0 0.9rem; font-family: var(--serif); font-size: 1.1rem; color: var(--text); }
.colophon p { margin: 0 0 0.8rem; max-width: 48rem; line-height: 1.65; }
.colophon__meta {
  font-size: 0.75rem; color: var(--faint);
  padding-block-start: 0.9rem; border-block-start: 1px solid var(--line);
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 68rem) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .rec summary { grid-template-columns: 6.5rem minmax(0, 1fr) 4rem 1.2rem; }
  .rec__headline { display: none; }
}

@media (max-width: 46rem) {
  .charts { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 7rem 1fr 1.8rem; }
  .histogram { gap: 0.25rem; }
  .histogram__label { font-size: 0.6rem; }
  .histogram__count { font-size: 0.65rem; }
}

@media (max-width: 34rem) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .masthead__inner { flex-direction: column; gap: 1rem; }
  .masthead__stamp { align-self: flex-start; }

  /* Five stacked full-width selects push the data below the fold. Search gets
     its own row; the filters pair up beneath it. */
  .controls__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .field--search, .controls__status { grid-column: 1 / -1; }
  .reset { grid-column: 1 / -1; }

  /* The row becomes two lines: badge + year on top, name below. */
  .rec summary {
    grid-template-columns: auto 1fr 1.2rem;
    gap: 0.35rem 0.6rem; padding: 0.8rem;
  }
  .rec__badge { grid-row: 1; }
  .rec__year  { grid-row: 1; justify-self: start; }
  .rec__main  { grid-row: 2; grid-column: 1 / -1; }
  .rec__name  { white-space: normal; }
  .rec__role  { white-space: normal; }
  .rec__chevron { grid-row: 1; justify-self: end; }
  .rec__body { padding-inline: 0.8rem; }
  .detail { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Bar-size utilities ───────────────────────────────────────────────
 * Generated width/height steps. These exist because the CSP is
 * `style-src 'self'`, which blocks inline style attributes — the usual way to
 * set a bar's size. Relaxing the CSP to 'unsafe-inline' for the sake of a bar
 * chart is a bad trade, so the sizes are classes instead.
 * ------------------------------------------------------------------- */
.bw-0{width:0%}.bw-1{width:1%}.bw-2{width:2%}.bw-3{width:3%}.bw-4{width:4%}.bw-5{width:5%}.bw-6{width:6%}.bw-7{width:7%}.bw-8{width:8%}.bw-9{width:9%}.bw-10{width:10%}.bw-11{width:11%}.bw-12{width:12%}.bw-13{width:13%}.bw-14{width:14%}.bw-15{width:15%}.bw-16{width:16%}.bw-17{width:17%}.bw-18{width:18%}.bw-19{width:19%}.bw-20{width:20%}.bw-21{width:21%}.bw-22{width:22%}.bw-23{width:23%}.bw-24{width:24%}.bw-25{width:25%}.bw-26{width:26%}.bw-27{width:27%}.bw-28{width:28%}.bw-29{width:29%}.bw-30{width:30%}.bw-31{width:31%}.bw-32{width:32%}.bw-33{width:33%}.bw-34{width:34%}.bw-35{width:35%}.bw-36{width:36%}.bw-37{width:37%}.bw-38{width:38%}.bw-39{width:39%}.bw-40{width:40%}.bw-41{width:41%}.bw-42{width:42%}.bw-43{width:43%}.bw-44{width:44%}.bw-45{width:45%}.bw-46{width:46%}.bw-47{width:47%}.bw-48{width:48%}.bw-49{width:49%}.bw-50{width:50%}.bw-51{width:51%}.bw-52{width:52%}.bw-53{width:53%}.bw-54{width:54%}.bw-55{width:55%}.bw-56{width:56%}.bw-57{width:57%}.bw-58{width:58%}.bw-59{width:59%}.bw-60{width:60%}.bw-61{width:61%}.bw-62{width:62%}.bw-63{width:63%}.bw-64{width:64%}.bw-65{width:65%}.bw-66{width:66%}.bw-67{width:67%}.bw-68{width:68%}.bw-69{width:69%}.bw-70{width:70%}.bw-71{width:71%}.bw-72{width:72%}.bw-73{width:73%}.bw-74{width:74%}.bw-75{width:75%}.bw-76{width:76%}.bw-77{width:77%}.bw-78{width:78%}.bw-79{width:79%}.bw-80{width:80%}.bw-81{width:81%}.bw-82{width:82%}.bw-83{width:83%}.bw-84{width:84%}.bw-85{width:85%}.bw-86{width:86%}.bw-87{width:87%}.bw-88{width:88%}.bw-89{width:89%}.bw-90{width:90%}.bw-91{width:91%}.bw-92{width:92%}.bw-93{width:93%}.bw-94{width:94%}.bw-95{width:95%}.bw-96{width:96%}.bw-97{width:97%}.bw-98{width:98%}.bw-99{width:99%}.bw-100{width:100%}
.bh-0{height:2%}.bh-1{height:2%}.bh-2{height:2%}.bh-3{height:3%}.bh-4{height:4%}.bh-5{height:5%}.bh-6{height:6%}.bh-7{height:7%}.bh-8{height:8%}.bh-9{height:9%}.bh-10{height:10%}.bh-11{height:11%}.bh-12{height:12%}.bh-13{height:13%}.bh-14{height:14%}.bh-15{height:15%}.bh-16{height:16%}.bh-17{height:17%}.bh-18{height:18%}.bh-19{height:19%}.bh-20{height:20%}.bh-21{height:21%}.bh-22{height:22%}.bh-23{height:23%}.bh-24{height:24%}.bh-25{height:25%}.bh-26{height:26%}.bh-27{height:27%}.bh-28{height:28%}.bh-29{height:29%}.bh-30{height:30%}.bh-31{height:31%}.bh-32{height:32%}.bh-33{height:33%}.bh-34{height:34%}.bh-35{height:35%}.bh-36{height:36%}.bh-37{height:37%}.bh-38{height:38%}.bh-39{height:39%}.bh-40{height:40%}.bh-41{height:41%}.bh-42{height:42%}.bh-43{height:43%}.bh-44{height:44%}.bh-45{height:45%}.bh-46{height:46%}.bh-47{height:47%}.bh-48{height:48%}.bh-49{height:49%}.bh-50{height:50%}.bh-51{height:51%}.bh-52{height:52%}.bh-53{height:53%}.bh-54{height:54%}.bh-55{height:55%}.bh-56{height:56%}.bh-57{height:57%}.bh-58{height:58%}.bh-59{height:59%}.bh-60{height:60%}.bh-61{height:61%}.bh-62{height:62%}.bh-63{height:63%}.bh-64{height:64%}.bh-65{height:65%}.bh-66{height:66%}.bh-67{height:67%}.bh-68{height:68%}.bh-69{height:69%}.bh-70{height:70%}.bh-71{height:71%}.bh-72{height:72%}.bh-73{height:73%}.bh-74{height:74%}.bh-75{height:75%}.bh-76{height:76%}.bh-77{height:77%}.bh-78{height:78%}.bh-79{height:79%}.bh-80{height:80%}.bh-81{height:81%}.bh-82{height:82%}.bh-83{height:83%}.bh-84{height:84%}.bh-85{height:85%}.bh-86{height:86%}.bh-87{height:87%}.bh-88{height:88%}.bh-89{height:89%}.bh-90{height:90%}.bh-91{height:91%}.bh-92{height:92%}.bh-93{height:93%}.bh-94{height:94%}.bh-95{height:95%}.bh-96{height:96%}.bh-97{height:97%}.bh-98{height:98%}.bh-99{height:99%}.bh-100{height:100%}
