/* ==========================================================================
   CAQ / BAR account dossier
   A reading document, not an instrument. Warm paper ground for a long
   morning read; the ROAS ramp is the semantic spine, so every figure in the
   document sits somewhere on the same scale from "destroyed value" to
   "cleared the bar". The 0.95x break-even line is a real decision boundary
   in this business, so the palette encodes it rather than decorating around it.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jbmono-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper:      oklch(0.976 0.007 85);
  --paper-deep: oklch(0.955 0.009 85);
  --panel:      oklch(0.995 0.004 85);
  --ink:        oklch(0.23 0.012 85);
  --ink-2:      oklch(0.38 0.012 85);
  --muted:      oklch(0.52 0.012 85);
  --faint:      oklch(0.66 0.010 85);
  --line:       oklch(0.885 0.008 85);
  --line-soft:  oklch(0.935 0.006 85);

  /* Interaction accent. Held outside the ROAS hue range on purpose, so a
     link never reads as a performance verdict. */
  --accent:     oklch(0.46 0.13 252);
  --accent-sub: oklch(0.93 0.03 252);

  /* The ROAS ramp. Six stops from value-destroying to target-clearing. */
  --r0: oklch(0.50 0.185 25);
  --r1: oklch(0.585 0.165 40);
  --r2: oklch(0.695 0.150 68);
  --r3: oklch(0.745 0.130 96);
  --r4: oklch(0.665 0.135 132);
  --r5: oklch(0.565 0.150 152);

  --shadow: 0 1px 2px oklch(0.23 0.012 85 / 0.05),
            0 4px 16px oklch(0.23 0.012 85 / 0.045);

  --rail: 15rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 71ch;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.83rem);
  --step-0:  clamp(0.98rem, 0.94rem + 0.18vw, 1.06rem);
  --step-1:  clamp(1.22rem, 1.13rem + 0.42vw, 1.44rem);
  --step-2:  clamp(1.55rem, 1.36rem + 0.9vw, 2.05rem);
  --step-3:  clamp(2.05rem, 1.66rem + 1.85vw, 3.1rem);
  --step-4:  clamp(2.9rem, 2.05rem + 4vw, 5.4rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

.mono, code, .num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'ss01';
}
/* Long unbroken tokens (file paths, campaign names, resource ids) are common in
   this document and will push the page sideways on a phone if left alone.
   Numeric table cells are excluded: they must stay on one line. */
.mono:not(.num), code { overflow-wrap: anywhere; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- shell ------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1120px) {
  .shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
}

/* ---------- rail -------------------------------------------------------- */

.rail { display: none; }
@media (min-width: 1120px) {
  .rail {
    display: block;
    position: sticky; top: 0; align-self: start;
    height: 100vh; overflow-y: auto;
    padding: 2.25rem 0 2rem 1.75rem;
    border-right: 1px solid var(--line);
    background: var(--paper-deep);
  }
}
.rail-mark {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 1.6rem;
}
.rail-nav { list-style: none; margin: 0; padding: 0; }
.rail-nav li { margin-bottom: 0.1rem; }
.rail-nav a {
  display: grid; grid-template-columns: 1.85rem 1fr; gap: 0.15rem;
  padding: 0.34rem 0.75rem 0.34rem 0;
  color: var(--ink-2); text-decoration: none; font-size: 0.845rem; line-height: 1.32;
  border-right: 2px solid transparent; transition: color 0.16s var(--ease);
}
.rail-nav a .n {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  color: var(--faint); padding-top: 0.13rem;
}
.rail-nav a:hover { color: var(--ink); }
.rail-nav a[aria-current='true'] { color: var(--ink); font-weight: 600; border-right-color: var(--ink); }
.rail-nav a[aria-current='true'] .n { color: var(--ink); }
.rail-foot {
  margin-top: 1.75rem; padding: 1rem 1.25rem 0 0; border-top: 1px solid var(--line);
  font-size: 0.74rem; color: var(--faint); line-height: 1.5;
}

/* ---------- content flow ------------------------------------------------ */

main { min-width: 0; }
.band { padding: 0 var(--gutter); }
.wrap { max-width: 74rem; margin: 0 auto; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.15rem; margin: 0 0 1.05em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--faint); }

/* ---------- masthead ---------------------------------------------------- */

.mast { padding-top: clamp(3rem, 8vh, 6rem); padding-bottom: 2.5rem; }
.mast-kicker {
  display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: baseline;
  font-family: 'JetBrains Mono', monospace; font-size: 0.735rem;
  letter-spacing: 0.03em; color: var(--muted); margin-bottom: 1.75rem;
}
.mast-kicker b { color: var(--ink); font-weight: 700; }
/* On a phone the kicker wraps to one item per line; the middot separators then
   read as orphans, so drop them and tighten the leading instead. */
@media (max-width: 560px) {
  .mast-kicker { gap: 0.1rem 0.6rem; font-size: 0.68rem; line-height: 1.5; }
  .mast-kicker > span:nth-child(even) { display: none; }
}
.mast h1 {
  font-size: var(--step-4); line-height: 0.94; letter-spacing: -0.035em;
  font-weight: 800; margin: 0 0 1.5rem; max-width: 17ch; text-wrap: balance;
}
.mast-lede { font-size: var(--step-1); line-height: 1.44; color: var(--ink-2); max-width: 56ch; font-weight: 400; }
.mast-lede b { color: var(--ink); font-weight: 650; }

/* the standing figures, as a ruled index rather than hero tiles */
.standing {
  margin-top: 3rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line);
}
.standing dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0; gap: 0;
}
.standing div {
  padding: 1.15rem 1.25rem 1.2rem 0; border-right: 1px solid var(--line-soft);
}
.standing div:last-child { border-right: 0; }
.standing dt {
  font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 0.4rem;
}
.standing dd {
  margin: 0; font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em;
}
.standing dd small { font-size: 0.62em; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ---------- sections ---------------------------------------------------- */

section[id] { padding-top: clamp(3.5rem, 7vh, 5.5rem); padding-bottom: 0.5rem; }
.sec-head { display: flex; gap: 1.15rem; align-items: flex-start; margin-bottom: 1.9rem; }
.sec-num {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 700;
  color: var(--paper); background: var(--ink); padding: 0.28rem 0.5rem 0.24rem;
  border-radius: 3px; flex: 0 0 auto; margin-top: 0.42rem;
}
.sec-head h2 {
  font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.024em;
  font-weight: 750; margin: 0; max-width: 24ch; text-wrap: balance;
}
.sec-head .sub { color: var(--muted); font-size: var(--step-0); margin-top: 0.5rem; max-width: 60ch; }

h3 {
  font-size: var(--step-1); font-weight: 700; letter-spacing: -0.018em;
  margin: 2.6rem 0 0.85rem; line-height: 1.2;
}
h4 {
  font-size: 0.94rem; font-weight: 700; margin: 1.9rem 0 0.6rem;
  letter-spacing: 0.005em;
}

/* ---------- the spend/return strip -------------------------------------- */

.ledger { margin: 2.5rem 0 0; }
.ledger-bar {
  position: relative; height: 4.4rem; border-radius: 4px; overflow: hidden;
  background: var(--paper-deep); border: 1px solid var(--line);
  display: flex; box-shadow: var(--shadow);
}
.ledger-fill { background: var(--r5); position: relative; }
.ledger-gap { background: repeating-linear-gradient(
    -45deg, var(--r0) 0 6px, oklch(0.44 0.17 25) 6px 12px); position: relative; }
.ledger-bar span {
  position: absolute; bottom: 0.55rem; left: 0.85rem; color: var(--panel);
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; font-weight: 700;
  letter-spacing: -0.01em; text-shadow: 0 1px 3px oklch(0.2 0.05 25 / 0.5);
}
.ledger-bar span em { display: block; font-style: normal; font-weight: 400; font-size: 0.68rem; opacity: 0.9; }
.ledger-note { margin-top: 0.85rem; font-size: 0.85rem; color: var(--muted); max-width: 62ch; }

/* ---------- ROAS distribution ------------------------------------------- */

.ramp { margin: 2rem 0 0; }
.ramp-track { display: flex; height: 3.1rem; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.ramp-seg { position: relative; transition: filter 0.16s var(--ease); }
.ramp-seg:hover { filter: brightness(1.09); }
.ramp-legend {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.4rem 1rem; margin-top: 0.95rem; font-size: 0.78rem;
}
.ramp-legend div { display: flex; gap: 0.45rem; align-items: baseline; color: var(--muted); }
.ramp-legend i { width: 0.6rem; height: 0.6rem; border-radius: 2px; flex: 0 0 auto; transform: translateY(1px); }
.ramp-legend b { color: var(--ink); font-weight: 650; font-family: 'JetBrains Mono', monospace; font-size: 0.76rem; }

/* ---------- tables ------------------------------------------------------ */

.tablewrap {
  margin: 1.5rem 0 0; overflow-x: auto; border: 1px solid var(--line);
  border-radius: 4px; background: var(--panel); box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; font-size: 0.855rem; }
thead th {
  position: sticky; top: 0; background: var(--paper-deep); z-index: 1;
  text-align: left; font-weight: 650; font-size: 0.71rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper-deep); }
td.num, th.num { text-align: right; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
td.name { min-width: 17rem; line-height: 1.35; }
td.name small { display: block; color: var(--faint); font-size: 0.75rem; margin-top: 0.1rem; }
.tbl-cap { font-size: 0.78rem; color: var(--muted); margin-top: 0.6rem; }

/* ROAS chip: the document's core semantic unit */
.roas {
  display: inline-block; min-width: 3.6rem; text-align: right;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.8rem;
  padding: 0.11rem 0.4rem; border-radius: 3px; color: var(--panel);
}
.roas.t0 { background: var(--r0); }
.roas.t1 { background: var(--r1); }
.roas.t2 { background: var(--r2); }
.roas.t3 { background: var(--r3); color: oklch(0.25 0.05 96); }
.roas.t4 { background: var(--r4); }
.roas.t5 { background: var(--r5); }
.roas.tn { background: var(--line); color: var(--muted); }

.pill {
  display: inline-block; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.04em;
  padding: 0.14rem 0.42rem; border-radius: 3px; text-transform: uppercase;
  background: var(--paper-deep); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.on { background: oklch(0.93 0.06 152); color: oklch(0.38 0.11 152); border-color: oklch(0.84 0.08 152); }
.pill.off { background: var(--paper-deep); color: var(--muted); }
.pill.rm { background: oklch(0.94 0.04 25); color: oklch(0.44 0.14 25); border-color: oklch(0.87 0.06 25); }
.pill.src { font-family: 'JetBrains Mono', monospace; text-transform: none; font-size: 0.65rem; }

/* ---------- callouts ---------------------------------------------------- */

.note {
  margin: 1.9rem 0; padding: 1.1rem 1.3rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; font-size: 0.905rem;
  max-width: var(--measure);
}
.note h4 { margin: 0 0 0.4rem; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.note p { margin: 0 0 0.6em; }
.note p:last-child { margin-bottom: 0; }
.note.warn { background: oklch(0.975 0.03 68); border-color: oklch(0.87 0.08 68); }
.note.warn h4 { color: oklch(0.48 0.13 55); }
.note.stop { background: oklch(0.975 0.025 25); border-color: oklch(0.88 0.07 25); }
.note.stop h4 { color: oklch(0.47 0.16 25); }

/* ---------- the RSA render ---------------------------------------------- */

.serp {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.1rem 1.25rem 1.15rem; box-shadow: var(--shadow);
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
}
.serp-badge {
  font-size: 0.75rem; font-weight: 700; color: oklch(0.25 0.01 85);
  margin-bottom: 0.15rem; letter-spacing: 0;
}
.serp-url { font-size: 0.815rem; color: oklch(0.32 0.01 145); line-height: 1.35; word-break: break-all; }
.serp-h {
  font-size: 1.15rem; line-height: 1.28; color: oklch(0.42 0.16 275);
  margin: 0.28rem 0 0.22rem; font-weight: 400;
}
.serp-d { font-size: 0.875rem; line-height: 1.42; color: oklch(0.36 0.008 85); }
.serp-meta {
  margin-top: 0.85rem; padding-top: 0.7rem; border-top: 1px solid var(--line-soft);
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 0.71rem; color: var(--muted);
}

.rsa-grid { display: grid; gap: 1.5rem; margin-top: 1.6rem; }
@media (min-width: 900px) { .rsa-grid { grid-template-columns: 1fr 1fr; } }

.rsa-card { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--paper-deep); }
.rsa-card > .serp { border: 0; border-radius: 0; box-shadow: none; }
.rsa-assets { padding: 0.9rem 1.25rem 1.1rem; border-top: 1px solid var(--line); font-size: 0.79rem; }
.rsa-assets summary {
  cursor: pointer; color: var(--muted); font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 0.4rem;
}
.rsa-assets summary::-webkit-details-marker { display: none; }
.rsa-assets summary::before { content: '+'; font-family: 'JetBrains Mono', monospace; color: var(--faint); }
.rsa-assets[open] summary::before { content: '\2212'; }
.rsa-assets ol { margin: 0.7rem 0 0; padding-left: 1.4rem; columns: 1; }
.rsa-assets li { margin-bottom: 0.22rem; line-height: 1.42; }
.rsa-assets li .pin {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; color: var(--accent);
  background: var(--accent-sub); padding: 0 0.25rem; border-radius: 2px; margin-left: 0.3rem;
}

/* ---------- creative gallery -------------------------------------------- */

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem; margin-top: 1.5rem;
}
.gallery figure { margin: 0; position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 3px; background: var(--paper-deep); border: 1px solid var(--line-soft); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s var(--ease); }
.gallery button { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.gallery button:hover img { transform: scale(1.045); }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 0.9rem 0.5rem 0.35rem;
  background: linear-gradient(transparent, oklch(0.2 0.02 85 / 0.82));
  color: oklch(0.98 0 0); font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  opacity: 0; transition: opacity 0.18s var(--ease); pointer-events: none;
}
.gallery figure:hover figcaption { opacity: 1; }

.vidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; margin-top: 1.4rem; }
.vidgrid a { display: block; text-decoration: none; color: inherit; }
.vidgrid .thumb { position: relative; aspect-ratio: 16/9; border-radius: 3px; overflow: hidden; background: var(--paper-deep); border: 1px solid var(--line-soft); }
.vidgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vidgrid .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: oklch(0.2 0.02 85 / 0.18); transition: background 0.18s var(--ease);
}
.vidgrid a:hover .play { background: oklch(0.2 0.02 85 / 0.05); }
.vidgrid .play s {
  width: 2.4rem; height: 1.7rem; border-radius: 5px; background: oklch(0.5 0.2 25 / 0.92);
  display: grid; place-items: center; text-decoration: none;
}
.vidgrid .play s::after { content: ''; border-left: 0.6rem solid oklch(1 0 0); border-top: 0.36rem solid transparent; border-bottom: 0.36rem solid transparent; margin-left: 0.15rem; }
.vidgrid p { margin: 0.4rem 0 0; font-size: 0.76rem; line-height: 1.35; color: var(--muted); }

/* lightbox */
dialog#lb {
  border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh;
  overscroll-behavior: contain;
}
dialog#lb::backdrop { background: oklch(0.18 0.015 85 / 0.88); backdrop-filter: blur(2px); }
dialog#lb img { max-width: 88vw; max-height: 78vh; display: block; border-radius: 4px; box-shadow: 0 24px 70px oklch(0.15 0.02 85 / 0.5); }
dialog#lb .cap {
  color: oklch(0.96 0.004 85); font-family: 'JetBrains Mono', monospace; font-size: 0.76rem;
  margin-top: 0.75rem; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
}
dialog#lb button.x {
  all: unset; cursor: pointer; color: oklch(0.96 0 0); font-size: 1.4rem; line-height: 1;
  padding: 0.2rem 0.5rem;
}

/* ---------- change log -------------------------------------------------- */

.spark { display: flex; align-items: flex-end; gap: 2px; height: 3.4rem; margin-top: 1.1rem; }
.spark i {
  flex: 1; background: var(--accent); border-radius: 1px 1px 0 0; min-height: 1px;
  opacity: 0.82; transition: opacity 0.14s var(--ease);
}
.spark i:hover { opacity: 1; }
.spark-ax { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--faint); margin-top: 0.4rem; }

.timeline { margin: 1.6rem 0 0; padding: 0; list-style: none; max-width: 62rem; }
.timeline li {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.1rem;
  padding: 0.75rem 0; border-top: 1px solid var(--line-soft);
}
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline time { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--muted); padding-top: 0.1rem; }
.timeline b { font-weight: 650; display: block; }
.timeline p { margin: 0.15rem 0 0; font-size: 0.87rem; color: var(--ink-2); }

/* ---------- two-up ------------------------------------------------------ */

.duo { display: grid; gap: 1.75rem; margin-top: 1.6rem; }
@media (min-width: 860px) { .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; } }
/* Grid items default to min-width:auto, so a wide table inside a column forces
   the whole track wider and the page scrolls sideways. Pin them to zero and let
   .tablewrap own the horizontal scroll. */
.duo > * { min-width: 0; }
.duo > div > h4 { margin-top: 0; }

.decoder { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; line-height: 2.1; margin: 1.4rem 0 0; }
.decoder .seg { padding: 0.18rem 0.4rem; border-radius: 3px; white-space: nowrap; }
.decoder dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 1.1rem 0 0; font-size: 0.8rem; line-height: 1.5; }
.decoder dt { font-weight: 700; }
.decoder dd { margin: 0; color: var(--muted); font-family: 'Archivo', sans-serif; }

/* ---------- footer ------------------------------------------------------ */

footer.doc {
  margin-top: 5rem; border-top: 2px solid var(--ink); padding: 2rem var(--gutter) 4rem;
  font-size: 0.82rem; color: var(--muted);
}
footer.doc .wrap { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { footer.doc .wrap { grid-template-columns: 1fr auto; align-items: start; } }
footer.doc code { font-size: 0.78rem; background: var(--paper-deep); padding: 0.1rem 0.3rem; border-radius: 2px; }

.hr { height: 1px; background: var(--line); margin: 3rem 0 0; border: 0; }

@media print {
  .rail, dialog { display: none !important; }
  body { background: #fff; }
}

/* ---------- render filters + paging ------------------------------------- */

.filters { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; margin: 1.4rem 0 0.2rem; }
.chip {
  all: unset; cursor: pointer; font-size: 0.78rem; font-weight: 600;
  padding: 0.28rem 0.7rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); transition: all 0.15s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter-note { font-size: 0.8rem; color: var(--muted); margin-left: 0.4rem; }

.more {
  /* `all: unset` also clears box-sizing, so a 100%-wide button with padding
     would overflow its container. Restore it explicitly. */
  all: unset; box-sizing: border-box;
  cursor: pointer; display: block; width: 100%; text-align: center;
  margin-top: 1.1rem; padding: 0.8rem 1rem; border: 1px dashed var(--line);
  border-radius: 5px; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  background: var(--panel); transition: all 0.15s var(--ease);
}
.more:hover { color: var(--ink); border-color: var(--faint); background: var(--paper-deep); }

/* ---------- display / demand gen ad card -------------------------------- */

/* Grid rows stretch to the tallest card, so the inner panel has to fill or the
   card shows a band of bare backing colour under short copy. */
.rsa-grid { align-items: stretch; }
.rsa-card { display: flex; flex-direction: column; }
.dgad {
  padding: 1rem 1.2rem 1.1rem; background: var(--panel);
  flex: 1; display: flex; flex-direction: column;
}
.dgad .serp-meta { margin-top: auto; }
.dgad-top { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.dgad-long {
  margin: 0 0 0.55rem; font-size: 1.02rem; line-height: 1.25; font-weight: 700;
  letter-spacing: -0.012em;
}
.dgad ul { margin: 0 0 0.55rem; padding-left: 1.05rem; }
.dgad-h li { font-size: 0.88rem; line-height: 1.4; font-weight: 550; margin-bottom: 0.12rem; }
.dgad-d li { font-size: 0.83rem; line-height: 1.42; color: var(--ink-2); margin-bottom: 0.12rem; }
.dgad ul li::marker { color: var(--faint); }
.dgad-biz {
  font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 0.5rem;
}
.dgad-src {
  font-size: 0.67rem; color: var(--faint); margin: 0.6rem 0 0; line-height: 1.35;
}
