:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111622;
  --panel-2: #171d2b;
  --line: #283044;
  --text: #f5f7fb;
  --muted: #8f99ae;
  --green: #5ee6a8;
  --purple: #a78bfa;
  --amber: #f6b94a;
  --red: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: radial-gradient(circle at 85% -10%, #23203c 0, transparent 32rem), var(--bg); color: var(--text); }
button, select { font: inherit; }
.site-header { height: 72px; padding: 0 max(22px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1b2130; }
.site-header p { color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand b { color: var(--green); }
.brand-mark { display: flex; align-items: end; gap: 3px; height: 22px; }
.brand-mark i { width: 4px; border-radius: 4px; background: var(--green); }
.brand-mark i:nth-child(1) { height: 10px; } .brand-mark i:nth-child(2) { height: 22px; } .brand-mark i:nth-child(3) { height: 15px; }
main { max-width: 1240px; margin: 0 auto; padding: 30px 22px 60px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics article, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(24,30,45,.96), rgba(13,17,27,.98)); border-radius: 14px; }
.metrics article { min-height: 116px; padding: 20px; display: flex; flex-direction: column; }
.metrics span, .eyebrow { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.metrics strong { margin-top: 12px; font-size: 28px; line-height: 1; }
.metrics small { margin-top: 8px; color: var(--muted); }
.panel { padding: 22px; margin-bottom: 18px; }
.controls { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.controls > div:first-child { min-width: min(430px, 100%); }
.eyebrow { margin: 0 0 8px; }
select { width: 100%; color: var(--text); background: #0b0f18; border: 1px solid #333d55; border-radius: 9px; padding: 11px 38px 11px 12px; }
.legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 15px; color: var(--muted); font-size: 12px; }
.legend span, .placement span { display: flex; align-items: center; gap: 7px; }
.legend i, .placement i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
i.visible { background: var(--green); box-shadow: 0 0 0 3px rgb(94 230 168 / .12); }
i.below { background: var(--amber); }
i.missing { background: #5f687b; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { margin-bottom: 0; font-size: 21px; }
.note { color: var(--muted); font-size: 13px; text-align: right; }
.country-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.country-card { min-width: 0; background: #0c111b; border: 1px solid #252d40; border-radius: 12px; padding: 15px; }
.country-card header { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.flag { font-size: 25px; }
.country-card h3 { margin: 0 0 2px; font-size: 15px; }
.country-card header p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.placements { display: grid; gap: 7px; }
.device-separator { display: flex; align-items: center; gap: 9px; margin: 6px 0 1px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.device-separator::before, .device-separator::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.placement { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; width: 100%; padding: 10px; color: var(--text); text-align: left; background: var(--panel-2); border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.placement:hover, .placement:focus-visible { border-color: #4d5b79; outline: none; }
.placement span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #cbd3e3; font-size: 12px; }
.device-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.placement strong { font-size: 13px; white-space: nowrap; }
.placement small { grid-column: 1 / -1; padding-left: 15px; color: var(--muted); font-size: 10px; }
.move { margin-left: 4px; font-size: 10px; } .move.up { color: var(--green); } .move.down { color: var(--red); } .move.flat { color: var(--muted); }
.empty-country, .loading { color: var(--muted); font-size: 13px; margin: 0; padding: 14px 4px; }
.country-grid > .loading { grid-column: 1 / -1; text-align: center; padding: 50px; }
.history-actions { display: grid; grid-template-columns: 230px 240px; gap: 8px; }
.history-chart { min-height: 280px; display: grid; place-items: center; overflow: hidden; }
.history-chart svg { width: 100%; height: 280px; overflow: visible; }
.grid line { stroke: #293247; stroke-width: 1; } .grid text, .axis-labels text { fill: var(--muted); font-size: 11px; }
.rank-line { fill: none; stroke: var(--purple); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rank-points circle { fill: var(--purple); stroke: #0c111b; stroke-width: 3; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 10px 2px; color: var(--muted); font-size: 12px; }
footer a { color: var(--green); text-decoration: none; }
@media (max-width: 760px) {
  .site-header p { display: none; }
  main { padding: 20px 14px 45px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article { min-width: 0; }
  .controls, .panel-heading { flex-direction: column; align-items: stretch; }
  .controls > div:first-child { width: 100%; min-width: 0; }
  .legend { justify-content: start; }
  .note { text-align: left; }
  .country-grid { grid-template-columns: 1fr; }
  .history-actions { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .site-header { padding: 0 15px; }
  .metrics { gap: 9px; }
  .metrics article { min-height: 100px; padding: 15px; }
  .metrics strong { font-size: 20px; overflow-wrap: anywhere; }
  .panel { padding: 16px; }
  footer { flex-direction: column; }
}
