:root {
  color-scheme: dark;
  --bg: #070707;
  --card: #121212;
  --raised: #1d1d1d;
  --border: #292929;
  --text: #f5f5f2;
  --muted: #a0a09a;
  --faint: #6e6e68;
  --lime: #c6f24e;
  --lime-dark: #75961e;
  --lime-muted: rgba(198, 242, 78, 0.12);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input { font: inherit; }
[hidden] { display: none !important; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 86px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(24px, 4vw, 64px);
  background: rgba(7, 7, 7, 0.94);
  border-bottom: 1px solid #202020;
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; color: var(--text); font-family: var(--mono); font-size: 25px; font-weight: 800; text-decoration: none; letter-spacing: -1px; }
.brand strong { color: var(--lime); }
.brand-mark { position: relative; display: inline-block; width: 36px; height: 36px; border-radius: 10px; background: var(--lime); }
.brand-mark i { position: absolute; left: 9px; height: 3px; border-radius: 2px; background: #0a0a0a; }
.brand-mark i:nth-child(1) { top: 10px; width: 13px; }
.brand-mark i:nth-child(2) { top: 16px; width: 17px; }
.brand-mark i:nth-child(3) { top: 22px; width: 10px; }
.brand-mark b { position: absolute; left: 21px; top: 20px; width: 8px; height: 8px; border: 2px solid #0a0a0a; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--lime); background: #0a0a0a; }
.nav-links { display: flex; gap: clamp(22px, 4vw, 54px); }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 650; text-decoration: none; transition: color 160ms ease; }
.nav-links a:hover { color: var(--text); }
.run-audit { justify-self: end; display: inline-flex; gap: 10px; align-items: center; padding: 13px 24px; border-radius: 999px; background: var(--lime); color: #101207; font-size: 14px; font-weight: 800; text-decoration: none; }

main { width: min(1450px, 100%); margin: 0 auto; padding: 0 clamp(24px, 4vw, 64px) 64px; }
.login-view { min-height: calc(100vh - 86px); display: grid; place-items: center; padding: 48px 0; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 24px; background: var(--card); box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35); }
.eyebrow, .section-label { color: var(--faint); font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.login-card h1 { margin: 10px 0 8px; font-family: var(--mono); font-size: 34px; letter-spacing: -1.5px; }
.login-card p { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; padding: 13px 15px; border: 1px solid #353535; border-radius: 10px; outline: none; background: #090909; color: var(--text); }
.login-card input:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px var(--lime-muted); }
.login-card button { width: 100%; margin-top: 14px; padding: 13px 18px; border: 0; border-radius: 999px; background: var(--lime); color: #101207; font-weight: 850; cursor: pointer; }
.error { margin: 12px 0 0 !important; color: #ff7979 !important; font-size: 13px !important; }

.dashboard { padding-top: 54px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.page-header h1 { margin: 8px 0 0; font-family: var(--mono); font-size: clamp(42px, 5vw, 68px); letter-spacing: -4px; }
.header-meta { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; color: var(--faint); font-size: 12px; }
.live-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); }
.tabs { display: flex; gap: 9px; margin: 42px 0 24px; }
.tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.tab.active { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(198, 242, 78, 0.1); color: var(--lime); }
.dashboard-error { margin-bottom: 18px !important; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 380px; color: var(--muted); }
.spinner { width: 17px; height: 17px; border: 2px solid #333; border-top-color: var(--lime); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.analytics-hero { display: grid; grid-template-columns: minmax(330px, 0.82fr) minmax(420px, 1.18fr); gap: clamp(30px, 5vw, 76px); align-items: center; min-height: 530px; padding: clamp(28px, 4vw, 54px); border: 1px solid var(--border); border-radius: 28px; background: var(--card); }
.globe-wrap { display: grid; place-items: center; }
#globe { display: block; width: min(100%, 470px); aspect-ratio: 1; }
.big-number { font-family: var(--mono); font-size: clamp(62px, 8vw, 105px); font-weight: 800; line-height: 0.9; letter-spacing: -7px; }
.big-label { margin-top: 14px; color: var(--muted); font-size: 16px; font-weight: 750; }
.summary { margin: 17px 0 24px; color: var(--faint); font-size: 14px; }
.feed { display: flex; flex-direction: column; gap: 10px; min-height: 150px; margin-bottom: 24px; }
.feed-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 14px; }
.feed-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); }
.feed-row code { padding: 2px 8px; border-radius: 8px; background: var(--raised); color: var(--text); font-family: var(--mono); font-size: 12px; }
.feed-time { color: var(--faint); font-size: 12px; }
.empty { color: var(--faint); font-size: 13px; }
.countries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.country-chip { padding: 8px 12px; border: 1px solid #303030; border-radius: 12px; background: var(--raised); color: #d9d9d4; font-size: 13px; font-weight: 700; }

.analytics-panel { margin-top: 22px; padding: clamp(28px, 4vw, 48px); border: 1px solid var(--border); border-radius: 28px; background: var(--card); }
.analytics-panel h2 { margin: 0 0 26px; }
.top-pages { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 220px) 1fr 52px; gap: 16px; align-items: center; }
.bar-label { overflow: hidden; color: var(--muted); font-family: var(--mono); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 24px; overflow: hidden; border-radius: 8px; background: var(--raised); }
.bar-fill { min-width: 3px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(96, 125, 29, 0.5), var(--lime)); transform-origin: left; animation: grow 520ms ease-out both; }
@keyframes grow { from { transform: scaleX(0); } }
.bar-count { color: var(--text); font-family: var(--mono); font-size: 13px; font-weight: 800; text-align: right; }

@media (max-width: 820px) {
  .site-nav { height: auto; min-height: 74px; grid-template-columns: 1fr auto; padding-block: 14px; }
  .nav-links { display: none; }
  .analytics-hero { grid-template-columns: 1fr; text-align: center; }
  #globe { width: min(82vw, 390px); }
  .feed-row, .countries { justify-content: center; }
}
@media (max-width: 560px) {
  .site-nav { padding-inline: 18px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 32px; height: 32px; transform: scale(0.89); }
  .run-audit { padding: 10px 15px; font-size: 12px; }
  main { padding-inline: 16px; }
  .dashboard { padding-top: 36px; }
  .header-meta { display: none; }
  .analytics-hero, .analytics-panel { padding: 22px 16px; border-radius: 20px; }
  .bar-row { grid-template-columns: 86px 1fr 38px; gap: 9px; }
  .bar-label, .bar-count { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
