:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1e24;
  --muted: #5c6470;
  --line: #e1e4e9;
  --brand: #22406b;
  --accent: #2b5797;
  --chip: #eaf0f8;
  --done: #1e6b3c;
  --done-bg: #e5f3ea;
  --wip: #8a5a00;
  --wip-bg: #fff3d6;
  --warn: #a3261a;
  --warn-bg: #fdeceb;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e6e9ee;
    --muted: #9aa3af;
    --line: #2a3039;
    --brand: #172b48;
    --accent: #8fb3ec;
    --chip: #1d2735;
    --done: #7fd19c;
    --done-bg: #16291e;
    --wip: #f0c35a;
    --wip-bg: #33280f;
    --warn: #ff8f84;
    --warn-bg: #3a1815;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--brand); color: #fff;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.top nav { display: flex; gap: 16px; font-size: 14px; }
.top nav a { color: #dbe5f5; text-decoration: none; }
.top nav a:hover { color: #fff; }

h1 { font-size: 22px; line-height: 1.4; margin: 24px 0 6px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.lead { margin: 0 0 18px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.filters input, .filters select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
.filters input { flex: 1 1 220px; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: 13px; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

.cards { display: grid; gap: 10px; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.card:hover { border-color: var(--accent); }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.card h3 { font-size: 16px; margin: 4px 0 4px; line-height: 1.5; }
.card p { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.s-report_published { color: var(--done); background: var(--done-bg); }
.s-report_received, .s-interim { color: var(--accent); background: var(--chip); }
.s-investigating { color: var(--wip); background: var(--wip-bg); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--chip); color: var(--text); margin: 2px 4px 2px 0; }
.amount { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.panel h2 { margin-top: 0; }
.panel ul { margin: 0; padding-left: 1.2em; }
.panel li + li { margin-top: 4px; }
.flags { border-left: 4px solid var(--warn); }
.flags h2 { color: var(--warn); }
.note { font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

table.other { width: 100%; border-collapse: collapse; font-size: 14px; }
table.other td { border-top: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
table.other td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

.foot { font-size: 12px; color: var(--muted); padding-top: 24px; padding-bottom: 40px; }
@media (max-width: 560px) {
  h1 { font-size: 19px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 8px; }
}
