:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #5f6670;
  --line: #d9dde3;
  --panel: #f6f7f9;
  --head: #808080;
  --good: #1a7f37;
  --bad: #c62828;
  --tip-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --fg: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2f343b;
    --panel: #1f2227;
    --head: #4a4f57;
    --good: #4cc26a;
    --bad: #ff6b6b;
    --tip-bg: #24272d;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
}

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 22px; }
.sub { margin: 2px 0 0; color: var(--muted); }
.who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 16px 0; max-width: 520px; }
button { font: inherit; cursor: pointer; }
.primary { background: #2f5597; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0; }
.step { background: var(--panel); border: 1px solid var(--line); color: var(--fg); border-radius: 6px; width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.step:disabled { opacity: .4; cursor: default; }
select { font: inherit; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); max-width: 100%; }

.status { color: var(--muted); min-height: 1.4em; margin: 10px 0; }
.status.bad { color: var(--bad); }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.controls .link { margin-left: 8px; font-size: 13px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 4px; }
.foot { color: var(--muted); font-size: 12px; margin-top: 18px; }

.sec-title {
  margin: 18px 0 6px; padding: 6px 10px; color: #000; font-size: 15px;
  display: flex; align-items: center; cursor: pointer; user-select: none; border-bottom: 3px solid;
}
.sec-title span:first-child { flex: 1; text-align: center; font-weight: 700; letter-spacing: .04em; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; white-space: nowrap; min-width: 100%; }
th { background: var(--head); color: #fff; padding: 6px 8px; text-align: right; font-weight: 600; cursor: help; }
th:first-child, td:first-child { text-align: left; }
td { padding: 6px 8px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
td.miss { color: var(--bad); font-weight: 600; }
td.hit { color: var(--good); font-weight: 600; }
td.cash-deep { background: #8B0000; color: #fff; font-weight: 600; }
th small { display: block; font-weight: 400; font-size: 11px; color: #eee; }
td.empty { color: var(--muted); }
tr.all td { color: #fff; font-weight: 700; border-top: 0; cursor: help; }
tr.wow td { font-weight: 600; cursor: help; background: var(--panel); border-top: 0; border-bottom: 2px solid var(--line); }
tr.wow td:first-child { font-weight: 600; }
tr.wow td.up { color: var(--good); }
tr.wow td.down { color: var(--bad); }
tr.wow td.flat { color: var(--muted); }
.collapsed tr.store { display: none; }

.tip {
  position: fixed; display: none; z-index: 50; max-width: 280px; white-space: normal;
  background: var(--tip-bg); color: var(--fg); border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 8px; font-size: 12px; pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 600px) {
  body { padding: 12px 16px; }
  h1 { font-size: 19px; }
}
