:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #10161d;
  --panel-2: #141c24;
  --line: #26313b;
  --ink: #eef3f6;
  --muted: #8f9ca8;
  --green: #45dc91;
  --blue: #62b9e8;
  --amber: #edb85c;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, p { margin-top: 0; }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { color: #82edb8; }

.dashboard { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 92px 0 90px; }

.masthead { display: flex; justify-content: space-between; gap: 70px; align-items: end; padding: 34px 0 46px; border-bottom: 1px solid var(--line); }
.product { margin-bottom: 25px; color: var(--green); font-size: .8rem; font-weight: 750; text-transform: uppercase; }
.product span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); }
h1 { margin-bottom: 12px; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; letter-spacing: 0; }
.intro { max-width: 670px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.status { display: flex; min-width: 230px; gap: 12px; align-items: center; padding: 14px 0; border-block: 1px solid var(--line); }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(69,220,145,.1); }
.status strong, .status small { display: block; }
.status small { margin-top: 2px; color: var(--muted); }

.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 76px; border: 1px solid var(--line); background: var(--panel); }
.kpi-strip article { min-width: 0; padding: 24px 26px; border-right: 1px solid var(--line); }
.kpi-strip article:last-child { border-right: 0; }
.kpi-strip span, .section-label { color: var(--green); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.kpi-strip strong { display: block; margin: 14px 0 9px; font-size: clamp(2.25rem, 4vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-strip small { color: var(--muted); }

.trend-section, .data-section, .locale-section { margin-bottom: 82px; }
.section-title { display: flex; justify-content: space-between; gap: 36px; align-items: end; margin-bottom: 24px; }
.section-title span { color: var(--green); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.section-title h2 { margin: 6px 0 0; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: 0; }
.section-title p { max-width: 430px; margin-bottom: 3px; color: var(--muted); }
.trend-chart { height: 330px; padding: 24px 26px 14px; border: 1px solid var(--line); background: var(--panel); }
.trend-chart canvas { width: 100% !important; height: 100% !important; }

.table-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.data-table { border: 1px solid var(--line); background: var(--panel); }
.data-table header { display: flex; justify-content: space-between; align-items: baseline; padding: 20px; border-bottom: 1px solid var(--line); }
.data-table h3 { margin: 0; font-size: 1rem; }
.row-total { color: var(--muted); font-size: .78rem; }
.data-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 46px 48px; gap: 10px; align-items: center; min-height: 45px; padding: 8px 14px; border-bottom: 1px solid rgba(38,49,59,.72); overflow: hidden; }
.data-row:last-child { border-bottom: 0; }
.data-bar { position: absolute; inset: 0 auto 0 0; z-index: 0; background: rgba(69,220,145,.075); border-right: 1px solid rgba(69,220,145,.22); }
.data-row > span:not(.data-bar) { position: relative; z-index: 1; }
.data-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.data-count, .data-share { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.data-share { font-size: .78rem; }

.locale-table { border: 1px solid var(--line); background: var(--panel); }
.locale-head, .locale-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(220px, 3fr) 110px; gap: 24px; align-items: center; padding: 13px 20px; }
.locale-head { color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.locale-head span:last-child { text-align: right; }
.locale-row { min-height: 51px; border-bottom: 1px solid rgba(38,49,59,.72); }
.locale-row:last-child { border-bottom: 0; }
.locale-code { font-weight: 700; }
.locale-track { height: 7px; background: #26313b; }
.locale-fill { display: block; height: 100%; background: var(--blue); }
.locale-value { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.privacy-section { padding: 46px; border: 1px solid #225c43; background: #0e1c17; }
.privacy-section h2 { max-width: 760px; margin: 8px 0 32px; font-size: clamp(1.7rem, 3vw, 2.55rem); letter-spacing: 0; }
.privacy-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 28px; }
.privacy-columns strong { display: block; margin-bottom: 8px; }
.privacy-columns p { margin: 0; color: #a7b9af; }
.privacy-section > a { font-weight: 700; }
.error { padding: 16px; border: 1px solid #8d4141; background: #341a1a; color: #ffd3d3; }

@media (max-width: 980px) {
  .table-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip article:nth-child(2) { border-right: 0; }
  .kpi-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .privacy-columns { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .dashboard { width: calc(100% - 28px); padding-top: 76px; }
  .masthead { display: block; padding-top: 24px; }
  .status { width: 100%; margin-top: 32px; }
  .kpi-strip { grid-template-columns: 1fr; margin-bottom: 58px; }
  .kpi-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-strip article:last-child { border-bottom: 0; }
  .section-title { display: block; }
  .section-title p { margin-top: 12px; }
  .trend-section, .data-section, .locale-section { margin-bottom: 62px; }
  .trend-chart { height: 290px; padding-inline: 12px; }
  .locale-head { display: none; }
  .locale-row { grid-template-columns: 76px minmax(110px, 1fr) 42px; gap: 12px; padding-inline: 14px; }
  .privacy-section { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
