
:root {
  --radius: 6px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
/* Dark is the default; Settings can switch to light or follow the system. */
:root, [data-theme="dark"] {
  --bg: #141412;
  --panel: #1c1b18;
  --panel-2: #24221e;
  --line: #2f2d28;
  --line-strong: #403d36;
  --text: #ecebe6;
  --muted: #aaa598;
  --faint: #9a958a;
  --accent: #f0a04b;
  --accent-soft: #3a2a17;
  --on-accent: #1d1c19;
  --ok: #6cc59a;
  --ok-soft: #173126;
  --warn: #e6b450;
  --warn-soft: #352a12;
  --bad: #f08b75;
  --bad-soft: #3a1d17;
  --info: #9bb4f0;
  --info-soft: #1d2640;
  --sim: #c0aee6;
  --sim-soft: #2a2438;
  color-scheme: dark;
}
[data-theme="light"] {

  --bg: #f6f5f1;
  --panel: #ffffff;
  --panel-2: #efede6;
  --line: #e1ded4;
  --line-strong: #cfcabc;
  --text: #1d1c19;
  --muted: #5f5b52;
  --faint: #6e695f;
  --accent: #a65a08;
  --accent-soft: #fbecd9;
  --on-accent: #ffffff;
  --ok: #24724f;
  --ok-soft: #e1f1e8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d3;
  --bad: #a83a26;
  --bad-soft: #f8e3dd;
  --info: #35539a;
  --info-soft: #e5ebf8;
  --sim: #6b5a8e;
  --sim-soft: #ece7f5;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {

  --bg: #f6f5f1;
  --panel: #ffffff;
  --panel-2: #efede6;
  --line: #e1ded4;
  --line-strong: #cfcabc;
  --text: #1d1c19;
  --muted: #5f5b52;
  --faint: #6e695f;
  --accent: #a65a08;
  --accent-soft: #fbecd9;
  --on-accent: #ffffff;
  --ok: #24724f;
  --ok-soft: #e1f1e8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d3;
  --bad: #a83a26;
  --bad-soft: #f8e3dd;
  --info: #35539a;
  --info-soft: #e5ebf8;
  --sim: #6b5a8e;
  --sim-soft: #ece7f5;
  color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code, .id { font-family: var(--mono); font-size: 12.5px; }
.id { overflow-wrap: anywhere; }
td .id { white-space: nowrap; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand svg { color: var(--accent); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { padding: 6px 10px; border-radius: var(--radius); text-decoration: none; color: var(--muted); white-space: nowrap; transition: background-color 150ms ease-out, color 150ms ease-out; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); font-weight: 600; }
.nav .count { margin-left: 5px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 6px; font-size: 12px; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 4px; font-weight: 650; text-wrap: balance; }
h2 { font-size: 15px; margin: 32px 0 10px; font-weight: 650; letter-spacing: -0.005em; }
h2:first-child { margin-top: 0; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 68ch; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 28px; overflow: hidden; }
.strip > div { padding: 12px 16px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.strip dt { color: var(--muted); font-size: 12.5px; }
.strip dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
.strip dd .sub { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 400; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
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; font-weight: 600; color: var(--muted); background: var(--panel-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
td.num, th.num { text-align: right; }
tr.quiet td { color: var(--faint); }
.nowrap { white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-accent { background: var(--accent-soft); color: var(--accent); }
.b-sim { background: var(--sim-soft); color: var(--sim); }
.b-neutral { background: var(--panel-2); color: var(--muted); }

.ev { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.ev-catalog { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.ev-account { border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); }
.ev-hint { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); border-style: dashed; }
.ev-announcement { border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); border-style: dashed; }
.ev-enrichment { color: var(--faint); }
.ev-history { color: var(--faint); border-style: dotted; }

.kind { font-weight: 600; white-space: nowrap; }
.k-added, .k-returned { color: var(--ok); }
.k-removed { color: var(--bad); }
.k-hint { color: var(--warn); }
.k-announcement { color: var(--info); }

form.inline { display: inline; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
input, select, button { font: inherit; color: inherit; }
input[type="text"], input[type="search"], input[type="password"], select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 9px; min-height: 34px;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--faint); }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; font-weight: 550; text-decoration: none; white-space: nowrap; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.btn:hover { background: var(--panel-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { color: var(--muted); background: var(--panel-2); cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 28px; padding: 3px 9px; font-size: 12.5px; }

.notice { max-width: 72ch; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--line); background: var(--panel); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.sim { background: var(--sim-soft); border-color: color-mix(in srgb, var(--sim) 30%, transparent); }
.notice strong { font-weight: 650; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 4px auto; max-width: 60ch; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; padding: 14px 16px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.alert-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-width: 560px; }
.alert-card .t { font-weight: 650; margin-bottom: 6px; }
.alert-card dl { display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.alert-card dt { color: var(--muted); }
.alert-card dd { margin: 0; overflow-wrap: anywhere; }
details > summary { cursor: pointer; color: var(--muted); }
pre { background: var(--panel-2); border-radius: var(--radius); padding: 12px; overflow-x: auto; font: 12px/1.5 var(--mono); margin: 8px 0 0; }
.conflict { background: var(--warn-soft); }
.pager { display: flex; gap: 8px; margin-top: 12px; }

main p.small { max-width: 76ch; }
.estimate { border-style: dashed; border-color: var(--line-strong); padding: 16px 18px 6px; margin: 20px 0; }
.estimate h2 { margin: 0; font-size: 15px; }
.estimate-main { font-size: 20px; font-weight: 600; margin: 10px 0 4px; }
.b-estimate { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
.timeline { margin: 0; padding: 14px 16px 4px; overflow-x: auto; }
.timeline svg { display: block; width: 100%; min-width: 640px; height: auto; }
.timeline .axis { stroke: var(--line-strong); stroke-width: 1.5; }
.timeline .tick { stroke: var(--line-strong); }
.timeline .now { stroke: var(--faint); stroke-dasharray: 3 3; }
.timeline text { fill: var(--muted); font: 12px var(--font); }
.timeline .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.timeline .dot-minor { fill: var(--faint); }
.timeline a:hover circle, .timeline a:focus-visible circle { fill: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 4px 10px; text-decoration: none; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a:hover { color: var(--text); background: var(--panel-2); }
.seg a[aria-current="true"] { background: var(--panel-2); color: var(--text); font-weight: 600; }
tr[id]:target td { background: var(--accent-soft); }
.claims { margin: 6px 0 2px; padding-left: 16px; font-size: 12.5px; color: var(--muted); }
ul.plain { list-style: none; margin: 0; padding: 0; }
.credit { margin-top: 28px; color: var(--faint); font-size: 12.5px; max-width: 72ch; }

.login { max-width: 360px; margin: 12vh auto 0; }
.login .panel { padding: 22px; }
.theme-form { display: grid; justify-items: start; gap: 14px; padding: 14px 16px; margin-bottom: 28px; width: fit-content; max-width: 100%; }
.theme-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.theme-form legend { padding: 0; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; }
.theme-form label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.theme-form input[type="radio"] { accent-color: var(--accent); margin: 0; }
.login label { display: grid; gap: 6px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.form-stack label { display: grid; gap: 6px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.form-stack input { width: 100%; }
.login input { width: 100%; }

@media (max-width: 720px) {
  .top-inner { gap: 4px 12px; padding: 8px 12px 6px; height: auto; flex-wrap: wrap; }
  .top-right { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -4px; }
  .top-right .mode-label { display: none; }
  main { padding: 18px 12px 48px; }
  th, td { padding: 8px 9px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
