:root {
  --bg: #131f28;
  --panel: #1c2b39;
  --panel-soft: #223446;
  --text: #f4f8fb;
  --muted: #94a5b3;
  --faint: #2b4052;
  --teal: #006c6e;
  --teal-bright: #13a4a6;
  --orange: #ff9d00;
  --line: #23a9a8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.topbar,
.site-row,
.metrics,
.report-head,
.chart-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--bg);
  background: var(--orange);
  border-radius: 8px;
  font-weight: 900;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.nav {
  display: flex;
  gap: 34px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.site-row {
  gap: 12px;
  margin-bottom: 20px;
}

.site-name {
  font-size: 18px;
  font-weight: 800;
}

.live-dot {
  width: 9px;
  height: 9px;
  background: #00d47e;
  border-radius: 50%;
}

.live-count {
  color: #c3d1db;
  font-weight: 700;
}

.spacer {
  flex: 1;
}

.ghost-button,
.icon-button,
.date-button {
  min-height: 40px;
  color: #dce6ed;
  background: #182838;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.date-button {
  min-width: 142px;
  text-align: left;
}

.primary-button {
  min-height: 44px;
  color: var(--bg);
  background: var(--orange);
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.wide {
  width: 100%;
}

.panel {
  background: var(--panel);
  border-radius: 4px;
}

.hero-panel {
  padding: 18px 22px 26px;
}

.metrics {
  gap: 0;
  margin-bottom: 22px;
}

.metrics article {
  flex: 1;
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid rgba(148, 165, 179, 0.45);
}

.metrics article:first-child {
  border-left: 0;
  padding-left: 0;
}

.metrics span,
.eyebrow,
.report-head a,
.chart-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1;
}

.metrics em {
  margin-left: 8px;
  color: #28d796;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.chart-head {
  justify-content: space-between;
  margin-bottom: 8px;
  text-transform: none;
}

.chart {
  height: 335px;
}

.chart svg {
  width: 100%;
  height: 100%;
}

.grid line {
  stroke: rgba(148, 165, 179, 0.12);
  stroke-width: 1;
}

.line {
  fill: none;
  stroke: var(--line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.line.muted {
  stroke: var(--orange);
  stroke-dasharray: 4 8;
}

.ai-panel {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 30px;
  margin-top: 24px;
  padding: 28px;
}

.auth-shell {
  min-height: 100vh;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 52px;
  align-items: start;
}

.auth-copy h1,
.empty-dashboard h1 {
  margin: 0;
  max-width: 720px;
  font-size: 52px;
  line-height: 1.08;
}

.auth-copy p:not(.eyebrow) {
  max-width: 640px;
  color: #c4d2dc;
  font-size: 21px;
  line-height: 1.45;
}

.auth-panel,
.setup-panel,
.snippet-panel,
.empty-dashboard {
  padding: 28px;
}

.form {
  display: grid;
  gap: 16px;
}

.form h2 {
  margin: 0;
  font-size: 24px;
}

.secondary-form {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid rgba(148, 165, 179, 0.22);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  color: var(--text);
  background: #132334;
  border: 1px solid rgba(148, 165, 179, 0.18);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(255, 157, 0, 0.44);
  outline-offset: 2px;
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  color: #dff8ec;
  background: rgba(0, 108, 110, 0.35);
  border-radius: 4px;
  font-weight: 800;
}

.notice.error {
  color: #ffe5e5;
  background: rgba(174, 52, 52, 0.34);
}

.notice.success {
  color: #e5fff2;
}

.setup-panel {
  margin-bottom: 28px;
}

.site-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.site-select {
  min-width: 250px;
  font-weight: 900;
}

.empty-dashboard {
  margin-top: 26px;
}

.snippet-panel {
  margin-top: 24px;
}

.snippet-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.snippet-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

pre {
  margin: 0;
  overflow-x: auto;
  color: #e7f1f6;
  background: #132334;
  border-radius: 4px;
  padding: 16px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.empty-state {
  color: var(--muted);
  font-size: 16px;
}

.tracker-test-result {
  min-height: 24px;
  margin-top: 14px;
  font-weight: 800;
}

.success-text {
  color: #28d796 !important;
}

.error-text {
  color: #ffb3b3 !important;
}

.admin-row {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  background: #132334;
  border-radius: 4px;
}

.admin-row span {
  color: var(--text);
  font-weight: 900;
}

.admin-row small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
}

.ai-panel h1 {
  max-width: 520px;
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.insight-grid article {
  background: rgba(19, 31, 40, 0.62);
  border-radius: 4px;
  padding: 18px;
}

.insight-grid span {
  color: var(--teal-bright);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.insight-grid p {
  margin: 10px 0 0;
  color: #d5e1e8;
  font-size: 15px;
  line-height: 1.45;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.report {
  min-height: 330px;
  padding: 18px;
}

.report-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.report h2 {
  margin: 0;
  font-size: 18px;
}

.report-head a {
  color: var(--orange);
}

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
  padding: 0 10px;
  overflow: hidden;
  color: #dce6ed;
}

.bar-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: var(--panel-soft);
}

.bar-row span,
.bar-row b {
  position: relative;
  z-index: 1;
  font-size: 15px;
}

.bar-row b {
  font-weight: 800;
}

.map-fake {
  position: relative;
  height: 235px;
  overflow: hidden;
  background: #182838;
  border-radius: 4px;
}

.map-fake::before {
  content: "";
  position: absolute;
  inset: 34px 48px;
  border: 1px solid rgba(148, 165, 179, 0.18);
  border-radius: 50%;
  transform: skew(-18deg);
}

.region {
  position: absolute;
  display: block;
  background: var(--teal);
  opacity: 0.82;
  border-radius: 48% 52% 42% 58%;
}

.region.one {
  left: 16%;
  top: 36%;
  width: 96px;
  height: 52px;
}

.region.two {
  left: 35%;
  top: 32%;
  width: 70px;
  height: 46px;
  background: var(--orange);
  opacity: 0.76;
}

.region.three {
  left: 53%;
  top: 40%;
  width: 120px;
  height: 62px;
}

.region.four {
  left: 73%;
  top: 56%;
  width: 74px;
  height: 38px;
}

.region.five {
  left: 24%;
  top: 62%;
  width: 54px;
  height: 64px;
  opacity: 0.56;
}

@media (max-width: 900px) {
  .topbar {
    margin-bottom: 34px;
  }

  .site-row,
  .metrics,
  .ai-panel,
  .insight-grid,
  .report-grid,
  .auth-grid,
  .site-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .spacer {
    display: none;
  }

  .metrics article {
    border-left: 0;
    border-top: 1px solid rgba(148, 165, 179, 0.25);
    padding: 14px 0;
  }

  .metrics article:first-child {
    border-top: 0;
  }

  .ai-panel h1 {
    font-size: 28px;
  }

  .auth-copy h1,
  .empty-dashboard h1 {
    font-size: 36px;
  }

  .brand {
    font-size: 24px;
  }

  .snippet-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chart {
    height: 260px;
  }
}
