/* ZTH Webinar Desk — trading-terminal dark theme.
   Brand ink #11131A and electric blue #167EF7 (zerotohero.org); neutrals tinted toward the blue.
   Figures are Red Hat Mono, tabular; UI is Archivo. Colour is signal only. */

:root {
  --bg:        oklch(0.165 0.012 265);   /* page */
  --bg-raise:  oklch(0.205 0.013 265);   /* table header, summaries */
  --bg-inset:  oklch(0.135 0.012 265);   /* inputs, log */
  --bg-hover:  oklch(0.235 0.014 265);
  --line:      oklch(0.29 0.014 265);
  --line-2:    oklch(0.38 0.016 265);
  --ink:       oklch(0.93 0.008 265);
  --ink-2:     oklch(0.74 0.012 265);
  --ink-3:     oklch(0.55 0.014 265);
  --blue:      oklch(0.63 0.19 256);     /* #167EF7 */
  --blue-deep: oklch(0.50 0.17 256);
  --blue-tint: oklch(0.63 0.19 256 / 0.14);
  --good:      oklch(0.78 0.15 158);
  --good-tint: oklch(0.78 0.15 158 / 0.12);
  --bad:       oklch(0.70 0.19 24);
  --bad-tint:  oklch(0.70 0.19 24 / 0.12);
  --warn:      oklch(0.82 0.15 82);
  --warn-tint: oklch(0.82 0.15 82 / 0.12);
  --neutral:   var(--ink-3);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Red Hat Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-lg: 16px;
  --space-xl: 24px; --space-2xl: 32px; --space-3xl: 48px;
  --radius: 3px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 0.95rem; color: var(--ink-2); margin-bottom: var(--space-md); }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.85em; color: var(--ink-2); }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.na { color: var(--ink-3); }
.num, td, .value, .val, .metric-value, .stamp, .node-stats, .kpi { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-lg); flex-wrap: wrap;
  padding: var(--space-md) clamp(16px, 3vw, 40px);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: var(--space-md); }
.mark {
  font-family: var(--sans); font-weight: 800; font-stretch: 80%; letter-spacing: 0.04em;
  color: var(--bg); background: var(--ink); padding: 2px 7px; border-radius: var(--radius); font-size: 0.8rem;
}
.wordmark { font-weight: 600; font-size: 1rem; }
.stamp { font-size: 0.75rem; color: var(--ink-3); }
.controls { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
.controls .days { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.controls input { width: 64px; }
.controls .range { display: flex; align-items: center; gap: var(--space-sm); padding-right: var(--space-md); margin-right: var(--space-xs); border-right: 1px solid var(--line); }
.controls .range-preset { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.controls .range input[type="date"] { width: auto; min-width: 9.5em; }
.controls .range input[type="date"]:read-only { color: var(--ink-3); }
.controls .range-sep { color: var(--ink-3); font-size: 0.8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { .controls .range { border-right: 0; padding-right: 0; flex-wrap: wrap; } }

/* ---------- controls ---------- */
button, input, select {
  font: inherit; color: var(--ink);
  background: var(--bg-inset); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 6px 10px; line-height: 1.3;
}
input, select { font-family: var(--mono); font-size: 0.85rem; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
button { cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 0.8rem; transition: background 120ms var(--ease), border-color 120ms var(--ease); }
button.primary { background: var(--blue); border-color: var(--blue); color: oklch(0.99 0 0); font-weight: 600; }
button.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
button.ghost, button.secondary { background: transparent; color: var(--ink-2); }
button.ghost:hover, button.secondary:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--ink-3); }
button:disabled { opacity: 0.45; cursor: wait; }
input.narrow { width: 88px; }
label { font-size: 0.8rem; color: var(--ink-2); }
select { padding-right: 24px; }

/* ---------- page ---------- */
.page { padding: var(--space-xl) clamp(16px, 3vw, 40px) var(--space-3xl); max-width: 1680px; margin: 0 auto; }
section { margin-bottom: var(--space-3xl); }
.sec-head { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-md); align-items: baseline; margin-bottom: var(--space-lg); }
.sec-head .eyebrow { font-family: var(--mono); font-size: 0.7rem; color: var(--blue); letter-spacing: 0.1em; }
.sec-head:not(.split) h2 { grid-column: 2; }
.sec-head:not(.split) .hint { grid-column: 2; }
.sec-head.split { grid-template-columns: 1fr auto; align-items: end; }
.sec-head.split > div { display: grid; row-gap: var(--space-xs); }
.hint { font-size: 0.8rem; color: var(--ink-3); max-width: 78ch; margin-top: var(--space-xs); }
.hint.push { margin-left: auto; }
.toolbar { display: flex; gap: var(--space-lg); align-items: end; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.toolbar label { display: grid; row-gap: var(--space-xs); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.picker { display: flex; align-items: center; gap: var(--space-sm); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }

/* ---------- status ---------- */
.status { padding: var(--space-sm) var(--space-md); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-lg); font-size: 0.85rem; }
.status.info { border-color: var(--blue); background: var(--blue-tint); }
.status.error { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); }
.status.ok { border-color: var(--good); background: var(--good-tint, transparent); color: var(--good); }
.status.success { border-color: var(--good); background: var(--good-tint); color: var(--good); }

/* ---------- tabs ---------- */
.top-tabs { display: flex; gap: var(--space-xs); border-bottom: 1px solid var(--line); margin-bottom: var(--space-xl); overflow-x: auto; }
.top-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
  padding: var(--space-sm) var(--space-lg); color: var(--ink-3); font-size: 0.85rem; font-weight: 500;
}
.top-tab:hover { color: var(--ink); }
.top-tab.active { color: var(--ink); border-bottom-color: var(--blue); }
.tab-pane.hidden { display: none; }

/* ---------- headline strip ---------- */
.headline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-2xl);
  background: var(--bg-raise);
}
.headline:empty { display: none; }
.headline.overview { margin-top: calc(-1 * var(--space-xl)); }
.headline .stat { padding: var(--space-md) var(--space-lg); border-right: 1px solid var(--line); min-width: 0; }
.headline .stat:last-child { border-right: 0; }
.headline .stat.lead { grid-column: span 2; background: var(--bg); }
.headline .lab { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: var(--space-xs); }
.headline .val { display: block; font-size: 1.35rem; font-weight: 500; line-height: 1.15; }
.headline .val.good { color: var(--good); } .headline .val.bad { color: var(--bad); }
.headline .sub { display: block; font-size: 0.72rem; color: var(--ink-3); margin-top: 2px; font-family: var(--sans); }
.headline .stat.lead .val { font-family: var(--sans); font-size: 1.15rem; font-weight: 600; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.8rem; white-space: nowrap; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-raise); color: var(--ink-3);
  font-family: var(--sans); font-stretch: 85%; font-weight: 600; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--space-sm) var(--space-md); text-align: right; border-bottom: 1px solid var(--line-2);
}
thead th.l, td.date-cell, td.topic-cell, td.name, td:first-child { text-align: left; }
td { padding: 7px var(--space-md); border-bottom: 1px solid var(--line); text-align: right; font-size: 0.8rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-hover); }
td.date-cell { font-family: var(--sans); font-weight: 600; }
td.topic-cell { font-family: var(--sans); color: var(--ink-3); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
td.name, th.name { font-family: var(--sans); text-align: left; }
td.idx { color: var(--ink-3); text-align: left; }
td.l { text-align: left; }
.rate { font-weight: 500; }
.rate.good { color: var(--good); } .rate.bad { color: var(--bad); } .rate.neutral { color: var(--ink-2); }
.grade { font-weight: 600; font-size: 1.05em; }
.spend-cell .spend-val { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.spend-cell .spend-val.empty { color: var(--ink-3); }
.utm-flag { font: 600 10px/1 var(--sans); letter-spacing: .04em; padding: 2px 5px; margin-left: 6px; border-radius: 3px;
  border: 1px solid var(--ink-3); background: transparent; color: var(--ink-3); cursor: pointer; vertical-align: middle; }
.utm-flag.on { border-color: var(--good, #2a9d5c); background: var(--good, #2a9d5c); color: #fff; }

/* credit expansion (Section 1) */
.credit-toggle { cursor: pointer; color: var(--good); text-decoration: underline dotted; text-underline-offset: 3px; }
.credit-expansion { display: none; }
.credit-expansion.open { display: table-row; }
.credit-expansion td { background: var(--bg-inset); padding: var(--space-md) var(--space-lg); text-align: left; }
.credit-expansion .lede { font-family: var(--sans); color: var(--ink-3); font-size: 0.8rem; margin-bottom: var(--space-sm); }
.credit-expansion table { width: auto; min-width: 480px; }
.credit-expansion th { position: static; text-align: left; }
.credit-expansion th.r, .credit-expansion td.r { text-align: right; }
.credit-expansion td { border-bottom-color: var(--line); background: transparent; padding: 4px var(--space-md); }
.credit-expansion td.idx { color: var(--ink-3); }
.credit-expansion td.email { color: var(--ink-2); }
.credit-expansion td.credit { font-weight: 600; color: var(--warn); }
.credit-expansion td.credit.hi { color: var(--good); }

/* ---------- account split + tree (Section 4) ---------- */
.s3-tabs { display: flex; gap: var(--space-xs); margin: var(--space-sm) 0 var(--space-md); flex-wrap: wrap; }
.s3-tab { padding: 4px 12px; font-size: 0.78rem; background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); font-family: var(--mono); }
.s3-tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.s3-pane.hidden { display: none; }
.account-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); margin-top: var(--space-sm); }
@media (max-width: 960px) { .account-split { grid-template-columns: 1fr; } }
.account-col { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-sm) var(--space-md); min-width: 0; }
.account-col > summary { cursor: pointer; list-style: none; display: grid; row-gap: 2px; padding: var(--space-xs) 0; }
.account-col > summary::-webkit-details-marker { display: none; }
.account-col .account-name { font-weight: 600; font-size: 0.9rem; }
.account-col .account-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 1px; vertical-align: 1px; }
.account-col.old .account-name::before { background: var(--blue); }
.account-col.new .account-name::before { background: var(--warn); }
.account-col .account-sub { font-size: 0.72rem; color: var(--ink-3); font-family: var(--mono); }
.account-col .account-body { margin-top: var(--space-sm); }
.account-col .other-camps { margin-top: var(--space-md); padding-top: var(--space-sm); border-top: 1px dashed var(--line); }
.account-col .other-head { margin: 0 0 var(--space-xs); font-size: 0.72rem; color: var(--ink-3); font-family: var(--mono); }
.campaign-group { border-bottom: 1px solid var(--line); padding: var(--space-xs) 0; }
.campaign-group summary { cursor: pointer; font-weight: 600; padding: var(--space-sm) 0; }
.campaign-group summary::marker { color: var(--blue); }
.tree-node { border-top: 1px solid var(--line); padding: var(--space-xs) 0 var(--space-xs) var(--space-md); }
.tree-node > summary { cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); padding: var(--space-xs) 0; font-size: 0.82rem; list-style: none; }
.tree-node > summary::-webkit-details-marker { display: none; }
.tree-node > summary::before { content: "›"; color: var(--ink-3); width: 10px; transition: transform 150ms var(--ease); display: inline-block; }
.tree-node[open] > summary::before { transform: rotate(90deg); }
.tree-node .node-name { flex: 0 0 auto; min-width: 260px; max-width: 100%; font-weight: 600; font-family: var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node .node-stats { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); font-size: 0.72rem; color: var(--ink-3); flex: 1 1 auto; }
.tree-node .node-stats span { white-space: nowrap; }
.tree-node .node-stats strong { color: var(--ink); font-weight: 500; }
.tree-children { margin-top: var(--space-xs); }
.tree-ad > summary::before { content: "·"; }
.ad-thumb { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: inline-block; position: relative; vertical-align: middle; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb.video::after { content: "▶"; position: absolute; right: 3px; bottom: 1px; font-size: 0.6rem; color: #fff; text-shadow: 0 0 3px #000; }
.ad-thumb.none::after { content: "—"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 0.8rem; }
td.thumb { width: 52px; padding-top: 4px; padding-bottom: 4px; }
.tree-ad { color: var(--ink-2); }

/* ---------- cards: insights, true-cpl summary, connections ---------- */
.insights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.insight-card, .card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-md) var(--space-lg); background: var(--bg-raise); min-width: 0; }
.insight-card .label { font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-xs); }
.insight-card .name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-card .value { font-size: 1.4rem; font-weight: 500; color: var(--ink); margin-top: var(--space-xs); }
.insight-card.empty { opacity: 0.55; }
.insight-card .context { font-size: 0.75rem; color: var(--ink-3); margin-top: var(--space-xs); }
.insight-card .context.sub { margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-card .metrics { margin-top: var(--space-md); padding-top: var(--space-sm); border-top: 1px solid var(--line); display: grid; row-gap: 2px; }
.metric-row { display: flex; justify-content: space-between; font-size: 0.78rem; }
.metric-row .metric-label { color: var(--ink-3); }
.metric-row .metric-value { font-weight: 500; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); padding: var(--space-md) var(--space-lg); }
.kpi .lab { display: block; font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: var(--space-xs); }
.kpi .val { display: block; font-size: 1.35rem; font-weight: 500; }
.badge { display: inline-block; padding: 1px 6px; border-radius: var(--radius); font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid; }
.badge.active { color: var(--good); border-color: color-mix(in oklch, var(--good) 40%, transparent); }
.badge.paused { color: var(--ink-3); border-color: var(--line-2); }
.insights-toggle { margin-bottom: var(--space-sm); font-size: 0.8rem; display: flex; gap: var(--space-lg); align-items: center; }
.insights-toggle label { cursor: pointer; }

/* ---------- analysis ---------- */
.analysis-section { margin-bottom: var(--space-3xl); }
.analysis-heading { font-size: 1rem; display: inline-flex; align-items: center; gap: var(--space-sm); }
.analysis-heading::before { content: ""; width: 10px; height: 10px; border-radius: 1px; background: var(--ink-3); }
.analysis-heading.good::before { background: var(--good); }
.analysis-heading.bad::before { background: var(--bad); }
.analysis-section h4 { font-size: 0.68rem; margin: var(--space-lg) 0 var(--space-sm); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.analysis-row {
  display: grid; grid-template-columns: 2fr repeat(5, 1fr); gap: var(--space-md); align-items: center;
  padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--line); font-size: 0.82rem;
}
.analysis-row:last-child { border-bottom: 1px solid var(--line); }
.analysis-row:hover { background: var(--bg-hover); }
.analysis-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-row .name .sub { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.74rem; }
.analysis-row .metric { text-align: right; }
.analysis-row .metric .label { display: block; font-size: 0.62rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--sans); }
.analysis-row .metric .value { font-weight: 500; }
.analysis-row .metric .value.big { font-size: 1.05rem; color: var(--good); }
.analysis-row .metric .value.bad { color: var(--bad); }
.analysis-row.good .name::before, .analysis-row.bad .name::before, .analysis-row.neutral .name::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 1px; vertical-align: 2px;
}
.analysis-row.good .name::before { background: var(--good); }
.analysis-row.bad .name::before { background: var(--bad); }
.analysis-row.neutral .name::before { background: var(--ink-3); }
.analysis-empty { color: var(--ink-3); font-size: 0.82rem; padding: var(--space-sm) var(--space-md); }
@media (max-width: 800px) { .analysis-row { grid-template-columns: 1fr 1fr 1fr; } .analysis-row .name { grid-column: 1 / -1; } }

/* ---------- connections ---------- */
.conn-card h3 { color: var(--ink); display: flex; align-items: center; gap: var(--space-sm); }
.conn-card label { display: grid; row-gap: var(--space-xs); margin: var(--space-sm) 0; font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); }
.conn-card input { width: 100%; }
.conn-actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; margin-top: var(--space-sm); }
.conn-result { font-size: 0.78rem; }
.conn-result.good { color: var(--good); } .conn-result.bad { color: var(--bad); }
.conn-badge { font-family: var(--mono); font-size: 0.62rem; padding: 1px 6px; border-radius: var(--radius); border: 1px solid var(--line-2); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.conn-badge.good { color: var(--good); border-color: color-mix(in oklch, var(--good) 40%, transparent); }

/* ---------- metric help ---------- */
.help-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; margin-left: 5px; vertical-align: 1px;
  border: 1px solid var(--line-2); border-radius: 50%;
  font-family: "Georgia", "Times New Roman", serif; font-style: italic; font-size: 9px; font-weight: 600; line-height: 1;
  color: var(--ink-3); text-transform: none; letter-spacing: 0; cursor: help; user-select: none;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}
.help-i:hover, .help-i:focus-visible { color: var(--blue); border-color: var(--blue); outline: none; }
.node-stats .help-i { width: 12px; height: 12px; margin-left: 3px; font-size: 8px; }
.headline .lab .help-i, .kpi .lab .help-i, .insight-card .label .help-i { vertical-align: 0; }
#tip {
  position: absolute; top: 0; left: 0; z-index: 100; max-width: 300px;
  padding: var(--space-sm) var(--space-md);
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.78rem; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none; white-space: normal;
  box-shadow: 0 6px 20px oklch(0 0 0 / 0.4);
  opacity: 0; pointer-events: none; transition: opacity 100ms var(--ease);
}
#tip.on { opacity: 1; }

/* ---------- misc ---------- */
.log summary { cursor: pointer; color: var(--ink-3); font-size: 0.8rem; }
pre#log-output { font-family: var(--mono); font-size: 0.72rem; max-height: 400px; overflow: auto; white-space: pre-wrap; background: var(--bg-inset); border: 1px solid var(--line); padding: var(--space-md); border-radius: var(--radius); margin-top: var(--space-sm); }
.empty { color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: var(--space-2xl); text-align: center; }
.empty .glyph { font-family: var(--mono); font-size: 1.4rem; color: var(--ink-3); margin-bottom: var(--space-sm); }
.meta-fresh { color: var(--ink-3); } .meta-fresh.stale { color: var(--warn); }

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  .tab-pane:not(.hidden) > section, .tab-pane:not(.hidden) > .headline { animation: rise 420ms var(--ease) both; }
  .tab-pane:not(.hidden) > section:nth-child(2) { animation-delay: 40ms; }
  .tab-pane:not(.hidden) > section:nth-child(3) { animation-delay: 80ms; }
  .tab-pane:not(.hidden) > section:nth-child(4) { animation-delay: 120ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(360px, 90vw); display: grid; row-gap: var(--space-xl); }
.login-form { display: grid; row-gap: var(--space-md); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-xl); background: var(--bg-raise); }
.login-form label { display: grid; row-gap: var(--space-xs); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.login-form input { font-family: var(--sans); }
.login-form button { margin-top: var(--space-sm); padding: 10px; }
.login .status { margin: 0; }
.login-alt summary { cursor: pointer; }
.login-alt[open] summary { margin-bottom: var(--space-md); }

/* ---------- drill-down: clickable metric cells + side drawer ---------- */
td.drill { cursor: pointer; }
td.drill:hover { background: var(--bg-hover); }
td.drill > .drill-val { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
td.drill:hover > .drill-val { text-decoration-color: var(--blue); }
.drawer-backdrop { position: fixed; inset: 0; background: oklch(0 0 0 / 0.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 96vw); background: var(--bg-raise);
          border-left: 1px solid var(--line); z-index: 41; display: flex; flex-direction: column;
          box-shadow: -24px 0 48px oklch(0 0 0 / 0.35); }
.drawer.hidden, .drawer-backdrop.hidden { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md);
               padding: var(--space-lg); border-bottom: 1px solid var(--line); }
.drawer-title { font-family: var(--sans); font-weight: 600; font-size: 1rem; }
.drawer-sub { font-size: 0.8rem; margin-top: 2px; }
.drawer-actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.drawer-actions input { background: var(--bg-inset); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius);
                        padding: 6px 10px; font: inherit; font-size: 0.85rem; width: 160px; }
.drawer-body { overflow: auto; padding: var(--space-md) var(--space-lg) var(--space-xl); }
.drawer-body table { width: 100%; }
.drawer-body th { position: sticky; top: 0; background: var(--bg-raise); text-align: left; }
.drawer-body th.r, .drawer-body td.r { text-align: right; }
.drawer-body td { padding: 4px var(--space-sm); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.drawer-body td.idx { color: var(--ink-3); }
.drawer-body td.email { font-family: var(--mono); font-size: 0.78rem; }
.drawer-body .empty { color: var(--ink-3); padding: var(--space-xl) 0; text-align: center; }
.drawer-body .tag { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 0.72rem; border: 1px solid var(--line-2); color: var(--ink-2); }
.drawer-body .tag.calendly { border-color: var(--blue); color: var(--blue); }
.drawer-body .tag.rereg { border-color: var(--warn); color: var(--warn); }
.drawer-body .tag.yes { border-color: var(--good); color: var(--good); }
@media (max-width: 700px) { .drawer { width: 100vw; } .drawer-actions input { width: 110px; } }

/* ---------- insights: trend cards, movers deltas, data health ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.trend-card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-md) var(--space-lg); background: var(--bg-raise); min-width: 0; }
.trend-card.empty { opacity: 0.55; }
.trend-card .label { font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-xs); }
.trend-card .row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.trend-card .value { font-size: 1.35rem; font-weight: 500; font-family: var(--mono); }
.trend-card .deltas { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-top: var(--space-xs); }
.trend-card .context { font-size: 0.72rem; color: var(--ink-3); margin-top: var(--space-xs); }
.spark { flex: 1 1 40px; min-width: 0; max-width: 120px; width: auto; height: 28px; overflow: visible; }
.trend-card .row .value { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.spark path { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--blue); }
.delta { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; white-space: nowrap; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); } .delta.neutral { color: var(--ink-3); }
.delta .vs { color: var(--ink-3); font-family: var(--sans); font-weight: 400; }
.delta .vs:empty { display: none; }
.analysis-row .metric .value .delta { display: block; font-size: 0.68rem; }
.trend-table td.name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-list { display: grid; row-gap: 1px; margin-bottom: var(--space-xl); }
.health-row { display: grid; grid-template-columns: 14px 1fr; column-gap: var(--space-md); align-items: start; padding: var(--space-sm) var(--space-md); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); font-size: 0.82rem; }
.health-row .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--ink-3); }
.health-row.ok .dot { background: var(--good); } .health-row.warn .dot { background: var(--warn); } .health-row.bad .dot { background: var(--bad); }
.health-row.bad { background: var(--bad-tint); } .health-row.warn { background: var(--warn-tint); }
.health-row .title { font-weight: 600; } .health-row .detail { color: var(--ink-2); font-size: 0.76rem; margin-top: 2px; }
details.records summary { cursor: pointer; font-weight: 600; font-size: 1rem; margin-bottom: var(--space-md); }
details.records summary .hint { font-weight: 400; margin-left: var(--space-sm); }
.trend-table tr.pending td { color: var(--ink-3); }

/* ---------- webinar ad breakdown (drawer) ---------- */
/* True CPL per-day table: same look as the breakdown (day -> campaign -> ad set -> ad) */
table.tcpl-table tr[data-key] { cursor: pointer; }
table.tcpl-table td.name { white-space: normal; min-width: 260px; font-family: var(--sans); }
table.tcpl-table tr.tc-day td.name { font-weight: 600; }
table.tcpl-table tr.tc-campaign td { font-weight: 600; background: var(--bg-inset); }
table.tcpl-table tr.tc-campaign td.name { padding-left: 34px; }
table.tcpl-table tr.tc-adset td.name { padding-left: 56px; }
table.tcpl-table tr.tc-ad td.name { padding-left: 78px; color: var(--ink-2); }
table.tcpl-table tr.bd-paused td { color: var(--ink-3); }
table.tcpl-table tr.tc-muted td, table.tcpl-table tr.tc-note td { color: var(--ink-3); }
table.tcpl-table tr.tc-note td.name { padding-left: 34px; }
table.tcpl-table tfoot tr.tc-total td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
table.tcpl-table .bd-caret { display: inline-block; width: 14px; color: var(--ink-3); }
table.tcpl-table .ad-thumb { margin-right: 8px; vertical-align: middle; width: 28px; height: 28px; }
button.date-open { all: unset; cursor: pointer; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
button.date-open:hover, button.date-open:focus-visible { text-decoration-color: var(--blue); color: var(--ink); }
table.breakdown tr.bd-campaign td { font-weight: 600; background: var(--bg-inset); }
table.breakdown tr.bd-campaign, table.breakdown tr.bd-adset { cursor: pointer; }
table.breakdown tr.bd-adset td.name { padding-left: 22px; }
table.breakdown tr.bd-ad td.name { padding-left: 44px; color: var(--ink-2); }
table.breakdown tr.bd-paused td { color: var(--ink-3); }
table.breakdown td.name { white-space: normal; min-width: 260px; }
table.breakdown .bd-caret { display: inline-block; width: 14px; color: var(--ink-3); }
table.breakdown .ad-thumb { margin-right: 8px; vertical-align: middle; }
table.breakdown .ad-thumb { width: 28px; height: 28px; }

.bd-funnels { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); }
.bd-funnel { font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.bd-funnel.on { border-color: var(--blue); color: var(--ink); }
#truecpl-days { margin-bottom: var(--space-lg, 24px); }

/* ---------- organic content (static/organic.js): the tracker's three tabs on this theme ----------
   .impeccable.md: colour is signal, not decoration. Each content source has its own step of the brand blue,
   deep to pale (dataviz ordinal check passes on the page surface: one hue, >= 0.06 lightness apart);
   other sources are the theme's neutrals. Green/amber stay reserved for judgement (badges). */
:root { --org-threads: oklch(0.50 0.17 256); --org-ig: var(--blue); --org-story: oklch(0.80 0.10 256);
        --org-click: oklch(0.93 0.035 256); --org-dm: var(--ink-2); --org-other: var(--ink-3); }
.org-sub-tabs { display: flex; align-items: center; gap: var(--space-xs); border-bottom: 1px solid var(--line); margin-bottom: var(--space-xl); flex-wrap: wrap; }
.org-sub-tabs .push { margin-left: auto; }
.org-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 1px; margin-right: 6px; vertical-align: 1px; }
.org-chip { font-family: var(--sans); white-space: nowrap; }
/* metric boxes and source cards: the repo's .kpi component (True CPL tab), laid out in a row */
.org-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-2xl); }
.org-kpis .kpi .sub { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); margin-top: 2px; }
.org-kpis .kpi.lead .val { font-size: 1.9rem; font-weight: 600; }   /* the one number the page leads with */
#organic-root .status { margin-bottom: var(--space-xl); }
table.org-table td.l, table.org-table td.name { white-space: normal; }
table.org-table td .muted, table.org-table td .hint { font-family: var(--sans); font-size: 0.72rem; }
table.org-table tr.org-crow { cursor: pointer; }
table.org-table tr.org-crow:hover td { background: var(--bg-hover); }
table.org-table tr.org-detail td { background: var(--bg-inset); }
table.org-table tr.expanded .caret { display: inline-block; transform: rotate(90deg); }
table.org-table .caret { color: var(--ink-3); }
table.org-table th.org-mix-col { width: 40%; }
.org-mix { display: flex; gap: 2px; height: 10px; width: 100%; background: var(--bg-inset); border-radius: var(--radius); overflow: hidden; }   /* source mix */
.org-mix span { display: block; height: 100%; }
td.org-mix-cell { cursor: default; }
td.org-mix-cell:hover .org-mix span { opacity: 0.55; }
td.org-mix-cell:hover .org-mix span:hover { opacity: 1; }
.org-tip { position: fixed; z-index: 30; pointer-events: none; min-width: 220px; background: var(--bg-raise); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: var(--space-sm) var(--space-md); font-family: var(--sans); font-size: 0.75rem; color: var(--ink-2); }
.org-tip-head { color: var(--ink); margin-bottom: var(--space-xs); }
.org-tip-row { display: grid; grid-template-columns: 1fr auto 3.2em; gap: var(--space-md); align-items: center; padding: 1px 0; }
.org-tip-row .num { font-family: var(--mono); text-align: right; }
.org-tip-row.on { color: var(--ink); font-weight: 600; }
.org-tip-foot { margin-top: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--line); color: var(--ink-3); }
.org-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-xl); margin: var(--space-xs) 0; font-family: var(--sans); text-align: left; }
.org-dl dt { color: var(--ink-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.org-dl dd { margin: 0; font-family: var(--mono); color: var(--ink); }
.org-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-sm) var(--space-xl); text-align: left; font-family: var(--sans); }
.org-hist { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); margin-top: 2px; }
.org-hist.warn { color: var(--warn); }
.org-first { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }   /* first click under the last-click chip */
.org-first.warn { color: var(--warn); }
.org-h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: var(--space-xl) 0 var(--space-xs); }
.org-foot { margin-top: var(--space-2xl); max-width: none; }
.badge.warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 40%, transparent); }   /* same shape as .badge.active */
#organic-root .badge { font-family: var(--sans); vertical-align: 1px; }
.badge.taken { color: var(--blue); border-color: color-mix(in oklch, var(--blue) 40%, transparent); }   /* a call that happened, not closed */
.org-outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--sans); font-size: 0.72rem; margin-top: 3px; }
td > .org-outcome:first-child { margin-top: 0; }   /* alone in a status cell: no gap above */
/* Daily funnel: the content team's sheet; the Instagram columns stay faint until they are connected */
table.fun-table .fun-na { color: var(--ink-3); opacity: 0.55; }
table.fun-table thead th { white-space: normal; vertical-align: bottom; }   /* two-line headers, as in the sheet */
table.fun-table td.name { white-space: nowrap; }
table.fun-table tr.fun-groups th { text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
table.fun-table tr.fun-groups th:first-child { border-left: 0; }
table.fun-table tr.fun-total td { font-weight: 600; background: var(--bg-inset); }
#funnel-root .badge { font-family: var(--sans); vertical-align: 1px; }
/* Daily sign-ups: one bar per day */
.org-daychart { width: 100%; min-height: 200px; }
.org-daychart svg { display: block; overflow: visible; }
.org-daychart .bar { fill: var(--org-ig); }
.org-daychart svg.hovering .bar:not(.on) { opacity: 0.45; }
.org-daychart .grid { stroke: var(--line); stroke-width: 1; }
.org-daychart .axis { fill: var(--ink-3); font: 10px var(--mono); }
.org-daychart .mark { fill: var(--ink-2); }
.org-daychart .hit { fill: transparent; cursor: default; }
/* What happened after sign-up: three cards of counts with their share */
.org-after { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-md); }
.org-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); padding: var(--space-md) var(--space-lg); font-family: var(--sans); }
.org-card-head { display: flex; align-items: baseline; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); }
.org-card-head .lab { flex-basis: 100%; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.org-card-head .val { font-family: var(--mono); font-size: 1.35rem; font-weight: 500; }
.org-card-head .sub { font-size: 0.72rem; color: var(--ink-3); }
.org-card h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: var(--space-md) 0 var(--space-xs); }
.org-share { display: grid; gap: 6px; font-size: 0.8rem; }
.org-share-row { display: grid; grid-template-columns: 1fr auto 3.2em; gap: 2px var(--space-md); align-items: center; }
.org-share-row .num { font-family: var(--mono); text-align: right; }
.org-share-bar { grid-column: 1 / -1; height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; }
.org-share-bar i { display: block; height: 100%; background: var(--org-ig); border-radius: 2px; }
a.button-link { display: inline-block; padding: 6px 10px; line-height: 1.3; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); background: transparent;
  text-decoration: none; border: 1px solid var(--line-2); border-radius: var(--radius); }   /* a link that looks like button.ghost */
a.button-link:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--ink-3); }
.controls form { margin: 0; }

/* ---------- reminders tab ---------- */
.rm-controls { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; justify-content: flex-end; }
.rm-chips { display: flex; flex-wrap: nowrap; gap: var(--space-sm); }
.rm-chip { font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.rm-chip.on { border-color: var(--blue); color: var(--ink); }
.rm-delta { font-family: var(--mono); color: var(--ink-3); }
.rm-delta.up { color: var(--ink-2); } .rm-delta.down { color: var(--ink-2); }
#rm-tiles { margin-bottom: var(--space-xl); }

table.rm-compare { width: auto; min-width: min(720px, 100%); }
table.rm-compare td, table.rm-compare th { text-align: left; }
table.rm-compare td:first-child { font-family: var(--sans); color: var(--ink-2); }
.rm-bar { display: inline-block; width: 140px; height: 8px; background: var(--bg-inset); border-radius: 2px; vertical-align: middle; margin-right: var(--space-sm); overflow: hidden; }
.rm-bar > span { display: block; height: 100%; background: var(--blue); border-radius: 0 2px 2px 0; }
.rm-bar-val { display: inline-block; min-width: 3.2em; }
.rm-n { margin-left: var(--space-sm); font-size: 0.72rem; }

table.rm-heatmap { width: auto; border-collapse: separate; border-spacing: 2px; }
table.rm-heatmap thead th { font-size: 0.7rem; }
th.rm-heat-col { text-align: center; min-width: 56px; }
td.rm-heat { text-align: center; border: 0; border-radius: 2px; padding: 6px 8px; color: var(--ink-2); font-size: 0.75rem; }
td.rm-heat.strong { color: oklch(0.99 0 0); }
td.rm-heat.none { background: transparent; }
td.rm-heat.click { cursor: pointer; }
td.rm-heat.click:hover { outline: 1px solid var(--ink); }
td.rm-heat.unverified, .rm-swatch.unverified {
  background: repeating-linear-gradient(135deg, var(--bg-hover) 0 4px, var(--bg-inset) 4px 8px); color: var(--ink-3); font-family: var(--sans);
}
td.rm-heat-label { font-family: var(--sans); border: 0; padding-right: var(--space-lg); color: var(--ink); }
.rm-unverified-row td.rm-heat-label { color: var(--ink-3); }
.rm-sys { margin-left: var(--space-sm); font-size: 0.7rem; color: var(--ink-3); }
.rm-ch { display: inline-block; width: 7px; height: 7px; margin-right: var(--space-sm); border: 1px solid var(--ink-3); vertical-align: 1px; }
.rm-ch-email { border-radius: 50%; } .rm-ch-sms { border-radius: 1px; }
.rm-scale { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-md); font-size: 0.72rem; color: var(--ink-3); }
.rm-scale-bar { width: 140px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, color-mix(in oklch, var(--blue) 12%, var(--bg-inset)), color-mix(in oklch, var(--blue) 82%, var(--bg-inset))); }
.rm-swatch { display: inline-block; width: 18px; height: 10px; border-radius: 2px; margin-left: var(--space-md); }

.rm-filters { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-md); }
.rm-filters label { display: flex; align-items: center; gap: var(--space-sm); }
.rm-check input { width: auto; }
.rm-legend { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin-bottom: var(--space-md); font-size: 0.75rem; color: var(--ink-2); }
.rm-leg { display: inline-flex; align-items: center; gap: 6px; }

.rm-lanes { border-top: 1px solid var(--line); }
.rm-lane { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(320px, 640px) 220px; align-items: center; gap: var(--space-md);
  padding: 3px var(--space-sm); border-bottom: 1px solid var(--line); cursor: pointer; }
.rm-lane:hover, .rm-lane:focus-visible { background: var(--bg-hover); outline: none; }
.rm-lane.rm-axis { cursor: default; position: sticky; top: var(--rm-sticky, 64px); z-index: 2; background: var(--bg); }
.rm-lane.rm-axis:hover { background: var(--bg); }
.rm-lane.missing .rm-lane-cov { color: var(--warn); }
.rm-lane-who { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-sm); min-width: 0; font-size: 0.75rem; }
.rm-lane-time { font-family: var(--mono); color: var(--ink-2); }
.rm-lane-lead { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-lane-meta { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-lane-svg { width: 100%; height: auto; aspect-ratio: 640 / 26; overflow: visible; display: block; }
.rm-lane-note { font-size: 0.72rem; color: var(--ink-3); }
.rm-lane-svg text { fill: var(--ink-3); font: 10px var(--mono); }
.rm-lane-end { display: flex; align-items: center; gap: var(--space-md); font-size: 0.75rem; }
.rm-lane-cov { font-family: var(--mono); color: var(--ink-2); min-width: 3em; text-align: right; }
.rm-when { text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; cursor: help; }

.rm-track { stroke: var(--line-2); stroke-width: 1; }
.rm-book { stroke: var(--ink-2); stroke-width: 2; }
.rm-call { stroke: var(--ink); stroke-width: 2; }
.rm-grid { stroke: var(--line-2); }
.rm-m { vector-effect: non-scaling-stroke; }
.rm-m.sent { fill: var(--ink); stroke: var(--bg); stroke-width: 1; }
.rm-m.not_sent { fill: var(--bg); stroke: var(--warn); stroke-width: 1.5; }
.rm-m.pending { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 2 1.5; }
.rm-m.tool_unverified { fill: url(#rm-stripe); stroke: var(--ink-3); stroke-width: 1; }
.rm-m.cross { stroke: var(--bad); stroke-width: 2; stroke-linecap: round; fill: none; }
.rm-m.ring { fill: none; stroke: var(--blue); stroke-width: 1.5; }
.rm-m.reply { fill: var(--good); stroke: none; }
.rm-m.extra { stroke: var(--ink-3); stroke-width: 1.5; opacity: 0.7; }

.rm-outcome { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); font-size: 0.7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.rm-outcome.good { color: var(--good); border-color: color-mix(in oklch, var(--good) 45%, transparent); }
.rm-outcome.bad { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 45%, transparent); }
.rm-status { font-family: var(--sans); }
.rm-status.not_sent { color: var(--warn); } .rm-status.error, .rm-status.bounced { color: var(--bad); }
.rm-status.tool_unverified, .rm-status.pending, .rm-status.extra { color: var(--ink-3); }
.drawer-body td.l, .drawer-body th { text-align: left; }
.rm-tmpl { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); color: var(--ink-3); }
#drawer tr.rm-row { cursor: pointer; }
#drawer tr.rm-row:hover { background: var(--bg-hover); }

.rm-tip { position: fixed; z-index: 60; max-width: 440px; white-space: pre-line; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg-raise); color: var(--ink); font-size: 0.75rem; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 24px oklch(0 0 0 / 0.4); }

@media (max-width: 900px) {
  .tab-pane[data-tab="reminders"] .sec-head.split { grid-template-columns: 1fr; row-gap: var(--space-md); }
  .rm-controls { justify-content: flex-start; }
  .tab-pane[data-tab="reminders"] select { max-width: 62vw; }
  .sec-head.split > .rm-chips { align-self: start; }
  .rm-lane { grid-template-columns: 1fr; gap: 2px; }
  .rm-lane.rm-axis .rm-lane-who, .rm-lane.rm-axis .rm-lane-end { display: none; }
  .rm-bar { width: 80px; }
}
.rm-defs { position: absolute; width: 0; height: 0; }
.rm-stripe-a { fill: var(--bg-hover); } .rm-stripe-b { stroke: var(--ink-3); stroke-width: 1.2; }
.sec-head.split > .rm-chips { display: flex; align-self: end; }
.rm-impact { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--space-xl) var(--space-2xl); }
.rm-impact h3 { margin-bottom: var(--space-sm); }
.rm-impact table { width: 100%; }
.rm-impact td, .rm-impact th { text-align: left; }
.rm-impact td:first-child { font-family: var(--sans); color: var(--ink-2); }
td.rm-cov { text-align: center; color: var(--ink-2); border-radius: 2px; border-bottom-color: var(--bg); }
td.rm-cov.strong { color: oklch(0.99 0 0); }
.rm-impact .rm-foot { font-size: 0.72rem; color: var(--ink-3); margin-top: var(--space-sm); }
.rm-impact > div { min-width: 0; overflow-x: auto; }
.rm-impact .rm-bar { width: 96px; }
.rm-impact td.rm-closer { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.rm-impact .rm-n { margin-left: var(--space-xs); }
.rm-sync { display: flex; align-items: center; gap: var(--space-sm); }
.tab-pane[data-tab="reminders"].rm-is-empty > section:not(#rm-main):not(#mon-section),
.tab-pane[data-tab="reminders"].rm-is-empty #rm-tiles,
.tab-pane[data-tab="reminders"].rm-is-empty #rm-compare,
.tab-pane[data-tab="reminders"].rm-is-empty h3,
.tab-pane[data-tab="reminders"].rm-is-empty .picker,
.tab-pane[data-tab="reminders"].rm-is-empty #rm-sources { display: none; }
.rm-empty { max-width: 72ch; text-align: left; }
.rm-empty p + p { margin-top: var(--space-sm); }
.rm-has-tpl { cursor: help; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; }

/* Reminders tab: daily checks (zth/reminders/monitor.py) */
.mon-sum { margin: 0 0 8px; }
.mon-fine { margin-top: 8px; }
.mon-fine > summary { cursor: pointer; color: var(--ink-2); }
.mon-list { list-style: none; margin: 0; padding: 0; }
.mon-row { display: grid; grid-template-columns: 8.5rem minmax(12rem, 22rem) 1fr auto; gap: 4px 12px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.mon-row details { grid-column: 2 / -1; font-size: 0.85rem; }
.mon-row details ul { margin: 4px 0 0; padding-left: 1.1rem; }
.mon-row details li { margin: 2px 0; }
.mon-label { font-weight: 600; }
.mon-text { color: var(--ink-2); }
.mon-task { white-space: nowrap; font-size: 0.85rem; }
.badge.mon-error { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 40%, transparent); }
.badge.mon-warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 40%, transparent); }
.badge.mon-ok { color: var(--good); border-color: color-mix(in oklch, var(--good) 40%, transparent); }
.badge.mon-skipped { color: var(--ink-3); border-color: var(--line-2); }
@media (max-width: 720px) { .mon-row { grid-template-columns: 1fr; } .mon-row details { grid-column: 1; } }
