:root {
  --bg: #f4f6f5; --surface: #ffffff; --ink: #1b2a2e; --muted: #5a6b70; --line: #d6dfdd;
  --accent: #1d6a5e; --accent-ink: #ffffff; --accent-soft: #e0eeeb;
  --amber: #8a5a00; --amber-soft: #f7ecd6; --red: #a3302a; --red-soft: #f8e2e0; --ok: #24683a; --ok-soft: #e1f0e5;
  --font: "Segoe UI", "Noto Sans Ethiopic", "Nyala", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12191b; --surface: #1a2427; --ink: #e2ebea; --muted: #9aaeb0; --line: #2c3a3e;
    --accent: #5cb8a8; --accent-ink: #0d1716; --accent-soft: #1d3532;
    --amber: #e6b65c; --amber-soft: #352a17; --red: #ef8b84; --red-soft: #3b201f; --ok: #7fcf96; --ok-soft: #1c3324;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--accent); }
h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 19px; margin: 32px 0 12px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 24px 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); font-weight: 600; }
nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
nav a { text-decoration: none; }
.who { color: var(--muted); }
.foot { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 8px; }
.stack label { font-weight: 600; margin-top: 6px; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[readonly] { background: var(--bg); }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.ghost { background: var(--accent-soft); color: var(--ink); }
.btn.danger { background: var(--red); color: #fff; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
button.link.danger { color: var(--red); }
form.inline { display: inline; }
.muted { color: var(--muted); }
.alert { background: var(--red-soft); color: var(--ink); border-radius: 6px; padding: 10px 14px; }
.alert ul { margin: 0; padding-left: 18px; }
.ok-line { background: var(--ok-soft); border-radius: 6px; padding: 8px 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 12px 0; }
.panel.warn { background: var(--amber-soft); border-color: transparent; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.inactive td { color: var(--muted); }
tr.flag td { background: var(--amber-soft); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.detail { font-family: var(--mono); font-size: 12.5px; word-break: break-word; max-width: 380px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; background: var(--accent-soft); }
.pill.ok { background: var(--ok-soft); }
.pill.amber, .pill.risk-elevated { background: var(--amber-soft); }
.pill.risk-high, .pill.risk-immediate { background: var(--red-soft); color: var(--red); font-weight: 600; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.search { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.search input { width: auto; min-width: 220px; }
.case-head .facts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.crumbs { margin: 0; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.note header { margin-bottom: 6px; }
.note .body { white-space: pre-wrap; word-break: break-word; }
.empty { color: var(--muted); padding: 12px 0; }
.qr { background: #fff; padding: 8px; border-radius: 6px; max-width: 100%; height: auto; }
.key { font-family: var(--mono); background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.wrapall { word-break: break-all; display: inline-block; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.grid-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.launch { background: var(--surface); }
