:root {
  color-scheme: dark;
  --bg: #0a0910; --ink: #f5f1ea; --muted: #9b95ad; --line: rgba(255,255,255,.09);
  --card: rgba(255,255,255,.045); --card-hi: rgba(255,255,255,.075);
  --accent: #ff8a2b; --accent2: #ffc065; --accent-soft: rgba(255,138,43,.15);
  --good: #3ddc97; --bad: #ff6b7a;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; min-height: 100vh; overflow-x: hidden; }

/* ===== animated background ===== */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% -10%, #1b1226 0%, var(--bg) 60%); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.o1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -16vmax; background: #ff7a18; animation: drift1 26s ease-in-out infinite alternate; opacity: .32; }
.o2 { width: 44vmax; height: 44vmax; right: -12vmax; top: 18vh; background: #7c3aed; animation: drift2 32s ease-in-out infinite alternate; opacity: .26; }
.o3 { width: 38vmax; height: 38vmax; left: 25vw; bottom: -20vmax; background: #0ea5a4; animation: drift3 29s ease-in-out infinite alternate; opacity: .2; }
.gridlines { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; opacity: .35; mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); animation: gridmove 40s linear infinite; }
@keyframes drift1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, 10vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-20vmax, -12vmax) scale(1.2); } }
@keyframes gridmove { to { background-position: 56px 56px, 56px 56px; } }

/* ===== header ===== */
.top { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding: 26px 24px 10px; max-width: 1320px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 16px; }
.logo { position: relative; width: 68px; height: 68px; border-radius: 50%; padding: 3px; background: conic-gradient(from 0deg, #ff8a2b, #ffd27a, #7c3aed, #0ea5a4, #ff8a2b); animation: spin 8s linear infinite; box-shadow: 0 0 34px rgba(255,138,43,.45); flex: none; }
.logo img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; animation: spin 8s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.1; }
h1 span { background: linear-gradient(90deg, #ff8a2b, #ffd27a, #ff8a2b); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 5s linear infinite; font-weight: 700; }
@keyframes shimmer { to { background-position: 200% 0; } }
h2 { margin: 0; font-size: 17px; }
h3 { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.sub, .muted { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.status { display: flex; gap: 10px; align-items: center; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 12.5px; backdrop-filter: blur(8px); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.ok i { background: var(--good); animation: pulse 1.8s ease-out infinite; }
.live.warn i { background: var(--accent2); }
.live.sync i { background: var(--accent); animation: pulse 1s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live.ok { color: var(--good); } .live.sync { color: var(--accent); } .live.warn { color: var(--accent2); }
.live b { font-weight: 500; color: var(--ink); }

/* ===== nav ===== */
.nav { position: sticky; top: 0; z-index: 8; display: flex; flex-wrap: wrap; gap: 8px; max-width: 1320px; margin: 0 auto; padding: 10px 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: linear-gradient(180deg, rgba(10,9,16,.8), rgba(10,9,16,.35)); }
.nav a { color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--card); padding: 5px 13px; border-radius: 999px; font-size: 13px; transition: all .25s var(--ease); }
.nav a:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-2px); }
.nav a.on { color: #1a1008; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-color: transparent; font-weight: 600; box-shadow: 0 4px 18px rgba(255,138,43,.35); }

main { max-width: 1320px; margin: 0 auto; padding: 14px 24px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
main > * { min-width: 0; }
.section-title { margin: 10px 0 -6px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.section-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 10px; }
.section-row .section-title { margin: 0; }

/* ===== controls ===== */
.btn, .seg button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 6px 12px; border-radius: 9px; cursor: pointer; transition: all .2s var(--ease); }
.btn:hover, .seg button:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn:active, .seg button:active { transform: scale(.96); }
.btn .ri { display: inline-block; }
.btn.spin .ri { display: inline-block; animation: spin .8s linear infinite; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.seg button:last-child { border-radius: 0 9px 9px 0; }
.seg button.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); border-color: transparent; color: #1a1008; font-weight: 600; position: relative; }
input, select { font: inherit; color: var(--ink); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; color-scheme: dark; transition: border-color .2s, background .2s; }
input:hover, select:hover { border-color: rgba(255,138,43,.6); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select { -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ff8a2b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
select option { background: #1a1625; color: var(--ink); }
label { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; backdrop-filter: blur(10px); animation: rise .7s var(--ease) both; }
.filters strong { font-size: 13px; }

/* ===== panels ===== */
.panel { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255,138,43,.12), transparent 60%); }
.panel:hover::before { opacity: 1; }
.panel > * { position: relative; }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sub-head { margin-top: 26px; }
.sub-head.tight { margin: 4px 0 10px; }
.rv { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent2); margin-left: 8px; font-weight: 500; vertical-align: 2px; }
.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.peak { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.peak b { color: var(--good); }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.foot { color: var(--muted); font-size: 12px; margin: 0; }

/* ===== KPIs ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 10px; backdrop-filter: blur(10px); animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); box-shadow: 0 0 14px var(--c); }
.kpi:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 10px 30px color-mix(in srgb, var(--c) 28%, transparent); }
.kpi .l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi svg { width: 100%; height: 30px; display: block; margin-top: 6px; overflow: visible; }
.kpi svg path { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s .3s var(--ease) forwards; filter: drop-shadow(0 0 4px var(--c)); }

/* ===== chips ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 6px; transition: all .2s var(--ease); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .35; transition: opacity .2s; }
.chip:hover { transform: translateY(-2px); color: var(--ink); }
.chip.on { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.chip.on i { opacity: 1; box-shadow: 0 0 8px var(--c); }

/* ===== charts ===== */
.grid-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.chart-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; background: rgba(0,0,0,.18); animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); transition: border-color .3s, transform .3s var(--ease); }
.chart-card:hover { border-color: rgba(255,138,43,.45); transform: translateY(-2px); }
.chart-card .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-card .t b { font-size: 14px; }
.chart-card .t span { color: var(--muted); font-size: 12px; }
svg { overflow: visible; }
.chart-card svg, #weeklyChart svg, #dowChart svg, #ageChart svg { width: 100%; display: block; margin-top: 6px; }
svg text { fill: var(--muted); font-size: 11px; }
svg .vl { fill: var(--ink); font-size: 11px; font-weight: 600; }
svg .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
svg .hit { fill: transparent; cursor: crosshair; }
svg .hit:hover { fill: rgba(255,255,255,.07); }
.ln { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) forwards; filter: drop-shadow(0 0 6px var(--c)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ar { opacity: 0; animation: fade 1s .6s ease forwards; }
@keyframes fade { to { opacity: 1; } }
.pt { fill: var(--bg); stroke: var(--c); stroke-width: 2; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop .45s var(--ease) forwards; animation-delay: calc(.9s + var(--i) * 40ms); }
.pt:hover { fill: var(--c); }
@keyframes pop { to { transform: scale(1); } }
.bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: growY .8s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms); }
.bar:hover { filter: brightness(1.25); }
.bar.best { filter: drop-shadow(0 0 8px var(--c, #3ddc97)); }
@keyframes growY { to { transform: scaleY(1); } }

/* horizontal bars */
.hbars { display: grid; gap: 9px; }
.hrow { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) 100px; gap: 14px; align-items: center; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.hrow .lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .lb small { color: var(--muted); display: block; font-size: 11.5px; }
.htrack { background: rgba(255,255,255,.06); border-radius: 7px; height: 24px; overflow: hidden; }
.hfill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); min-width: 3px; transform-origin: left; animation: growX 1s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 100ms); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 50%, transparent); position: relative; overflow: hidden; }
.hfill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.5s 1.2s ease-in-out infinite; }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.hrow .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===== video cards ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vcard { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(0,0,0,.2); animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 90ms); transition: transform .35s var(--ease), border-color .3s, box-shadow .3s; }
.vcard:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 16px 40px rgba(255,138,43,.2); }
.ratio { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.ratio iframe, .ratio img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; transition: transform .6s var(--ease); }
.vcard:hover .ratio img { transform: scale(1.06); }
.play { position: absolute; inset: 0; margin: auto; width: 58px; height: 42px; border-radius: 13px; background: rgba(230,30,30,.94); display: grid; place-items: center; pointer-events: none; box-shadow: 0 0 0 0 rgba(230,30,30,.6); animation: ring 2.4s ease-out infinite; }
.play::after { content: ""; border-left: 14px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
@keyframes ring { 70% { box-shadow: 0 0 0 16px rgba(230,30,30,0); } 100% { box-shadow: 0 0 0 0 rgba(230,30,30,0); } }
.ratio[data-play] { cursor: pointer; }
.vmeta { padding: 12px 14px 14px; }
.vmeta .vt { font-weight: 600; margin-bottom: 2px; }
.vmeta .id { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 10px; }
.vmeta .id a { color: var(--accent2); text-decoration: none; }
.vstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.vstats div span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.vstats div b { font-size: 14px; font-variant-numeric: tabular-nums; }
.thumb-link { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit; text-align: left; }
.thumb-link img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; }
.thumb-link:hover { color: var(--accent2); }
.thumb-link small { display: block; color: var(--muted); font-size: 11.5px; }
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(5,4,10,.82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .25s both; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(900px, 100%); animation: rise .4s var(--ease) both; }
.modal-box .ratio { border-radius: 14px; box-shadow: 0 0 60px rgba(255,138,43,.25); }
.modal-x { position: absolute; right: 0; top: -40px; background: none; border: 0; color: #fff; font-size: 32px; cursor: pointer; line-height: 1; transition: transform .25s var(--ease); }
.modal-x:hover { transform: rotate(90deg); color: var(--accent); }

/* ===== tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th.l, td.l { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; user-select: none; position: sticky; top: 0; background: #14111d; z-index: 1; transition: color .2s; }
th:hover { color: var(--ink); }
th.sorted { color: var(--accent); }
th .arr { display: inline-block; width: 10px; }
tbody tr { animation: rowin .5s var(--ease) both; animation-delay: calc(var(--i) * 28ms); transition: background .2s; }
@keyframes rowin { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
tbody tr:hover { background: var(--accent-soft); }
tfoot td { font-weight: 700; border-bottom: 0; background: rgba(255,255,255,.05); border-top: 2px solid var(--line); }
td a { color: var(--accent2); text-decoration: none; }
td a:hover { text-decoration: underline; }
.scroll-y { max-height: 520px; overflow: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 8px; box-shadow: 0 0 8px var(--c); }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.up { color: var(--good); } .down { color: var(--bad); }

/* ===== tooltip ===== */
.tip { position: fixed; z-index: 30; pointer-events: none; background: rgba(20,17,29,.96); border: 1px solid rgba(255,138,43,.5); color: var(--ink); padding: 7px 11px; border-radius: 10px; font-size: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.5); white-space: nowrap; line-height: 1.5; }
.tip b { color: var(--accent2); }

/* ===== geography ===== */
.countries { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ccard { text-align: left; font: inherit; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; background: rgba(0,0,0,.2); position: relative; overflow: hidden; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 80ms); transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.ccard:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 12px 30px color-mix(in srgb, var(--c) 28%, transparent); }
.ccard.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.ccard .cn { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.ccard .cn em { font-style: normal; font-size: 22px; }
.ccard .cs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; margin: 10px 0 8px; font-size: 12px; color: var(--muted); }
.ccard .cs b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ccard .sh { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.ccard .sh i { display: block; height: 100%; background: var(--c); border-radius: 3px; transform-origin: left; animation: growX 1.1s .2s var(--ease) both; box-shadow: 0 0 10px var(--c); }
.geo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 14px; }
.tm { position: relative; height: 380px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.25); }
.tm div { position: absolute; padding: 6px 8px; border-radius: 6px; border: 2px solid #0e0c15; background: color-mix(in srgb, var(--c) 68%, #0e0c15); color: #fff; overflow: hidden; font-size: 11.5px; line-height: 1.25; cursor: default; animation: tmin .8s var(--ease) both; animation-delay: calc(var(--i) * 18ms); transition: filter .2s, transform .2s; }
.tm div:hover { filter: brightness(1.3); z-index: 2; transform: scale(1.02); }
.tm div b { display: block; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.tm div span { opacity: .85; }
@keyframes tmin { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* ===== demographics ===== */
.demo-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.dlegend { display: inline-flex; gap: 12px; }
.dlegend i, .dleg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: var(--c); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 8px 0; }
.donut { width: 190px; height: 190px; flex: none; }
.donut circle { fill: none; stroke-width: 15; transform: rotate(-90deg); transform-origin: 50% 50%; animation: dash 1.3s var(--ease) both; }
.donut circle.bgc { stroke: rgba(255,255,255,.06); animation: none; }
@keyframes dash { from { stroke-dasharray: 0 100; } }
.donut text { text-anchor: middle; }
.donut .big { fill: var(--ink); font-size: 5.2px; font-weight: 700; }
.donut .small { font-size: 2.8px; fill: var(--muted); text-transform: uppercase; letter-spacing: .15px; }
.glist { display: grid; gap: 10px; min-width: 150px; }
.glist div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 300ms); }
.glist i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.glist small { color: var(--muted); display: block; }
.glist b { font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 96px repeat(3, minmax(0, 1fr)); gap: 5px; font-size: 13px; }
.heat > div { padding: 11px 8px; border-radius: 9px; text-align: center; font-variant-numeric: tabular-nums; animation: tmin .6s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.heat .heat-h { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; background: none; }
.heat .heat-r { text-align: left; font-weight: 600; background: none; }
.heat .cell { background: color-mix(in srgb, var(--accent) calc(var(--t) * 100%), rgba(255,255,255,.05)); color: #fff; transition: transform .2s var(--ease), filter .2s; cursor: default; }
.heat .cell.dark { color: #1a1008; font-weight: 600; }
.heat .cell:hover { transform: scale(1.06); filter: brightness(1.15); z-index: 1; }
.heat .cell.low { background: repeating-linear-gradient(45deg, rgba(255,255,255,.03), rgba(255,255,255,.03) 6px, transparent 6px, transparent 12px); color: var(--muted); }
.heat .cell.best { outline: 2px solid var(--good); outline-offset: -2px; box-shadow: 0 0 18px rgba(61,220,151,.4); }

@media (max-width: 1000px) { .geo, .demo-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .top, main, .nav { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 22px; }
  .logo { width: 54px; height: 54px; }
  .grid-charts { grid-template-columns: 1fr; }
  .hrow { grid-template-columns: 1fr 84px; }
  .hrow .htrack { grid-column: 1 / -1; order: 3; }
  .heat { font-size: 12px; grid-template-columns: 70px repeat(3, minmax(0, 1fr)); } .heat > div { padding: 8px 4px; }
  .panel { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rv { opacity: 1; transform: none; }
}

/* keep sparse bar charts (e.g. a single week) from ballooning */
#weeklyChart svg, #dowChart svg, #ageChart svg { max-height: 300px; }
