:root {
  --bg: #f7f6f3; --surface: #ffffff; --text: #1c1b1a; --muted: #6a655e; --border: #e3e0da;
  --accent: #b3261e; --link: #1f5fbf;
  --map-water: #dfe8ee; --map-land: #ffffff; --map-line: #b9b4ac;
  --c-conviction: #1b7f4b; --c-settled: #8a5a00; --c-pending: #b3261e;
  --c-federal: #3b5bdb; --c-no-charges: #6b6b6b; --c-discredited: #7a4fb5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141312; --surface: #1e1d1b; --text: #eceae6; --muted: #a8a39b; --border: #34322e;
    --accent: #ff6b5e; --link: #8ab4ff;
    --map-water: #10161b; --map-land: #25231f; --map-line: #4a4640;
    --c-conviction: #5cc98d; --c-settled: #e3b341; --c-pending: #ff8a80;
    --c-federal: #8aa2ff; --c-no-charges: #a0a0a0; --c-discredited: #c3a0f0;
  }
}
:root[data-theme="dark"] {
  --bg: #141312; --surface: #1e1d1b; --text: #eceae6; --muted: #a8a39b; --border: #34322e;
  --accent: #ff6b5e; --link: #8ab4ff;
  --map-water: #10161b; --map-land: #25231f; --map-line: #4a4640;
  --c-conviction: #5cc98d; --c-settled: #e3b341; --c-pending: #ff8a80;
  --c-federal: #8aa2ff; --c-no-charges: #a0a0a0; --c-discredited: #c3a0f0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 28px; }

h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.lede { margin: 0 0 16px; color: var(--muted); }

#map { height: 480px; border-radius: 10px; border: 1px solid var(--border); background: var(--map-water); z-index: 0; }
@media (max-width: 600px) { #map { height: 320px; } }
.leaflet-container { background: var(--map-water); }
.leaflet-popup-content { font: 14px/1.45 system-ui, sans-serif; }
.leaflet-popup-content b { display: block; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 6px; }
#q {
  flex: 1 1 260px; min-width: 0; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.toggle button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.toggle button.on { background: var(--text); color: var(--surface); }
.count { color: var(--muted); font-size: .88rem; margin: 6px 0 8px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
table.rank { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rank th, .rank td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.rank th { color: var(--muted); font-weight: 600; font-size: .78rem; white-space: nowrap; }
.rank .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank td:nth-child(2) { min-width: 220px; }
.school { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.flag {
  margin-left: 6px; font: inherit; font-size: .72rem; font-weight: 600; color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; cursor: pointer; vertical-align: 1px;
}
tr.detail td { background: var(--bg); }
.case { padding: 4px 0 8px; max-width: 75ch; }
.case + .case { border-top: 1px dashed var(--border); padding-top: 10px; }
.case p { margin: 6px 0; }
.case .src { font-size: .85rem; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.b-conviction { color: var(--c-conviction); } .b-settled { color: var(--c-settled); } .b-pending { color: var(--c-pending); }
.b-federal { color: var(--c-federal); } .b-no-charges { color: var(--c-no-charges); } .b-discredited { color: var(--c-discredited); }

.more { margin: 12px 0 0; font: inherit; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.footer { color: var(--muted); font-size: .82rem; padding: 28px 16px 40px; }
@media (max-width: 600px) {
  .rank .opt { display: none; }
  .rank td:nth-child(2) { min-width: 0; }
  .rank th, .rank td { padding: 8px 6px; }
}

.flag.live { background: var(--accent); color: var(--surface); }
.process { margin: 10px 0 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.process summary { cursor: pointer; font-weight: 600; }
.process h3 { margin: 0; font-size: 1rem; }
.process ol { margin: 6px 0 0; padding-left: 20px; font-size: .88rem; }
.process li { margin: 3px 0; }
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.track { margin: 10px 0; }
.track-h { font-size: .9rem; margin-bottom: 4px; }
.state { font-size: .75rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.state.active { color: var(--accent); }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.stepper li { font-size: .74rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.stepper li.done { background: var(--border); color: var(--text); }
.stepper li.now { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.stepper li.end { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.stepper li.todo { opacity: .55; border-style: dashed; }

.news { margin-top: 32px; }
.news h2 { margin: 0 0 2px; font-size: 1.25rem; }
.news ul { list-style: none; margin: 10px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.news li { padding: 10px 14px; border-top: 1px solid var(--border); }
.news li:first-child { border-top: 0; }
.news a { font-weight: 600; text-decoration: none; }
.news a:hover { text-decoration: underline; }

tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus td { background: var(--bg); }
tr.click.open td { background: var(--bg); border-bottom-color: transparent; }
tr.click:focus { outline: 2px solid var(--link); outline-offset: -2px; }
.caret { display: inline-block; width: 1em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--surface); white-space: nowrap; }
.chip.live { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.rank.cases .case-title { min-width: 200px; }
tr.detail > td { padding: 6px 16px 18px; }
tr.detail h4 { margin: 16px 0 6px; font-size: .95rem; }
table.yrs { border-collapse: collapse; font-size: .88rem; margin: 4px 0; }
.yrs th, .yrs td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--border); text-align: left; }
.yrs .n { text-align: right; font-variant-numeric: tabular-nums; }
.yrs tr.tot td { font-weight: 700; border-bottom: 0; }
.mini-news { list-style: none; padding: 0; margin: 4px 0; }
.mini-news li { margin: 6px 0; font-size: .9rem; }
@media (max-width: 600px) { .chip { white-space: normal; } .rank.cases .case-title { min-width: 0; } }
.mobile-only { display: none; }
@media (max-width: 600px) { .mobile-only { display: block; margin-top: 4px; } }

.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.big div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.big b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.2; }
.big span { color: var(--muted); font-size: .82rem; }

.go { color: var(--muted); font-weight: 400; }
.back { font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--link); cursor: pointer; margin: 12px 0 4px; }
.school-page { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 16px 16px; margin-top: 6px; }
.school-h { margin: 8px 0 2px; font-size: 1.4rem; }
.school-page h4 { margin: 20px 0 6px; font-size: 1rem; }
.school-page .case { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; max-width: none; }
[hidden] { display: none !important; }

.log details { border-top: 1px solid var(--border); padding: 8px 0; }
.log summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.log .log-date { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; margin-right: 6px; }
.log dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 4px 18px; font-size: .9rem; }
.log dt { color: var(--muted); }
.log dd { margin: 0; }

/* One-word case status, colored by legal track */
:root { --t-crim: #b3261e; --t-civ: #1f5fbf; --t-sch: #a15c00; --t-fed: #5f5b55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-crim: #ff8a80; --t-civ: #8ab4ff; --t-sch: #f0b35a; --t-fed: #a8a39b; } }
:root[data-theme="dark"] { --t-crim: #ff8a80; --t-civ: #8ab4ff; --t-sch: #f0b35a; --t-fed: #a8a39b; }
.st { display: inline-block; min-width: 5.6em; text-align: center; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; vertical-align: 1px; }
.t-crim { background: var(--t-crim); } .t-civ { background: var(--t-civ); } .t-sch { background: var(--t-sch); } .t-fed { background: var(--t-fed); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st { color: #141312; } }
.legend .st { min-width: 0; }
.items { border-top: 1px solid var(--border); }
.item { border-bottom: 1px solid var(--border); }
.item > summary { cursor: pointer; padding: 10px 0; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary .it-title { flex: 1; font-weight: 600; }
.item[open] > summary .it-title { color: var(--link); }
.it-body { padding: 0 0 12px; }
.it-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; font-size: .9rem; }
.it-body dt { color: var(--muted); } .it-body dd { margin: 0; }
.fed { margin-top: 14px; }
.th-sub { font-weight: 400; font-size: .68rem; }
.fed-top { margin: 6px 0 2px; }
.fed-top b { font-size: 1.3rem; color: var(--accent); }
:root { --t-news: #6b3fa0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-news: #c3a0f0; } }
:root[data-theme="dark"] { --t-news: #c3a0f0; }
.t-news { background: var(--t-news); }
.mug { margin: 6px 0 10px; }
.mug img { display: block; width: 160px; max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }
.mug figcaption { margin-top: 4px; }
.hit-note { color: var(--link); margin-top: 2px; }
.item.hit > summary .it-title { background: rgba(255, 213, 0, .25); }
.finds { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; margin: 12px 0; }
.finds-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finds h2 { font-size: .95rem; margin: 0; }
.finds-nav { display: flex; align-items: center; gap: 6px; }
.finds-nav button { border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 6px; width: 28px; height: 28px; font-size: 1.1rem; line-height: 1; cursor: pointer; }
/* All items share one grid cell, so the box is as tall as the longest item: nothing is cut off and the size never changes as it rotates. */
.finds-slide { display: grid; margin-top: 6px; line-height: 1.35; }
.finds-slide > .find { grid-area: 1 / 1; visibility: hidden; }
.finds-slide > .find.on { visibility: visible; animation: finds-in .35s ease; }
@keyframes finds-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .finds-slide > .find.on { animation: none; } }
.find-t { overflow-wrap: anywhere; }
.find .st { margin-bottom: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-color: currentColor; font-weight: 700; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
