:root {
  --bg: #0d1511; --panel: #141f19; --panel-2: #1a2820; --line: #263a2f;
  --gold: #c9a961; --gold-dim: #8f7a45; --cream: #efe8d6; --muted: #98a597;
  --good: #6fbf8a; --bad: #d46a5f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--cream); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 500px at 50% -200px, #1b2e23 0%, transparent 70%), var(--bg); min-height: 100vh; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: .01em; margin: 0; }
a { color: var(--gold); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 28px 0 8px; }
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.brand .mark { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold-dim);
  display: grid; place-items: center; font-family: Georgia, serif; color: var(--gold); font-size: 22px; background: var(--panel); }
.brand h1 { font-size: 26px; }
.brand small { display: block; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
select, input, button { font: inherit; color: var(--cream); }
select, input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 40px; }
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hero { padding: 28px 0 8px; }
.hero h2 { font-size: clamp(26px, 5vw, 40px); }
.hero p { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.kpi .label { color: var(--muted); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.kpi .value { font-family: Georgia, serif; font-size: 30px; color: var(--gold); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 13px; }
.cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 14px; }
.card h3 { font-size: 18px; margin-bottom: 12px; }
.card h3 span { color: var(--muted); font: 13px system-ui; margin-left: 8px; }
svg.chart { width: 100%; height: auto; display: block; }
svg text { fill: var(--muted); font: 11px system-ui; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 1.1fr) 3fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.bar-row .track { background: var(--panel-2); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-row .fill { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); height: 100%; border-radius: 6px; }
.bar-row .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who img { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); flex: none; }
.rank { color: var(--gold); font-family: Georgia, serif; width: 20px; flex: none; }
.empty { color: var(--muted); padding: 18px 0; }
footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 40px; }
/* panel admina */
.badge { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); border-radius: 999px; padding: 2px 9px; }
.section { margin-top: 18px; }
.cfg-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line); }
.cfg-row:first-of-type { border-top: 0; }
.cfg-row .key { font-family: ui-monospace, monospace; font-size: 13px; color: var(--gold); }
.cfg-row .desc { color: var(--muted); font-size: 13.5px; }
.cfg-row .hint { color: var(--muted); font-size: 12px; }
.cfg-row .err { color: var(--bad); font-size: 13px; min-height: 1em; }
.cfg-row input { width: 100%; }
.cfg-row.changed .key::after { content: " ✏️"; }
.btns { display: flex; gap: 6px; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); padding: 8px 14px; min-height: 40px; }
button.primary { background: var(--gold); color: #1a1406; border-color: var(--gold); font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
button.ghost:hover, button:not(.primary):hover:not(:disabled) { border-color: var(--gold-dim); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--gold-dim);
  padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cfg-row { grid-template-columns: 1fr; }
  .brand h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
