:root {
  --bg: #f7f5f0; --surface: #ffffff; --text: #1d1d1b; --muted: #5f5d57; --border: #dedad0;
  --accent: #7a2e1f; --accent-soft: #f3e4df; --head: #1f2a44;
  --died: #9b2c20; --died-bg: #f8dcd7; --inj: #8a4b00; --inj-bg: #fbe8cf;
  --surv: #2b6a2f; --surv-bg: #dcefd9; --unk: #555; --unk-bg: #ececec; --left: #2c4f86; --left-bg: #dde7f5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a; --surface: #1e2025; --text: #ebe8e1; --muted: #a29f97; --border: #34363d;
    --accent: #e08a74; --accent-soft: #3a2621; --head: #2a3550;
    --died: #f2a093; --died-bg: #4a221d; --inj: #f3c07e; --inj-bg: #47331a;
    --surv: #9ed49f; --surv-bg: #1f3a22; --unk: #c4c4c4; --unk-bg: #33353a; --left: #a9c3ee; --left-bg: #23314a;
  }
}
:root[data-theme="dark"] {
  --bg: #15161a; --surface: #1e2025; --text: #ebe8e1; --muted: #a29f97; --border: #34363d;
  --accent: #e08a74; --accent-soft: #3a2621; --head: #2a3550;
  --died: #f2a093; --died-bg: #4a221d; --inj: #f3c07e; --inj-bg: #47331a;
  --surv: #9ed49f; --surv-bg: #1f3a22; --unk: #c4c4c4; --unk-bg: #33353a; --left: #a9c3ee; --left-bg: #23314a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Georgia, "Times New Roman", serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }
header { padding: 36px 0 20px; border-bottom: 2px solid var(--text); margin-bottom: 20px; }
.eyebrow { font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 8px 0 10px; font-weight: 700; }
.lede { color: var(--muted); max-width: 760px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.stat b { display: block; font: 700 24px/1.1 system-ui, sans-serif; }
.stat span { font: 13px/1.3 system-ui, sans-serif; color: var(--muted); }
.controls { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }
.controls input, .controls select, .controls button {
  font: 14px system-ui, sans-serif; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; min-height: 38px; }
.controls input { flex: 1 1 240px; min-width: 0; }
.controls select { flex: 0 1 auto; max-width: 100%; }
.controls button { cursor: pointer; }
.count { font: 13px system-ui, sans-serif; color: var(--muted); margin: 10px 0; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font: 14px/1.4 system-ui, sans-serif; }
th { position: sticky; top: 0; background: var(--head); color: #fff; text-align: left; font-weight: 600; padding: 9px 10px; white-space: nowrap; cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
td { padding: 8px 10px; border-top: 1px solid var(--border); vertical-align: top; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--accent-soft); }
tr.row td:first-child { font-weight: 600; }
tr.detail td { background: var(--bg); padding: 12px 14px 14px; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.o-died { color: var(--died); background: var(--died-bg); }
.o-inj { color: var(--inj); background: var(--inj-bg); }
.o-surv { color: var(--surv); background: var(--surv-bg); }
.o-unk { color: var(--unk); background: var(--unk-bg); }
.o-left { color: var(--left); background: var(--left-bg); }
.flag { color: var(--accent); font-size: 12px; margin-left: 6px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 14px 0; font: 14px system-ui, sans-serif; }
.pager button { font: inherit; padding: 6px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 5px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }
section.about { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 18px; color: var(--muted); font-size: 14px; }
section.about h2 { color: var(--text); font-size: 20px; margin: 0 0 8px; }
a { color: var(--accent); }
@media (max-width: 700px) {
  .hide-sm { display: none; }
  .detail dl { grid-template-columns: 1fr; }
  .detail dt { margin-top: 6px; }
}
.loadmsg { font: 14px system-ui, sans-serif; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
