:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #141416;
  --line: #27272a;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --accent: #58c4a0;
  --strong-accent: #28785c;
  --warn: #e9c791;
  font: 16px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
a { color: var(--accent); text-underline-offset: .2em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.srOnly { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.frame { width: min(100% - 3rem, 87.5rem); margin: auto; }
.masthead { min-height: 5.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { font-size: clamp(1.32rem,3.5vw,1.55rem); font-weight: 720; letter-spacing: -.035em; }
h2 { font-size: 1.1rem; font-weight: 640; letter-spacing: -.018em; }
h3 { font-size: .9rem; }
.brandName { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.mastheadTools { display: flex; align-items: center; gap: .8rem; }
#freshness, small, .caption, footer { color: var(--muted); font-size: .82rem; }
.sourceLink, .sourceActions button { text-decoration: none; color: var(--ink); font-size: .88rem; white-space: nowrap; border: 1px solid var(--line); border-radius: .52rem; padding: .5rem .68rem; background: var(--panel); }
.sourceLink:hover, .sourceActions button:hover { border-color: #55555d; }
.views { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.views a { text-decoration: none; color: var(--muted); white-space: nowrap; font-size: .92rem; padding: .5rem 0 .63rem; border-bottom: 2px solid transparent; }
.views a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.period { display: grid; justify-items: stretch; gap: .23rem; white-space: nowrap; }
.period small { text-align: right; }
select { font: inherit; font-size: .86rem; color: var(--ink); background: #0c0c0e; border: 1px solid #37373c; border-radius: .5rem; padding: .45rem .65rem; width: 100%; min-height: 2.45rem; }
.panel, .reports { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel); padding: 1.15rem; }
#content > *, .row, .pulseGrid { margin-bottom: 1rem; }
.row, .pulseGrid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.panelHead { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .72rem; }
.panelHead small { text-align: right; }
.pulseToday h2, .pulseYesterday h3, .monthPulse h2 { font-size: .86rem; font-weight: 650; color: var(--muted); }
.pulseToday strong, .monthAmount strong { display: block; font-size: clamp(1.75rem,5vw,2.4rem); line-height: 1.05; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin: .35rem 0 .23rem; }
.pulseYesterday { border-top: 1px solid var(--line); padding-top: .74rem; margin-top: .78rem; }
.pulseStats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; margin-top: .44rem; }
.highlight { min-width: 0; }
.highlight span, .highlight small { display: block; color: var(--muted); font-size: .83rem; }
.highlight strong { display: block; margin-top: .17rem; font-size: clamp(.97rem, 2.4vw, 1.22rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.monthAmount { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-top: .55rem; }
.monthAmount small, .monthFoot small:last-child { text-align: right; }
.monthFoot { display: flex; justify-content: space-between; gap: .45rem; }
.monthPulse progress { appearance: none; width: 100%; height: .51rem; margin: .8rem 0 .37rem; border: 0; border-radius: 99px; background: #303036; accent-color: var(--accent); }
.monthPulse progress::-webkit-progress-bar { background: #303036; border-radius: 99px; }
.monthPulse progress::-webkit-progress-value { background: #4eb693; border-radius: 99px; }
.channelHead { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
#chartControls { display: flex; gap: .55rem; align-items: start; }
.segment { display: flex; gap: .18rem; padding: .2rem; border: 1px solid #36363b; border-radius: .55rem; background: #1d1d21; }
.segment button { border: 0; border-radius: .35rem; background: transparent; color: var(--muted); padding: .36rem .62rem; cursor: pointer; font-size: .83rem; min-height: 2rem; }
.segment button:hover { color: var(--ink); }
.segment button[aria-pressed="true"] { background: var(--strong-accent); color: white; }
.chartSummary { display: flex; justify-content: space-between; align-items: end; gap: .5rem; margin: .4rem 0 .8rem; }
.chartSummary strong { display: block; font-size: 1.57rem; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
#chartFocus { color: var(--muted); text-align: right; font-size: .82rem; }
.trendChart { width: 100%; height: clamp(12.6rem,31vw,19.5rem); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .35rem 0 .62rem; font-size: .84rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.swatch { width: .64rem; height: .64rem; border-radius: .16rem; background: #8b8b98; }
.swatch.direct { background: #3aa681; }
.swatch.other { background: #667488; }
.reports h2 { margin-bottom: .65rem; }
.report { border-top: 1px solid var(--line); margin: 0; }
.report summary { padding: .62rem 0; color: var(--ink); }
.report:last-child summary { padding-bottom: .23rem; }
.report:last-child[open] summary { padding-bottom: .62rem; }
.report > .panel, .report .row > .panel { background: #101012; }
.report > .panel .panel { margin: .55rem 0; }
.description { font-size: .9rem; line-height: 1.5; color: var(--muted); margin: .46rem 0; }
.measure { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .65rem; padding: .56rem 0; border-top: 1px solid var(--line); font-size: .91rem; }
.measure span { color: var(--muted); }
.measure strong { font-weight: 640; text-align: right; font-variant-numeric: tabular-nums; }
.measure small { display: block; font-weight: 400; margin-top: .15rem; }
.pill { padding: .2rem .46rem; border: 1px solid var(--line); border-radius: 99px; font-size: .76rem; white-space: nowrap; }
.measure .pill.live { color: var(--accent); }
.measure .pill.partial { color: var(--warn); }
.measure .pill.blocked { color: #ffb2a9; }
.trace { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; margin-bottom: .7rem; }
.trace div { border: 1px solid var(--line); border-radius: .48rem; padding: .66rem; }
.trace p { color: var(--muted); font-size: .85rem; margin-top: .24rem; }
.tableWrap { overflow-x: auto; margin-top: .35rem; }
table { width: 100%; text-align: left; border-collapse: collapse; font-size: .88rem; }
th { color: var(--muted); font-weight: 600; }
th, td { padding: .5rem .43rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
details { margin-top: .55rem; }
summary { cursor: pointer; color: var(--accent); font-size: .88rem; }
.empty { padding: 1rem; color: var(--muted); }
.campaignLabel { display: block; margin: .25rem 0; font-size: .85rem; color: var(--muted); }
#campaign { margin-bottom: .55rem; }
.sourceActions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .7rem 0; }
.sourceActions button { cursor: pointer; }
.sourceActions button:disabled { opacity: .7; cursor: wait; }
.sourceActions span { color: var(--muted); font-size: .85rem; }
footer { border-top: 1px solid var(--line); padding: .8rem 0 1.4rem; display: flex; justify-content: space-between; gap: .6rem; }
@media (max-width: 670px) {
  .frame { width: calc(100% - 1.65rem); }
  .masthead { min-height: 4.65rem; }
  .pulseGrid, .row { grid-template-columns: minmax(0,1fr); gap: .63rem; }
  #content > *, .row, .pulseGrid { margin-bottom: .65rem; }
  .panel, .reports { padding: .84rem; }
  .channelHead { flex-direction: column; }
  #chartControls { justify-content: space-between; width: 100%; }
  .chartSummary { margin-top: .3rem; }
}
@media (max-width: 410px) {
  .views { gap: 1rem; }
  .views a { font-size: .84rem; }
  .segment button { padding-inline: .43rem; }
  .period { white-space: normal; }
  .period small { font-size: .77rem; }
  .trace { grid-template-columns: minmax(0,1fr); }
  .panelHead { align-items: start; flex-wrap: wrap; }
  .panelHead small { text-align: left; }
}
.viewToolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .25rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.viewToolbar .views { border: 0; margin: 0; align-items: stretch; }
.viewToolbar .views a { min-height: 2.75rem; display: flex; align-items: center; padding-top: .29rem; padding-bottom: .42rem; }
#periodDock { margin-bottom: .38rem; max-width: 100%; }
#periodDock:empty { display: none; }
.period select { min-height: 2.75rem; }
.paceBars { display: grid; gap: .24rem; margin: .6rem 0 .45rem; }
.paceBars div { display: grid; grid-template-columns: 6.15rem minmax(0,1fr); align-items: center; gap: .5rem; }
.paceBars span { color: var(--muted); font-size: .82rem; }
.monthPulse .paceBars progress { margin: 0; }
.paceBars div:last-child progress::-webkit-progress-value { background: #727581; }
.segment button { min-height: 2.75rem; }
@media (max-width: 670px) {
  #freshness { display: block; }
  .mastheadTools { flex-direction: column-reverse; align-items: end; gap: .2rem; }
  #freshness { white-space: nowrap; font-size: .76rem; }
  .channelHead { flex-direction: row; align-items: center; flex-wrap: wrap; }
  #chartControls { width: auto; }
}
@media (max-width: 560px) {
  .viewToolbar { align-items: stretch; flex-direction: column; border: 0; gap: .5rem; margin-bottom: .65rem; }
  .viewToolbar .views { border-bottom: 1px solid var(--line); }
  #periodDock { display: flex; justify-content: end; margin-bottom: 0; }
  #periodDock:has([hidden]) { display: none; }
  .period { max-width: 100%; }
}

.accessFrame { max-width: 26rem; }
.accessForm { display: grid; gap: .65rem; margin-top: .8rem; }
.accessForm label { font-size: .9rem; color: var(--muted); }
.accessForm input { background: #0c0c0e; color: var(--ink); border: 1px solid #37373c; border-radius: .5rem; padding: .55rem .65rem; font: inherit; min-height: 2.75rem; }
.accessForm button { justify-self: start; cursor: pointer; }
