:root {
  color-scheme: dark;
  --navy: #111111;
  --navy-2: #1c1c1c;
  --accent: #BDF031;
  --accent-ink: #0A0A0A;
  --accent-soft: #24300a;
  --accent-text: #BDF031;
  --ink: #F6F6F3;
  --muted: #E6E6E6;
  --line: #2E2E2E;
  --line-2: #3A3A3A;
  --line-strong: #4A4A4A;
  --bg: #0A0A0A;
  --surface: #111111;
  --card: #161616;
  --card-2: #1C1C1C;
  --track: #2A2A2A;
  --good: #BDF031;
  --bad: #FFB4B4;
  --bad-bg: #2A1616;
  --bad-line: #5C3030;
  --bad-soft: #3A2220;
  --warn: #FFD58A;
  --warn-bg: #2A2416;
  --warn-line: #5C4A22;
  --info: #C8C8C0;
  --google: #8EB4FF;
  --chart-bar: #BDF031;
  --chart-line: #F6F6F3;
  --chart-fill: rgba(246, 246, 243, 0.14);
  --chart-tick: #C8C8C0;
  --skeleton: #1F1F1F;
  --skeleton-shine: #2A2A2A;
  --overlay: rgba(0, 0, 0, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input { font-family: inherit; }
a { color: var(--accent-text); }

.topbar {
  background: var(--surface);
  color: var(--ink);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; text-decoration: none; }
.brand img { height: 32px; width: auto; max-width: min(280px, 70vw); display: block; }
.brand-text { font-weight: 700; letter-spacing: 0.14em; font-size: 13px; }
.titles { min-width: 0; }
.titles h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.titles p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.fresh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.asof { color: var(--muted); font-size: 12.5px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.pill.stale { color: #1A1408; background: #FFD58A; border-color: #FFD58A; }
.pill.ok { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.pill.issues { color: #1A1408; background: #FFD58A; border-color: #FFD58A; }
.pill.idle { color: var(--muted); background: var(--card-2); border-color: var(--line-2); }
.pill.offline { color: #FFFFFF; background: #B42318; border-color: #B42318; }
.pill.live .dot { animation: live-pulse 1.6s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(10, 10, 10, 0.55); }
@keyframes live-pulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(10, 10, 10, 0.55); }
  50% { opacity: 0.35; box-shadow: 0 0 0 4px rgba(10, 10, 10, 0); }
  100% { opacity: 1; box-shadow: 0 0 0 0 rgba(10, 10, 10, 0); }
}
@media (prefers-reduced-motion: reduce) { .pill.live .dot { animation: none; } }
.stale-note.offline { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 118px); }
.pages {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
}
.pages h2 {
  margin: 0 8px 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.pages button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}
.pages button[aria-selected="true"] {
  background: var(--card-2);
  border-left-color: var(--accent-text);
  color: var(--accent-text);
  box-shadow: var(--shadow);
}
.pages button:hover { background: var(--card-2); }
.canvas { padding: 18px 22px 32px; min-width: 0; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.toolbar input[type="date"] {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button, .ghost {
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.presets button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.range-note { color: var(--muted); font-size: 13px; padding-bottom: 8px; }

.banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-line);
}
.banner.fail { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.banner p { margin: 0 0 6px; }
.banner p:last-child { margin: 0; }
.stale-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.cards.secondary { margin-top: 12px; }
.cards.secondary .card { border-top-color: var(--line-2); padding: 10px 14px; }
.cards.secondary .card .v { font-size: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.card .v { margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.card .d { margin-top: 6px; font-size: 13.5px; color: var(--ink); }
.card .d b { font-weight: 700; }
.card .d b.good { color: var(--good); }
.card .d b.bad { color: var(--bad); }
.card .d b.flat, .card .d b.none { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 12px; margin-top: 12px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel h3 { margin: 0; font-size: 16px; color: var(--ink); }
.panel .hint { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.chart { position: relative; height: 280px; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--track); }
.split-bar span { display: block; height: 100%; }
.split-bar .meta { background: var(--accent); }
.split-bar .google { background: var(--google); }
.legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.legend-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.swatch.meta { background: var(--accent); }
.swatch.google { background: var(--google); }
.legend b { font-variant-numeric: tabular-nums; }

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}
.table-wrap thead th:first-child { z-index: 2; background: var(--card-2); }
.table-wrap tbody td:first-child { background: var(--card); }
.table-wrap tbody tr:nth-child(even) td:first-child { background: var(--card-2); }
.table-wrap tfoot td:first-child { background: var(--surface); z-index: 1; }
table { width: 100%; border-collapse: collapse; font-size: 15px; color: var(--ink); }
.table-wrap table:not(.compare) { min-width: 720px; }
.compare-wrap { max-width: 860px; }
table.compare { table-layout: fixed; width: 100%; min-width: 560px; }
table.compare col.metric { width: 38%; }
table.compare col.num { width: 20.666%; }
thead th {
  background: var(--card-2);
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  padding: 14px 20px;
  position: sticky;
  top: 0;
}
thead button {
  background: transparent;
  color: inherit;
  border: 0;
  width: 100%;
  text-align: inherit;
  padding: 0;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num button { text-align: right; }
tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--ink);
  line-height: 1.35;
}
tbody td.num, tfoot td.num { font-size: 15.5px; font-weight: 650; }
tbody td:first-child { padding-right: 28px; }
tbody tr:nth-child(even) td { background: var(--card-2); }
.delta { font-weight: 700; white-space: nowrap; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat, .delta.none { color: var(--muted); }
tbody tr.top td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.bottom td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tfoot td {
  padding: 14px 20px;
  font-weight: 700;
  border-top: 2px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
}
.cr-cell { display: flex; align-items: flex-start; gap: 12px; min-width: 260px; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface); flex: 0 0 auto; }
.cr-name { font-weight: 700; overflow-wrap: anywhere; }
.cr-cell > div { min-width: 0; }
.subname { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
}
.tag.top { background: var(--accent-soft); color: var(--accent-text); }
.tag.bottom { background: var(--bad-soft); color: var(--bad); }
.marks { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
details.daily { margin-top: 8px; }
details.daily summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px 22px;
  color: var(--muted);
  font-size: 12.5px;
}
.foot a { color: var(--accent-text); font-weight: 700; text-decoration: none; }

.index-wrap { max-width: 1100px; margin: 0 auto; padding: 22px; }
.index-wrap h2 { margin: 8px 0 14px; font-size: 16px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ccard {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  color: inherit;
}
.ccard:hover { border-color: var(--line-strong); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--accent-text); font-weight: 700; }
.ccard h3 { margin: 4px 0 8px; font-size: 16px; }
.chips span {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink);
}
.open { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--accent-text); }
.checks { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; color: var(--ink); }
.checks summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 16px; }
.checks ul { margin: 12px 0 4px; padding-left: 22px; }
.checks li { margin: 8px 0; color: var(--ink); font-size: 15px; line-height: 1.45; }
.status-ok { color: var(--good); font-weight: 700; }
.status-warn { color: var(--warn); font-weight: 700; }
.status-fail { color: var(--bad); font-weight: 700; }
.status-info { color: var(--info); font-weight: 700; }

@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.funnel .card:nth-child(5) { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .fresh { justify-content: flex-start; max-width: 100%; }
  .brand { max-width: 100%; }
  .titles h1, .titles p, .asof, .range-note { overflow-wrap: anywhere; }
  .layout { display: block; min-width: 0; }
  .pages {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 3;
    -webkit-overflow-scrolling: touch;
  }
  .pages h2 { display: none; }
  .pages button {
    width: auto;
    min-height: 44px;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
  }
  .pages button[aria-selected="true"] { border-bottom-color: var(--accent-text); }
  .canvas { padding: 16px; max-width: 100%; }
  .toolbar { gap: 10px; }
  .toolbar label { flex: 1 1 140px; min-width: 0; }
  .toolbar input[type="date"] { min-height: 44px; width: 100%; max-width: 100%; }
  .presets { flex: 1 1 100%; }
  .presets button { min-height: 44px; padding: 10px 14px; }
  .panel { padding: 16px 16px 20px; }
  .checks { padding: 16px; }
  thead th, tbody td, tfoot td { padding: 12px 16px; }
  thead button { min-height: 40px; }
  details.daily summary { min-height: 44px; display: flex; align-items: center; }
  .card .v { font-size: 22px; }
  .index-wrap { padding: 16px; }
}
@media (max-width: 480px) {
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .table-wrap table,
  .table-wrap table.compare,
  .table-wrap table:not(.compare) {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody, .table-wrap tfoot { display: block; }
  .table-wrap tr {
    display: block;
    margin: 0 0 10px;
    padding: 6px 0;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--card);
  }
  .table-wrap td, .table-wrap tfoot td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    width: auto;
    min-height: 40px;
    padding: 8px 16px;
    border: 0;
    text-align: right;
    position: static;
    background: transparent;
  }
  .table-wrap td::before {
    content: attr(data-label);
    flex: 1 1 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
  }
  .table-wrap td:first-child {
    display: block;
    padding-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
  }
  .table-wrap td:first-child::before { content: none; }
  .table-wrap tbody tr:nth-child(even) td,
  .table-wrap tbody td:first-child,
  .table-wrap tfoot td:first-child { background: transparent; }
}
@media (max-width: 414px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 12px; }
  .card .v { font-size: 20px; }
  .brand img { height: 24px; max-width: 42vw; }
  .titles h1 { font-size: 16px; }
}
@media (max-width: 389px) {
  .cards { grid-template-columns: 1fr; }
  .cards.funnel .card:nth-child(5) { grid-column: auto; }
  .card .v { font-size: 26px; }
}

/* Date picker: one month at a time, with the month and year always in view */
.datefield { position: relative; display: flex; flex-direction: column; gap: 4px; }
.datefield > span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.datebtn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 150px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.datebtn[aria-expanded="true"] { border-color: var(--accent); }
.datebtn svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.8; }
.calendar {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 300px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-transform: none;
  letter-spacing: normal;
}
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head select {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
.cal-head select.year { flex: 0 0 84px; }
.cal-nav {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.cal-nav:disabled { opacity: 0.35; cursor: default; }
.cal-title { font-size: 15px; font-weight: 700; color: var(--ink); text-align: center; margin: 0 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid .dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-grid button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.cal-grid button:hover:not(:disabled) { background: var(--card-2); }
.cal-grid button.in-range { background: var(--accent-soft); border-radius: 0; }
.cal-grid button.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal-grid button.picked { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 8px; }
.cal-grid button:disabled { color: var(--muted); opacity: 0.35; cursor: default; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.cal-foot button { background: none; border: 0; color: var(--accent-text); font: inherit; font-weight: 700; cursor: pointer; padding: 4px; }

/* Loading skeletons */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton);
  border-radius: 8px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
.sk-line { height: 12px; margin-top: 10px; }
.sk-value { height: 26px; width: 70%; margin-top: 10px; }
.sk-chart { height: 280px; margin-top: 14px; }
.sk-row { height: 40px; margin-top: 8px; }
.loading-note { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

/* Creative thumbnails and the zoom view */
.thumb-btn {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  cursor: zoom-in;
  line-height: 0;
}
.thumb-btn:hover, .thumb-btn:focus-visible { border-color: var(--accent); outline: none; }
.thumb-btn .thumb { width: 56px; height: 56px; border-radius: 7px; }
.thumb-btn .play {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 9px;
  line-height: 18px;
  text-align: center;
}
dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  width: fit-content;
  max-width: min(94vw, 1200px);
  max-height: 92vh;
  margin: auto;
  overflow: visible;
}
dialog.lightbox::backdrop { background: var(--overlay); }
.lb-box {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 14px;
  max-height: 92vh;
  overflow: auto;
}
.lb-media { display: flex; justify-content: center; align-items: center; background: #000; border-radius: 10px; overflow: hidden; position: relative; }
.lb-media img { display: block; max-width: 100%; max-height: calc(92vh - 40px); width: auto; height: auto; object-fit: contain; }
.lb-media iframe { display: block; width: min(540px, 84vw); height: min(78vh, 760px); border: 0; background: #fff; }
.lb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.lb-play:hover { background: rgba(0, 0, 0, 0.85); }
.lb-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lb-info { margin-top: 12px; }
.lb-info h4 { margin: 0; font-size: 16px; }
.lb-info p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.lb-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-stats b { font-weight: 700; }
.lb-info a { color: var(--accent-text); font-weight: 700; }
@media (max-width: 800px) {
  .datefield { flex: 1 1 140px; min-width: 0; }
  .datebtn { min-height: 44px; width: 100%; min-width: 0; }
  .calendar { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; }
  .cal-grid button { height: 42px; }
  .lb-close { top: 6px; right: 6px; }
  .lb-box { padding: 10px; padding-top: 52px; }
}

/* Ad copy */
.cr-copy { margin-top: 8px; max-width: 440px; }
.cr-copy .copy-headline { margin: 0 0 4px; font-weight: 700; font-size: 13.5px; }
.copy-text { margin: 0; white-space: pre-line; font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.copy-text.clamp-2, .copy-text.clamp-6 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.copy-text.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.copy-text.clamp-6 { -webkit-line-clamp: 6; line-clamp: 6; }
.copy-text.open { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.fold .more {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--accent-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.copy-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.cta {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.variants { font-size: 12px; color: var(--muted); font-weight: 600; }
.lb-layout { display: grid; grid-template-columns: minmax(0, auto) 340px; gap: 18px; align-items: start; }
.lb-layout .lb-info { margin-top: 0; max-height: calc(92vh - 40px); overflow: auto; padding-right: 4px; }
.lb-copy { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.lb-copy h5 { margin: 12px 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lb-copy .copy-headline { margin: 0 0 4px; font-weight: 700; font-size: 14.5px; }
.lb-copy .copy-text { color: var(--ink); font-size: 13.5px; }
.lb-copy .variant { position: relative; padding: 8px 10px 6px 34px; border: 1px solid var(--line-2); border-radius: 8px; margin-bottom: 8px; background: var(--surface); }
.lb-copy .variant:not(:has(.variant-n)) { padding-left: 10px; }
.variant-n { position: absolute; left: 10px; top: 9px; font-size: 11px; font-weight: 700; color: var(--accent-text); }
@media (max-width: 900px) {
  .lb-layout { grid-template-columns: 1fr; }
  .lb-media img { max-height: 55vh; }
  .lb-layout .lb-info { max-height: none; overflow: visible; }
}

/* SEO tab */
.seo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.seo-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px 6px 6px; cursor: pointer;
}
.seo-chip:hover { border-color: var(--line-strong); }
.seo-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seo-chip-state { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.seo-chip.on .seo-chip-state { color: var(--good); }
.seo-chip.off .seo-chip-state { color: var(--warn); }
.seo-chip.fail .seo-chip-state { color: var(--bad); }
.seo-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; flex: none;
}
.seo-section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 28px 0 12px; scroll-margin-top: 16px; }
.seo-section-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.seo-section-title .seo-n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seo-status {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; border: 1px solid var(--line-2);
}
.seo-status.on { color: var(--good); background: var(--accent-soft); border-color: var(--accent-soft); }
.seo-status.off { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.seo-status.fail { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.seo-source { color: var(--muted); font-size: 13.5px; }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.cards.five { margin-bottom: 10px; }
.text-link { background: none; border: 0; padding: 0; margin-top: 4px; color: var(--accent-text); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.text-link:hover, .text-link:focus-visible { color: var(--ink); }
.seo-foot { margin: 0 0 14px; }
.grid-even { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.grid-even.flat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
h4.seo-sub { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.panel.not-connected { border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
.nc-line { margin: 0 0 6px; color: var(--warn); font-weight: 700; font-size: 15px; }
.nc-list { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14px; columns: 2; column-gap: 32px; }
.nc-list li { margin: 2px 0; break-inside: avoid; }
@media (max-width: 980px) {
  .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-even.flat { grid-template-columns: minmax(0, 1fr); }
  .nc-list { columns: 1; }
}
@media (max-width: 480px) {
  .seo-section-title { font-size: 18px; }
  .seo-source { flex-basis: 100%; }
  .seo-chip { font-size: 12.5px; }
}
@media (max-width: 389px) {
  .cards.four { grid-template-columns: 1fr; }
}

/* Creative image gallery in the zoom view */
.lb-media-col { min-width: 0; }
.lb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lb-thumb { padding: 0; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid var(--line-2); background: #000; cursor: pointer; }
.lb-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lb-thumb.on { border-color: var(--accent); }
.lb-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Winning creatives */
.win-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.win-card {
  display: flex; flex-direction: column; padding: 0; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; cursor: pointer; min-width: 0;
}
.win-card:hover { border-color: var(--accent); }
.win-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.win-pic { position: relative; aspect-ratio: 4 / 5; background: #000; display: grid; place-items: center; }
.win-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.win-pic .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: rgba(0,0,0,.7); color: #fff; font-size: 16px; }
.win-rank { position: absolute; left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 2px 8px; }
.win-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.win-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.win-headline { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.win-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin-top: 6px; }
.win-stats .k { display: block; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.win-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) { .win-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 389px) { .win-grid { grid-template-columns: 1fr; } }
.lb-media-col:has(.lb-thumbs) .lb-media img { max-height: calc(92vh - 116px); }
@media (max-width: 900px) { .lb-media-col:has(.lb-thumbs) .lb-media img { max-height: 50vh; } }

/* Master view (/v3/master): daily leads and cost per lead for every client */
.master-wrap { max-width: 1480px; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.master-wrap .toolbar { margin-bottom: 0; }
.master-wrap .table-wrap table { min-width: 640px; }
.master-wrap .master-top table { min-width: 0; }
.master-wrap .master-top { max-width: 560px; }
.toolbar select {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.master-wrap tr.total td { font-weight: 700; border-top: 2px solid var(--accent); border-bottom: 0; }
.master-wrap tr.pick { cursor: pointer; }
.master-wrap tr.pick:hover td, .master-wrap tr.pick:focus td { background: var(--accent-soft); }
.master-wrap tr.pick.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.index-links { margin: 0 0 18px; }
.index-links a { display: inline-flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; font-weight: 700; text-decoration: none; }
/* Master view: all clients at a glance */
.master-wrap .overview table { min-width: 1180px; font-size: 14px; }
.overview thead th { padding: 10px 12px; font-size: 11.5px; white-space: nowrap; }
.overview thead tr.group th { border-bottom: 1px solid var(--line-2); }
.overview thead th.grp { text-align: center; }
.overview thead th.grp.meta { box-shadow: inset 0 -2px 0 var(--accent); }
.overview thead th.grp.google { box-shadow: inset 0 -2px 0 var(--google); }
.overview thead th[data-sort] { cursor: pointer; }
.overview thead th[aria-sort="descending"]::after { content: " ▼"; color: var(--accent-text); }
.overview thead th[aria-sort="ascending"]::after { content: " ▲"; color: var(--accent-text); }
.overview tbody td, .overview tfoot td { padding: 10px 12px; white-space: nowrap; }
.overview tbody td.num { font-size: 14px; font-weight: 500; }
.overview tbody td.num.strong { font-weight: 700; font-size: 15px; }
.overview td a { color: var(--ink); font-weight: 700; text-decoration: none; }
.overview td a:hover { color: var(--accent-text); text-decoration: underline; }
.overview td.na, .overview td.muted { color: var(--muted); opacity: 0.7; text-align: center; }
.overview td.muted { text-align: right; }
.overview td.change { font-size: 12.5px; line-height: 1.5; }
.overview .spark { width: 120px; height: 28px; display: block; }
.overview .spark rect.on { fill: var(--accent); }
.overview .spark rect.off { fill: var(--line-2); }
.overview .st { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; }
.overview .st-ok { background: var(--accent-soft); color: var(--accent-text); }
.overview .st-info { background: var(--card-2); color: var(--info); border: 1px solid var(--line-2); }
.overview .st-warn { background: var(--warn-bg); color: var(--warn); }
.overview .st-fail { background: var(--bad-bg); color: var(--bad); }
.overview td .subname { white-space: normal; min-width: 160px; max-width: 240px; }
.overview .spark { width: 96px; height: 26px; }
.overview .latest { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.master-wrap .overview table { min-width: 1100px; }
.overview tbody td, .overview tfoot td, .overview thead th { padding-left: 9px; padding-right: 9px; }
