/* Adminer Campaign OS — screens (plain CSS, no framework). */
/* Trapper brand (decision 204, following the team's pacing-tracker artifact): ink #1F2733, red #F00417, cool greys, Mulish. */
:root {
  --bg: #f5f5f5; --fg: #333333; --muted: #6b7280; --faint: #8b8587; --card: #ffffff; --line: #dcdee1; --line2: #e3e4e6; --soft: #eef0f2; --raised: #fafafb;
  --accent: #e30613; --accent-fg: #ffffff; --ink: #333333; --ink-fg: #ffffff; --heading: #5f6062; --accent-bg: #fdecee; --accent-line: #f5b5bb;
  --ok: #2e7d32; --ok-bg: #e8f3e8; --warn-bg: #fbf3dc; --warn-fg: #8a6100; --warn-line: #e0c27a;
  --bad-bg: #fdecee; --bad-fg: #c8102e; --bad-line: #f3b6c0; --info-bg: #eaf0f8; --info-fg: #334e7a; --focus: #2563eb; --focus-ring: rgba(37,99,235,.2);
  /* Tracker table sections: header colour and the light tint under it. */
  --sec-general: #333333; --sec-pacing: #1d4e89; --sec-performance: #0e6b5b; --sec-notes: #575153; --sec-fg: #ffffff;
  --tint-general: #ffffff; --tint-pacing: #f5f8fd; --tint-performance: #f3faf8; --tint-notes: #f9f8f7;
  --font: "Mulish", "Proxima Nova", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --fg: #e6e9ee; --muted: #a3abb7; --faint: #8f98a4; --card: #1a2029; --line: #2e3742; --line2: #28303a; --soft: #232a34; --raised: #20272f;
    --accent: #ff4d58; --ink: #e6e9ee; --ink-fg: #12161d; --heading: #c9ccd2; --accent-bg: #3a1c20; --accent-line: #6b2531;
    --ok: #7ccf7f; --ok-bg: #1c2d1d; --warn-bg: #2f2913; --warn-fg: #e8c25c; --warn-line: #5c4a1a;
    --bad-bg: #3a1c20; --bad-fg: #ff7a85; --bad-line: #6b2531; --info-bg: #1d2939; --info-fg: #9fb8dc; --focus: #7aa7ff; --focus-ring: rgba(122,167,255,.25);
    --sec-general: #0d1117; --sec-pacing: #1a3e6b; --sec-performance: #0c4f44; --sec-notes: #3f3a3c; --sec-fg: #e6e9ee;
    --tint-general: #1a2029; --tint-pacing: #1a2230; --tint-performance: #18252a; --tint-notes: #1f1f24;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
header.top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
header.top nav { display: flex; gap: 4px; flex: 1; }
header.top nav a { text-decoration: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); }
header.top nav a.on, header.top nav a:hover { background: var(--soft); color: var(--fg); }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.env { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.env.staging, .env.local { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
main { max-width: 1180px; margin: 22px auto 60px; padding: 0 16px; }
h2 { font-size: 20px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
button, .btn { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--soft); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.link { border: none; background: none; padding: 0 4px; color: var(--focus); text-decoration: underline; }
button.danger { color: var(--bad-fg); border-color: var(--bad-line); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--fg); min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.f > input, label.f > select { font-size: 14px; color: var(--fg); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.req::after { content: " *"; color: var(--accent); }
dl.fields { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; margin: 0; }
dl.fields > dt, dl.fields > dd { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.fields > dt { color: var(--muted); font-size: 13px; padding-right: 10px; }
dl.fields > dd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 34px; }
dl.fields > dd .val { flex: 1; min-width: 90px; overflow-wrap: anywhere; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.sugg { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.badge.applied { background: var(--soft); }
.badge.scheduled { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bg); }
.badge.blocked { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.note { border-radius: 8px; padding: 8px 12px; margin: 8px 0; border: 1px solid; }
.note.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.note.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.note.info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bg); }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.problem { color: var(--bad-fg); font-size: 12px; }
td.has-problem { background: var(--bad-bg); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 12px; border: 1px solid var(--line); max-width: 560px; width: 100%; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.diff { width: 100%; margin-top: 6px; }
.diff td { padding: 5px 6px; }
.diff .old { color: var(--muted); text-decoration: line-through; }
.diff .new { font-weight: 600; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); }
details summary { cursor: pointer; font-weight: 600; }
.right { margin-left: auto; }
@media (max-width: 640px) {
  header.top { flex-wrap: wrap; }
  dl.fields { grid-template-columns: 1fr; }
  dl.fields > dt { border-bottom: none; padding-bottom: 0; }
}

/* ---- tracker (main screen): advertiser tabs, attention chips, wide grid with sticky header and campaign columns, drawer */
main:has(.tablebox) { max-width: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.chip small { color: var(--muted); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.on small { color: inherit; opacity: .8; }
.chip.attn { border-radius: 6px; }
.chip.attn.red b { color: var(--bad-fg); }
.chip.attn.amber b { color: var(--warn-fg); }
.chip.attn.good b { color: var(--ok); }
.badge.good { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bg); }
.chip.attn.on b { color: inherit; }
.tablebox { overflow: auto; max-height: calc(100vh - 230px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.grid th, .grid td { background: var(--card); white-space: nowrap; padding: 6px 10px; }
.grid thead th { position: sticky; z-index: 2; background: var(--soft); color: var(--fg); }
.grid thead tr.grp th { top: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); height: 26px; }
.grid thead tr:first-child th { top: 0; }
.grid thead tr.grp + tr th { top: 26px; }
.grid .s1 { position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 150px; white-space: normal; }
.grid .s2 { position: sticky; left: 150px; z-index: 1; min-width: 300px; max-width: 300px; white-space: normal; box-shadow: 2px 0 0 var(--line); }
.grid thead .s1, .grid thead .s2 { z-index: 3; }
.grid td.name a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.grid td.name a:hover { text-decoration: underline; }
.grid td .sub { display: block; font-size: 11px; color: var(--muted); }
.grid tbody tr:hover td, .grid tbody tr.sel td { background: var(--soft); }
.grid td .badge { margin-right: 4px; }
.pill { display: inline-block; border-radius: 999px; padding: 0 8px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); width: min(760px, 100vw); height: 100%; overflow: auto; padding: 14px 18px 40px; box-shadow: -8px 0 30px rgba(0,0,0,.2); }
.drawer-head { position: sticky; top: -14px; background: var(--bg); padding: 8px 0; z-index: 2; margin-bottom: 6px; }
.drawer .grid2 { grid-template-columns: 1fr; }
@media (max-width: 640px) { .grid .s1 { position: static; } .grid .s2 { left: 0; min-width: 220px; max-width: 220px; } }

/* ---- tracker v2 (decision 199): date range, tick-box filters, cells edited in place, budget mismatch */
.range { gap: 6px; }
.range select { min-width: 170px; }
.chips-title { font-size: 12px; font-weight: 600; color: var(--muted); align-self: center; margin-right: 4px; }
.filters { margin-bottom: 10px; gap: 6px; }
details.ms { position: relative; }
details.ms > summary { list-style: none; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; font-size: 13px; }
details.ms > summary::-webkit-details-marker { display: none; }
details.ms > summary::after { content: "▾"; margin-left: 6px; color: var(--muted); }
details.ms.on > summary { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
details.ms .menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); display: grid; gap: 2px; }
details.ms .menu label { display: flex; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; }
details.ms .menu label:hover { background: var(--soft); }
details.ms .mhead { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cell-edit { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; background: none; padding: 2px 5px; margin: -3px -6px; border-radius: 5px; text-align: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.cell-edit .ico { font-size: 11px; opacity: .35; }
.cell-edit:hover, .cell-edit:focus-visible { background: var(--card); border-color: var(--line); }
.cell-edit:hover .ico, .cell-edit:focus-visible .ico { opacity: 1; }
.cell-edit.wide { max-width: 240px; white-space: normal; text-align: left; }
.cell-edit.empty { color: var(--muted); font-style: italic; }
.cell-select { font: inherit; font-size: 13px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 2px 2px; margin: -3px -3px; max-width: 170px; cursor: pointer; }
.cell-select:hover, .cell-select:focus { background: var(--card); border-color: var(--line); }
.cell-editing { display: inline-flex; gap: 4px; align-items: center; }
.cell-input { min-width: 110px; font-size: 13px; padding: 2px 4px; }
button.mini { padding: 1px 7px; font-size: 12px; line-height: 1.5; }
details.ms .mfoot { display: flex; justify-content: flex-end; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); }
.chip.attn.zero { opacity: .55; cursor: default; }
.flaglist { display: flex; flex-wrap: wrap; gap: 4px; }
.grid td.bad-cell { background: var(--bad-bg); color: var(--bad-fg); font-weight: 600; }
.grid td.bad-cell .sub { color: var(--bad-fg); }
.ok-text { color: var(--ok) !important; }
button.badge.flag { cursor: pointer; font: inherit; font-size: 11px; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 12px; }
.feeex { display: grid; gap: 4px; padding: 2px 0 8px; }

/* Tracker: spacing between the advertiser row, Needs attention and the filters (decision 203). */
.toprow { align-items: center; margin-bottom: 14px; gap: 12px; }
.toprow + div .chips, .toprow + div + div .chips { margin-bottom: 12px; }
/* Column picker. */
.colsec { margin-top: 12px; }
.colsec-title { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 5px; margin-bottom: 6px; }
.cols2.more { margin-top: 4px; }
/* Close (×) in every pop-up. */
.modal { position: relative; }
.modal-x { position: absolute; top: 10px; right: 10px; border: none; background: none; font-size: 22px; line-height: 1; padding: 2px 8px; color: var(--muted); border-radius: 6px; }
.modal-x:hover { background: var(--soft); color: var(--fg); }
.modal h3 { padding-right: 32px; }
/* A section's name stays readable while its first columns are under the frozen ones. */
.grid thead tr.grp th:not(.s12) span { position: sticky; left: 462px; }
@media (max-width: 640px) { .grid thead tr.grp th:not(.s12) span { left: 232px; } .grid thead tr.grp th.s12 { position: static; } }

/* ---- Brand look (decision 204): type, header, buttons, chips, filters, the table, pop-ups and drawer ---- */
body { font: 13px/1.45 var(--font); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
header.top { border-bottom: 3px solid var(--accent); min-height: 64px; padding: 10px 20px; gap: 22px; }
header.top .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
header.top .brand img { height: 34px; width: auto; display: block; }
header.top .brand b { font-size: 18px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
@media (prefers-color-scheme: dark) { header.top .brand img { background: #ffffff; border-radius: 6px; padding: 3px 6px; } }
header.top nav a { font-weight: 700; padding: 7px 12px; }
header.top nav a.on { background: var(--ink); color: var(--ink-fg); }
header.top nav a:not(.on):hover { background: var(--soft); }
.who { font-size: 12px; }
main { margin: 18px auto 60px; padding: 0 20px; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 14px; font-weight: 800; }
.card { border-radius: 8px; }
button, .btn { font-weight: 600; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.ink { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }
button.link { font-weight: 600; }
input, select, textarea { border-radius: 5px; padding: 6px 8px; }
.badge { font-weight: 700; }
th { font-weight: 700; }
/* Advertiser tabs and Needs attention. */
.chip { font-weight: 600; padding: 5px 12px; }
.chip small { font-weight: 500; margin-left: 2px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }
.chip.attn { padding: 6px 10px; display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.chip.attn b { font-size: 16px; font-weight: 800; }
.chip.attn.on { box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.chip.attn.on b { color: inherit; }
.chips { gap: 8px; }
.chips-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-right: 6px; min-width: 112px; }
details.ms > summary { padding: 6px 10px; font-weight: 600; }
details.ms .mhead button { color: var(--accent); font-weight: 700; text-decoration: none; }
/* The table: dark header, one colour per section, light tint under each section. */
.tablebox { border-radius: 8px; }
.grid th, .grid td { border-bottom: 1px solid var(--line2); padding: 7px 10px; }
.grid thead th { background: var(--sec-general); color: var(--sec-fg); font-size: 12px; font-weight: 700; }
.grid thead tr.grp th { font-size: 10.5px; letter-spacing: .09em; font-weight: 700; color: var(--sec-fg); border-right: 1px solid rgba(255,255,255,.12); }
.grid thead th.sec-pacing { background: var(--sec-pacing); }
.grid thead th.sec-performance { background: var(--sec-performance); }
.grid thead th.sec-notes { background: var(--sec-notes); }
.grid thead tr.grp th.sec-pacing, .grid thead tr.grp th.sec-performance, .grid thead tr.grp th.sec-notes { box-shadow: inset 0 4px 0 rgba(255,255,255,.3); }
.grid tbody td.sec-pacing { background: var(--tint-pacing); }
.grid tbody td.sec-performance { background: var(--tint-performance); }
.grid tbody td.sec-notes { background: var(--tint-notes); }
.grid .sec-start { border-left: 3px solid var(--sec-c, var(--line)); }
.grid .sec-pacing.sec-start { --sec-c: var(--sec-pacing); }
.grid .sec-performance.sec-start { --sec-c: var(--sec-performance); }
.grid .sec-notes.sec-start { --sec-c: var(--sec-notes); }
.grid tbody tr:hover td, .grid tbody tr.sel td { background: var(--raised); }
.grid td.name a { font-weight: 700; color: var(--fg); }
.grid td.bad-cell { background: var(--bad-bg) !important; color: var(--bad-fg); font-weight: 700; }
.pill { font-size: 11px; font-weight: 700; padding: 1px 8px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
/* Column picker headings use the section colours. */
.colsec-title { color: var(--sec-fg); background: var(--sec-general); }
.colsec-title.sec-pacing { background: var(--sec-pacing); }
.colsec-title.sec-performance { background: var(--sec-performance); }
.colsec-title.sec-notes { background: var(--sec-notes); }
/* Pop-ups and the drawer. */
.modal-bg { background: rgba(15,20,27,.45); }
.modal { border: none; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.drawer { background: var(--bg); }
.drawer .card { background: var(--card); }
/* The section cell over the two frozen columns stays put when scrolling sideways (it was lost in decision 204). */
.grid thead tr.grp th.s12 { position: sticky; left: 0; z-index: 8; }
.grid thead .s1, .grid thead .s2 { z-index: 7; }

/* ---- Design system (decision 205): Adminer logo; Trapper deck headings, labels, cards, steps; same on every screen ---- */
header.top .brand { gap: 12px; }
header.top .brand img { height: 18px; }
header.top .brand .brand-sep { width: 1px; height: 22px; background: var(--line); }
header.top .brand b { font-size: 16px; font-weight: 800; color: var(--fg); }
@media (prefers-color-scheme: dark) { header.top .brand img { background: none; padding: 0; } }
header.top nav { gap: 2px; align-self: stretch; align-items: stretch; margin-left: 10px; }
header.top nav a { display: flex; align-items: center; border-radius: 0; padding: 0 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -13px; font-weight: 700; letter-spacing: .02em; }
header.top nav a.on { background: none; color: var(--accent); border-bottom-color: var(--accent); }
header.top nav a:not(.on):hover { background: none; color: var(--fg); }
header.top { border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
main { max-width: 1240px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--card); color: var(--faint); font-size: 11px; }
/* Page heading: grey title, red subtitle. */
.phead { margin: 4px 0 18px; }
.phead .crumbs { margin-bottom: 6px; }
.phead-row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.phead-text { min-width: 0; flex: 1 1 360px; }
.phead h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; color: var(--heading); letter-spacing: -.005em; overflow-wrap: anywhere; }
.phead .lede { margin: 6px 0 0; color: var(--accent); font-weight: 700; font-size: 13.5px; }
.phead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12px; font-weight: 600; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
/* Small spaced labels. */
.eyebrow { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.card > h3, .drawer .card > h3 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.card-title { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; margin-top: 2px; }
/* Cards. */
.card { border-radius: 6px; border-color: var(--line); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.hl { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.card-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.card.flush .empty { padding: 26px 18px; }
/* Headline figures. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.stat-v { font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 4px; color: var(--fg); overflow-wrap: anywhere; }
.stat.red { border-color: var(--accent-line); background: var(--accent-bg); }
.stat.red .stat-v, .stat.red .eyebrow { color: var(--accent); }
/* Highlight box (red outline), e.g. uploads waiting. */
.callout { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 6px; color: var(--accent); text-decoration: none; }
.callout b { color: var(--fg); }
.callout span { font-weight: 700; }
/* Lists: small spaced header labels, quiet rows. */
table.list th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--muted); padding: 10px 18px; background: var(--raised); border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 18px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: none; }
table.list tfoot td { font-weight: 800; background: var(--raised); border-top: 1px solid var(--line); border-bottom: none; }
table.list a { text-decoration: none; }
a.strong, table.list a { font-weight: 700; color: var(--fg); }
table.list tr.click:hover td { background: var(--accent-bg); }
table.list tr.click:hover a { color: var(--accent); }
td.mono { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
/* Status tags. */
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag.info { background: var(--info-bg); color: var(--info-fg); }
/* Numbered steps (Uploads), like the deck's step slides. */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; counter-reset: step; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px 16px 14px; }
.step p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; margin-bottom: 8px; }
.step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 18px; color: var(--accent-line); font-weight: 800; }
/* Field lists and notes in the same voice. */
dl.fields > dt { font-weight: 600; }
.note { border-radius: 6px; }
.note.info { border-color: var(--info-bg); }
/* Buttons: outline by default, red primary, red link. */
button, .btn { border-color: var(--line); }
button:hover, .btn:hover { border-color: var(--fg); background: var(--card); }
button.primary:hover, .btn.primary:hover { border-color: var(--accent); filter: brightness(1.06); background: var(--accent); }
button.link { color: var(--accent); text-decoration: none; }
button.link:hover { text-decoration: underline; border-color: transparent; background: none; }
.modal h3 { font-size: 18px; font-weight: 800; color: var(--heading); }
.modal-x, .modal-x:hover { border-color: transparent; }
@media (max-width: 640px) { .phead h1 { font-size: 22px; } header.top nav a { padding: 0 8px; margin-bottom: 0; } .step::after { display: none; } }
/* The footer sits at the bottom of short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
/* Every card heading and every table header inside cards and the drawer use the small spaced labels. */
.card h3 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.card table:not(.grid) thead th, .drawer table:not(.grid) thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); }
.card table:not(.grid) tbody th { font-weight: 600; color: var(--muted); font-size: 13px; }

/* ---- Decision 207: header sizes on one line, back buttons, TBC, campaign statuses, form alignment ---- */
header.top { height: 64px; min-height: 64px; padding: 0 20px; align-items: stretch; }
header.top .brand, header.top .who, header.top .env { align-self: center; }
header.top .brand img { height: 20px; }
header.top .brand b { font-size: 20px; line-height: 1; }
header.top nav { align-self: stretch; margin-left: 18px; }
header.top nav a { font-size: 15px; margin-bottom: 0; padding: 0 16px; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
header.top nav a.on { border-bottom-color: var(--accent); }
.backbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.btn.back { padding: 5px 11px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.btn.back:hover { color: var(--fg); }
.tbc { color: var(--accent); font-weight: 800; background: var(--accent-bg); border-radius: 4px; padding: 0 4px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.callout.static { flex-wrap: wrap; cursor: default; }
.callout.static span { font-weight: 500; color: var(--fg); }
details.recent > summary { list-style: none; cursor: pointer; border-bottom: none; }
details.recent > summary::-webkit-details-marker { display: none; }
details.recent[open] > summary { border-bottom: 1px solid var(--line); }
details.recent[open] > summary .small::after { content: ""; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
/* Form labels stay on one line so every input in a row lines up. */
.form { align-items: end; }
.form > label.f > span, .form > .f > label.f > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid2.cols { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
@media (max-width: 900px) { .grid2.cols { grid-template-columns: 1fr; } }
.stat-v .tags { margin-top: 8px; } .stat-v .tag { font-size: 12px; }

/* ---- Decision 208: main button pair, tidy forms, uploads list ---- */
.actpair { display: grid; gap: 6px; justify-items: end; }
.actbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actbtns > button, .actbtns > .upl > button { width: 100%; }
.actbtns .upl { display: block; }
button.big { min-width: 168px; height: 42px; font-size: 14px; font-weight: 700; padding: 0 18px; }
.tpl-link { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; width: calc(50% - 5px); text-align: center; }
.tpl-link:hover { color: var(--accent); }
.modal.form-modal { max-width: 620px; padding: 22px 24px; }
.modal.form-modal.wide { max-width: 860px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin: 14px 0 6px; align-items: start; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld-l { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); height: 18px; white-space: nowrap; }
.fld > input, .fld > select { width: 100%; height: 40px; font-size: 14px; color: var(--fg); }
.fld-x { display: inline-flex; gap: 5px; align-items: center; font-weight: 600; color: var(--muted); cursor: pointer; }
.fld-x input { margin: 0; }
details.more { margin-top: 10px; }
details.more > summary { font-size: 13px; color: var(--muted); }
.small-btn { padding: 3px 10px; font-size: 12px; }
a.dl { color: var(--fg); }
a.dl:hover { color: var(--accent); }
@media (max-width: 640px) { .fgrid, .fgrid.three { grid-template-columns: 1fr; } .actpair { justify-items: stretch; } .tpl-link { width: 50%; justify-self: end; } }
.phead-row { align-items: flex-start; } .phead-text { padding-top: 4px; }

/* ---- Decision 209: buttons in the same place, delete, search, recent uploads arrow ---- */
.phead-text .backbar { margin: 0 0 10px; }
.phead-actions { align-self: flex-start; }
.danger-zone { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line2); }
button.danger { color: var(--bad-fg); border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad-fg); }
button.danger.solid { background: var(--bad-fg); border-color: var(--bad-fg); color: #fff; }
button.danger.solid:hover { filter: brightness(1.08); background: var(--bad-fg); }
.danger-link { color: var(--bad-fg) !important; }
details.recent > summary .chev { display: inline-block; margin-right: 8px; transition: transform .15s; color: var(--accent); }
details.recent[open] > summary .chev { transform: rotate(90deg); }
.search-out { margin-top: 12px; max-height: 50vh; overflow: auto; }
.search-out table.list td, .search-out table.list th { padding: 8px 10px; }
.drawer .phead h1 { font-size: 24px; }

/* ---- Decision 210 ---- */
details.recent > summary .chev { font-size: 12px; line-height: 1; vertical-align: 1px; margin-right: 10px; }
details.recent > summary:hover .chev { color: color-mix(in srgb, var(--accent) 55%, transparent); }
.mono-id { font-variant-numeric: tabular-nums; letter-spacing: .04em; margin-top: 2px; }

/* Decision 211: the arrow on the label's line, in a lighter red. */
details.recent > summary .eyebrow { display: inline-flex; align-items: center; }
details.recent > summary .chev { font-size: 11px; line-height: 1; vertical-align: 0; margin-right: 10px; color: color-mix(in srgb, var(--accent) 60%, #ffffff); }
details.recent > summary:hover .chev { color: color-mix(in srgb, var(--accent) 35%, #ffffff); }
.card-note { margin: 12px 0 0; }



/* ---- Decision 214: the side-by-side header, a size smaller so about 5 sections fit ---- */
header.top { height: 56px; min-height: 56px; }
header.top .brand { gap: 10px; }
header.top .brand img { height: 16px; }
header.top .brand .brand-sep { height: 18px; }
header.top .brand b { font-size: 16px; }
header.top nav { margin-left: 10px; }
header.top nav a { font-size: 13.5px; padding: 0 12px; }

/* ---- Decision 216: setup checks in the drawer ---- */
table.setup td { vertical-align: top; }
table.setup tr.sc-fail td { background: var(--bad-bg); }
table.setup tr.sc-warn td { background: var(--warn-bg); }
.scm { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.scm.ok { background: var(--ok-bg); color: var(--ok); }
.scm.bad { background: var(--bad-fg); color: #fff; }
.scm.warn { background: var(--warn-fg); color: #fff; }
.scm.na { color: var(--faint); }

/* Upload review: new campaigns as one table (owner, 9 Nov) */
.draft-table-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 14px 18px 10px; }
.draft-table-head h3 { margin: 0; }
.draft-scroll { overflow: auto; max-height: 70vh; border-top: 1px solid var(--line); }
.draft-table { width: max-content; min-width: 100%; }
.draft-table th, .draft-table td { white-space: nowrap; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line2); }
.draft-table thead th { position: sticky; top: 0; background: var(--soft); z-index: 2; text-align: left; }
.draft-table .sticky-1 { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 34px; }
.draft-table .sticky-2 { position: sticky; left: 34px; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.draft-table thead .sticky-1, .draft-table thead .sticky-2 { background: var(--soft); z-index: 3; }
.draft-table .name-cell { white-space: normal; min-width: 260px; max-width: 360px; font-weight: 700; overflow-wrap: anywhere; }
.draft-table .notes-cell { white-space: normal; min-width: 220px; max-width: 320px; }
.draft-table tr.row-problem .sticky-1 { box-shadow: inset 3px 0 0 var(--bad-fg); }
.draft-table td.has-problem { white-space: normal; min-width: 160px; }
.draft-table .phase-row > td { background: var(--raised); white-space: normal; }
.phase-box { padding: 4px 0 8px 40px; max-width: 640px; }
.warn-text { color: var(--warn-fg); font-size: 12px; }
.bad-text { color: var(--bad-fg); font-weight: 700; }

/* Ad account approvals (decision 220): hard to miss */
#nav a { white-space: nowrap; }

/* Settings (back office): small side menu + section */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.settings-menu { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.settings-menu a, .settings-menu span { padding: 7px 10px; border-radius: 6px; text-decoration: none; color: inherit; }
.settings-menu a.on { background: var(--hl, rgba(0,0,0,.06)); font-weight: 700; }
.settings-body h2 { margin: 0 0 4px; font-size: 18px; }
#nav a.nav-settings { margin-left: 8px; opacity: .8; font-size: 13px; }
@media (max-width: 720px) { .settings { grid-template-columns: 1fr; } .settings-menu { flex-direction: row; flex-wrap: wrap; } }

/* Save / close buttons that appear when editing (owner, 9 Nov): easy to hit, still small */
button.tap { min-width: 32px; min-height: 32px; padding: 0 9px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.cell-editing { display: inline-flex; align-items: center; gap: 6px; }
.modal-x { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
/* Loading message while a plan file is read */
.busy-box { display: flex; align-items: center; gap: 14px; }
.busy-box .spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--soft, #ddd); border-top-color: var(--accent, #c8102e); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Thin loading bar at the top while data loads */
.busy-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent, #c8102e); z-index: 1000; opacity: 0; transition: opacity .2s; }
.busy-bar.on { opacity: 1; width: 100%; animation: busy 1.2s ease-in-out infinite; transform-origin: left; }
@keyframes busy { 0% { transform: scaleX(0); } 60% { transform: scaleX(.8); } 100% { transform: scaleX(1); opacity: .3; } }

/* Confirm pop-ups: long names wrap instead of running off the edge */
.diff { table-layout: fixed; }
.diff td { overflow-wrap: anywhere; vertical-align: top; }
.diff td:first-child { width: 24%; }
.diff td:nth-child(3) { width: 24px; text-align: center; }
.kv { width: 100%; table-layout: fixed; margin: 6px 0 4px; }
.kv td { padding: 5px 6px; vertical-align: top; overflow-wrap: anywhere; }
.kv td:first-child { width: 34%; }

/* Coloured health check cells (owner, 9 Nov): whole cell green or red, value in bold, status underneath */
td.pace-cell { text-align: right; line-height: 1.25; }
td.pace-cell b { display: block; font-size: 14px; }
td.pace-cell .sub { display: block; font-size: 11.5px; font-weight: 600; }
td.pace-cell.good { background: #d9f2dc; color: #1e6b2c; }
td.pace-cell.bad { background: #fbd5d8; color: #a4161a; }
@media (prefers-color-scheme: dark) { td.pace-cell.good { background: #1d3b24; color: #a7e3b3; } td.pace-cell.bad { background: #4a1d21; color: #f5b5bb; } }

/* Results a little worse than the KPI: amber (owner, 10 Nov) */
td.pace-cell.warn { background: #fdebc8; color: #8a5300; }
@media (prefers-color-scheme: dark) { td.pace-cell.warn { background: #43320f; color: #f3d28b; } }
/* Day by day: no column cut off; dates and costs on one line; a slightly wider drawer */
table.daybyday { width: 100%; }
table.daybyday th, table.daybyday td { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.drawer { width: min(920px, 100vw); }

/* Campaign page: buttons under the title */
.head-actions { margin: -8px 0 16px; gap: 8px; }
/* Tables inside cards scroll sideways instead of being cut off (HO% history, change history) */
.card { overflow-x: auto; }
details { overflow-x: auto; max-width: 100%; }
/* Flag panel buttons (owner, 10 Nov): Acknowledge blue, Copy teal; fixes stay red (primary) */
button.btn-ack { background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 700; }
button.btn-ack:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
button.btn-copy { background: #14a196; border-color: #14a196; color: #fff; font-weight: 700; }
button.btn-copy:hover { background: #0d9488; border-color: #0d9488; color: #fff; }
/* An acknowledged flag: still listed and counted, shown quieter */
.badge.flag.acked { opacity: .6; text-decoration: none; }
/* Date range beside Columns / Download Excel */
.filters .range { gap: 6px; }

/* More panel colours (owner, 10 Nov): Add a note violet, "go to" buttons indigo; every flag line on its own line */
button.btn-note { background: #8b5cf6; border-color: #8b5cf6; color: #fff; font-weight: 700; }
button.btn-note:hover { background: #7c3aed; border-color: #7c3aed; color: #fff; }
a.btn.btn-go { background: #f97316; border-color: #f97316; color: #fff; font-weight: 700; } /* orange: clearly apart from violet (note) and blue (acknowledge) */
a.btn.btn-go:hover { background: #ea580c; border-color: #ea580c; color: #fff; }
.flag-lines { white-space: pre-line; line-height: 1.6; }

/* Plan / Platform lines in flag panels */
.flag-lines { white-space: normal; }
.flag-lines > div { margin: 2px 0; }

/* "Go to" actions that are buttons (e.g. Add fee exception): same orange as the links */
button.btn-go { background: #f97316; border-color: #f97316; color: #fff; font-weight: 700; }
button.btn-go:hover { background: #ea580c; border-color: #ea580c; color: #fff; }

/* Fee exceptions inside the Platform card */
.sub-head { margin: 14px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.feeex-block { margin-bottom: 8px; }

/* ---- Decision 241: day-by-day totals, "Not linked yet", and the phone layout ---- */
table.daybyday tfoot td { font-weight: 800; border-top: 2px solid var(--line); background: var(--soft); }
.not-linked { padding: 6px 0 2px; }
.not-linked p { margin: 0 0 10px; }
.mlist { display: grid; gap: 10px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.mcard.sel { border-color: var(--accent); }
.mcard .mname { display: block; font-weight: 800; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; margin-bottom: 2px; }
.mfigs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px; }
.mfig span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mfig b { font-size: 14px; overflow-wrap: anywhere; }
.mflags .flaglist { display: flex; flex-wrap: wrap; gap: 6px; }
.tablebox.phone { max-height: none; overflow: visible; background: none; border: none; border-radius: 0; }
@media (max-width: 640px) {
  header.top { height: auto; min-height: 0; padding: 8px 12px 0; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
  header.top .brand { flex: 1; min-width: 0; }
  header.top .brand b { font-size: 16px; }
  header.top .who { display: none; }
  header.top nav { order: 3; flex: 0 0 100%; margin-left: 0; overflow-x: auto; }
  header.top nav a { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
  main { padding-left: 12px; padding-right: 12px; }
  .tracker-box .filters { gap: 6px; }
  .tracker-box .filters input[type=search] { min-width: 0 !important; flex: 1 1 100%; }
  .drawer { padding: 10px 12px 40px; }
}
/* Linking pop-up: fixed column widths so the name stays readable and the Link button stays in view */
.pc-list { table-layout: fixed; width: 100%; }
.pc-list th:nth-child(1) { width: 33%; } .pc-list th:nth-child(2) { width: 20%; } .pc-list th:nth-child(3) { width: 11%; }
.pc-list th:nth-child(4) { width: 11%; } .pc-list th:nth-child(5) { width: 16%; } .pc-list th:nth-child(6) { width: 9%; }
.pc-list td { overflow-wrap: anywhere; vertical-align: top; }
@media (max-width: 640px) { .pc-list { table-layout: auto; } }
@media (max-width: 640px) { header.top .brand img { height: 14px; } header.top .brand b { font-size: 15px; } header.top .brand .brand-sep { display: none; } header.top .env { font-size: 11px; padding: 1px 6px; } }

/* ---- Decision 242 ---- */
/* The filter lists are details too: they must not get the scrollbars meant for long history tables (the menu opened inside a tiny box). */
details.ms { overflow: visible; max-width: none; }
/* A pick list being edited never spills out of its card. */
select { max-width: 100%; }
dl.fields > dd select { flex: 1 1 100%; min-width: 0; }
/* "Campaign not started": neutral, not a warning. */
.badge.neutral { background: var(--soft); color: var(--muted); border-color: var(--line); }
.chip.attn.info b { color: var(--muted); }
/* Total row: stays at the bottom of the table while it scrolls. */
.grid tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--card); font-weight: 800; border-top: 2px solid var(--line); white-space: nowrap; }
.grid tfoot td.s1, .grid tfoot td.s2 { z-index: 4; }
/* Sections shrink to the screen instead of pushing it wider (phone: the campaign panel and Settings were wider than the screen). */
.grid2 > *, .settings-body { min-width: 0; }
.drawer .grid2 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .grid2.cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .settings { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: auto; }
  table.stack tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
  table.stack td { border: none; padding: 3px 0; overflow-wrap: anywhere; }
  table.stack td[data-label]:not(:empty)::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  table.stack td:empty { display: none; }
  .drawer h1, .drawer h2 { font-size: 20px; overflow-wrap: anywhere; }
}

/* ---- Decision 244: Settings tables tidy; a denser tracker page so more campaigns fit on a laptop ---- */
.cell-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; white-space: nowrap; }
.settings-body td { vertical-align: middle; }
@media (max-width: 640px) { .cell-row { flex-wrap: wrap; white-space: normal; } }
/* Tracker page (owner, 11 Nov): the earlier, roomier spacing; rows a little shorter and the table to the bottom of the
   window, so about 6 campaigns show on a laptop instead of 3. */
@media (min-width: 641px) {
  .grid th, .grid td { padding: 6px 10px; line-height: 1.35; }
  .grid .s2 { min-width: 380px; max-width: 380px; }
  .grid thead tr.grp th:not(.s12) span { left: 542px; }
  main:has(.tracker-box) { margin-bottom: 8px; }
  main:has(.tracker-box) + footer.foot { display: none; }
}
/* The label under a pacing or result figure had the page-subtitle bottom margin, which made every table row 18px taller. */
.grid td .sub, .mcard .sub { margin: 0; }

/* ---- Decision 246 ---- */
.review-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pick-update { font-weight: 700; white-space: nowrap; }
.badge.good { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
/* Tracker table: every row the same height (owner, 11 Nov). A campaign name shows two lines at most (the full name is in
   its tooltip and in the campaign panel); flags and notes stay on one line. */
@media (min-width: 641px) {
  .grid tbody td { height: 48px; padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }
  .grid td.name a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .grid td .flaglist { flex-wrap: nowrap; }
  .grid td .cell-edit.wide { max-width: 260px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
  /* A little less space above the table, so 5 to 6 campaigns show on a laptop. */
  .tracker-box .toprow { margin-bottom: 10px; }
  .toprow + div .chips, .toprow + div + div .chips, .tracker-box .chiprows .chips { margin-bottom: 8px; }
  .tracker-box .filters { margin-bottom: 8px; }
}

/* ---- Decision 247: a campaign that already exists stands out in the upload review ---- */
.draft-table tr.row-dup td { background: rgba(220, 38, 38, .10); }
.draft-table tr.row-dup td.sticky-1, .draft-table tr.row-dup td.sticky-2 { background: #fde8e8; } /* solid: these stay put while the row scrolls */
@media (prefers-color-scheme: dark) { .draft-table tr.row-dup td.sticky-1, .draft-table tr.row-dup td.sticky-2 { background: #45222a; } }
.draft-table tr.row-dup td:first-child { box-shadow: inset 4px 0 0 var(--bad-fg); }
.dup-list { margin: 6px 0 10px; padding-left: 18px; overflow-wrap: anywhere; font-weight: 700; }
/* A long campaign name inside a note wraps instead of pushing the panel wider (phone: the "name was typed in" note). */
.note, .note strong, .note b { overflow-wrap: anywhere; }
/* Decision 249: an already-linked platform campaign in the linking pop-up is pink, like a duplicate in an upload. */
.pc-list tr.row-dup td { background: rgba(220, 38, 38, .10); }
.pc-list tr.row-dup td:first-child { box-shadow: inset 4px 0 0 var(--bad-fg); }
.move-list { margin: 6px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.move-list li { margin-bottom: 4px; }
