:root {
  --bg: #f4f6f9; --card: #ffffff; --ink: #1d2433; --ink-soft: #5b6472; --line: #dde3ea;
  --brand: #0f3d5e; --brand-ink: #ffffff;
  --value: #e3f4e7; --value-ink: #17663a; --watch: #fff6d6; --watch-ink: #7a5a00;
  --no: #fbe6e6; --no-ink: #9b1c1c; --grey: #eef1f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d; --card: #1a212b; --ink: #e6ebf1; --ink-soft: #9aa5b3; --line: #2b3542;
    --brand: #3d8bd0; --value: #173524; --value-ink: #7fd8a0; --watch: #3a3216; --watch-ink: #f1d06a;
    --no: #3d1d1d; --no-ink: #f2a3a3; --grey: #222a35;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
button { font: inherit; border: 0; border-radius: 8px; padding: 10px 14px; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); width: 100%; }
label { display: block; margin: 10px 0 4px; color: var(--ink-soft); font-size: 13px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.error { color: var(--no-ink); }
.warn { color: var(--watch-ink); font-size: 13px; }
.empty { padding: 24px 16px; color: var(--ink-soft); text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 16px; }
#login { display: grid; place-items: center; min-height: 100vh; }
#login .card { width: min(360px, calc(100% - 32px)); }
#login button { width: 100%; margin-top: 14px; }
.top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
.top button { width: 100%; }
#refresh-info { margin-top: 6px; }
main { padding-bottom: 76px; max-width: 760px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; color: var(--ink-soft); border-radius: 0; padding: 14px 4px; }
.tabs button.active { color: var(--brand); font-weight: 600; box-shadow: inset 0 3px 0 var(--brand); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; }
.pill { white-space: nowrap; background: var(--grey); color: var(--ink); padding: 8px 12px; border-radius: 999px; }
.pill.active { background: var(--brand); color: var(--brand-ink); }
.list { display: grid; gap: 8px; padding: 0 16px; }
.plus-title { margin: 18px 16px 8px; font-size: 14px; color: var(--ink-soft); }
.row { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.row.d-value { border-left-color: var(--value-ink); background: var(--value); }
.row.d-watch { border-left-color: var(--watch-ink); background: var(--watch); }
.row.d-no { border-left-color: var(--no-ink); background: var(--no); }
.row.d-grey { border-left-color: var(--ink-soft); }
.row-main { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.row-title { display: grid; gap: 2px; min-width: 0; }
.row-title strong { overflow-wrap: anywhere; }
.row-nums { display: grid; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-entry { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.row-entry .odds { width: 96px; flex: none; }
.decision { font-size: 13px; font-weight: 600; }
.row-detail { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.row-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.row-detail dt { color: var(--ink-soft); }
.row-detail dd { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
h3 { margin: 0 0 8px; font-size: 16px; }
h4 { margin: 12px 0 4px; font-size: 14px; }
#toast { position: fixed; left: 16px; right: 16px; bottom: 84px; background: var(--ink); color: var(--bg); padding: 10px 14px;
  border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; }
