:root {
  color-scheme: dark;
  --bg: #151513; --surface: #1f1f1c; --text: #ecebe6; --muted: #98968c; --line: #333330;
  --c-bike: #ff8a47; --c-walk: #4fc4a0; --c-run: #6f9bf0; --c-snow: #a893ee;
  --heat0: #2a2a26; --heat1: #5b3524; --heat2: #8f4a28; --heat3: #cf5f27; --heat4: #ff8a47;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.site .in { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; overflow-x: auto; }
.brand { font-weight: 700; padding: 14px 0; white-space: nowrap; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 4px; }
nav a { text-decoration: none; color: var(--muted); padding: 14px 10px; border-bottom: 2px solid transparent; white-space: nowrap; }
nav a:hover { color: var(--text); }
nav a.on { color: var(--text); border-bottom-color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 28px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 32px 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.grid { display: grid; gap: 12px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card .lbl { color: var(--muted); font-size: 13px; }
.card .val { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .val small { font-size: 14px; font-weight: 500; color: var(--muted); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs button, .btn { font: inherit; font-size: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; cursor: pointer; user-select: none; }
th.num, td.num { text-align: right; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.filters input, .filters select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 130px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.rec { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rec:last-child { border: 0; }
.rec b { font-variant-numeric: tabular-nums; }
.rec .d { color: var(--muted); }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 4px 8px; border-radius: 6px; display: none; z-index: 20; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 9px 18px; font-weight: 600; }
.btn:disabled { opacity: .4; cursor: default; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tile { position: relative; margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line); }
.tile svg { width: 100%; height: 100%; display: block; }
.tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.tile .play { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; font-size: 14px; padding-left: 3px; }
.tile .dur { position: absolute; right: 8px; top: 8px; font-size: 11px; background: rgba(0,0,0,.65); padding: 1px 6px; border-radius: 4px; }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h3 { margin: 0 0 14px; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 32px 12px; text-align: center; color: var(--muted); }

main.narrow { max-width: 420px; padding-top: 48px; }
.login h1 { font-size: 24px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login input { font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.login input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.login .err { min-height: 20px; color: #ff6b6b; font-size: 14px; }
.login .btn.primary { width: 100%; }
.login .small { font-size: 13px; margin: 16px 0 0; text-align: center; }
nav a.login-link { margin-left: auto; }
nav { flex: 1; }

.tile .big { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: 56px; height: 56px; color: rgba(255,255,255,.8); }
.tile .big svg, .tile .badge svg { width: 100%; height: 100%; display: block; }
.tile .badge { position: absolute; left: 8px; top: 8px; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; }

.btn.sm { padding: 6px 14px; font-size: 13px; white-space: nowrap; margin-left: 8px; }
a.btn { display: inline-block; text-decoration: none; }
.dlg-actions { display: flex; gap: 8px; }
