:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --card: #fff;
  --ink: #13223b;
  --muted: #52627a;
  --line: #d8e0eb;
  --accent: #214cc5;
  --notice: #e9efff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.6 system-ui,
    sans-serif;
}
header,
main,
footer {
  max-width: 1200px;
  margin: auto;
  padding: 24px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 24px;
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  font-weight: 400;
}
.badge,
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.07em;
}
.badge {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 30px;
}
.eyebrow {
  font-weight: 700;
  color: var(--accent);
}
h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 12px 0;
}
h2 {
  font-size: 21px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 24px 0 8px;
}
p {
  margin: 12px 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  min-width: 0;
}
.login {
  max-width: 520px;
  margin: 48px auto;
}
label {
  display: block;
  margin: 20px 0 6px;
}
input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
button {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
  font: 600 14px/1.5 system-ui;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
form button {
  width: 100%;
  margin-top: 24px;
}
.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 24px 0;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.notice {
  background: var(--notice);
  padding: 18px;
  border-radius: 10px;
}
.muted,
footer {
  color: var(--muted);
  font-size: 14px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.metric strong {
  display: block;
  font-size: 32px;
}
.metric span {
  font-size: 14px;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.row span {
  min-width: 0;
}
.row strong {
  flex-shrink: 0;
}
#status {
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10182a;
    --card: #18243a;
    --ink: #ecf2ff;
    --muted: #b5c3d9;
    --line: #354660;
    --accent: #9bb8ff;
    --notice: #22345a;
  }
  button {
    color: #10182a;
  }
  .secondary {
    color: var(--ink);
  }
}
@media (max-width: 700px) {
  header,
  main,
  footer {
    padding: 18px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .heading {
    display: block;
  }
  .actions {
    margin-top: 20px;
  }
  .card {
    padding: 20px;
  }
  h1 {
    font-size: 27px;
  }
  .badge {
    font-size: 10px;
  }
  .brand {
    font-size: 19px;
  }
  .login {
    margin: 24px auto;
  }
}

#backup .row {
  flex-direction: column;
  gap: 2px;
}
#backup .row strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

select {
  width: 100%;
  padding: 12px;
  color: inherit;
  background: var(--bg);
  border: 1px solid currentColor;
  border-radius: 8px;
}
.campaign {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

summary {
  cursor: pointer;
  font-size: 21px;
  font-weight: 700;
}
details[open] summary {
  margin-bottom: 16px;
}
.grid {
  align-items: start;
}

.engagement {
  margin: 24px 0;
}
.engagement h2:not(:first-child) {
  margin-top: 36px;
}
.trend-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.trend-controls label {
  min-width: 200px;
}
.trend-controls button[aria-pressed='false'] {
  color: var(--ink);
  background: var(--bg);
}
#trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}
#trend-chart text {
  fill: var(--ink);
  font-size: 12px;
}
.chart-grid {
  stroke: var(--ink);
  opacity: 0.15;
}
.chart-bar {
  fill: #536dfe;
}
.chart-bar.partial {
  opacity: 0.55;
}
.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table-scroll th,
.table-scroll td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #8292b440;
}
.table-scroll td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-scroll th {
  font-weight: 600;
}
.engagement details {
  margin-top: 22px;
}
.engagement details summary {
  font-size: 16px;
}

.chart-unmeasured {
  fill: #8292b4;
  opacity: 0.12;
}
.table-scroll table {
  min-width: 430px;
}
