:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #ffffff; --text: #191919; --muted: #666666;
  --line: #e2e4e9; --brand: #257de0; --brand-ink: #ffffff; --danger: #c62828; --ok: #008a17;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101113; --surface: #191919; --text: #efefef; --muted: #9c9c9c;
    --line: #2d2f34; --brand: #338ced; --danger: #ef6b6b; --ok: #0aac23; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }
main.wide { max-width: 980px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.desc { white-space: pre-wrap; max-height: 45vh; overflow: auto; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible, .opt:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 12px 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.danger { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-top: 14px; }
.check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.opt { display: flex; gap: 12px; align-items: center; padding: 14px; margin: 10px 0; font-weight: 500;
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.opt input { width: 20px; height: 20px; flex: none; }
.msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.msg.err { color: var(--danger); border-color: var(--danger); }
.msg.ok { color: var(--ok); border-color: var(--ok); }
.center { text-align: center; }
.big { font-size: 3rem; line-height: 1; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); }
.badge.open { color: var(--ok); border-color: var(--ok); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal > div { background: var(--surface); border-radius: var(--radius); padding: 22px; max-width: 420px; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.opt-input { display: flex; gap: 8px; margin-bottom: 8px; }
.opt-input button { padding: 0 14px; }
.link-box { word-break: break-all; padding: 10px 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.charts canvas { max-width: 100%; }
