/* ══════════════════════════════════════════════════════════════════════════
   Min Webpartner · Brand 2026-10 (Twin Arc)
   Same language as webpartneren.dk: Instrument Sans, #1D1D1F ink, #86868B
   second lines, #F5F5F7 cards with 28 px corners, pill controls, #3355FF.
   Fonts are local because of the CSP (font-src 'self').
   ══════════════════════════════════════════════════════════════════════════ */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-var-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2'); }

:root {
  --bg: #FFFFFF;
  --surface: #F5F5F7;
  --surface-2: #FFFFFF;
  --ink: #1D1D1F;
  --ink-2: #424245;
  --muted: #86868B;
  --line: rgba(0, 0, 0, .08);
  --fill: rgba(0, 0, 0, .05);
  --fill-2: rgba(0, 0, 0, .09);
  --accent: #3355FF;
  --accent-ink: #2340D9;
  --accent-soft: rgba(51, 85, 255, .10);
  --on-accent: #FFFFFF;
  --good: #1E9E5A;  --good-soft: rgba(30, 158, 90, .12);
  --bad: #D7263D;   --bad-soft: rgba(215, 38, 61, .10);
  --warn: #B25E00;  --warn-soft: rgba(255, 159, 10, .16);
  --glass: rgba(255, 255, 255, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 24px 48px -28px rgba(0, 0, 0, .22);
  --series-1: #3355FF; --series-2: #FF5C8A; --series-3: #FFB547; --series-4: #8B5CFF;
  --series-5: #12A594; --series-6: #FF7A45; --series-7: #2FB7F5; --series-8: #A26BFA;
  --series-other: #C7C7CC;
  --gradient: linear-gradient(100deg, #FF5C8A, #FFB547 35%, #8B5CFF 70%, #3355FF);
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r-card: 28px;
  --r-inner: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --top-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E;
    --ink: #F5F5F7; --ink-2: #D1D1D6; --muted: #98989D;
    --line: rgba(255, 255, 255, .10); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .12);
    --accent: #6E8BFF; --accent-ink: #A9B8FF; --accent-soft: rgba(110, 139, 255, .18); --on-accent: #000000;
    --good: #32D27A; --good-soft: rgba(50, 210, 122, .16); --bad: #FF6B7D; --bad-soft: rgba(255, 107, 125, .14);
    --warn: #FFB547; --warn-soft: rgba(255, 181, 71, .16);
    --glass: rgba(0, 0, 0, .72); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -28px rgba(0, 0, 0, .8);
    --series-other: #48484A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E;
  --ink: #F5F5F7; --ink-2: #D1D1D6; --muted: #98989D;
  --line: rgba(255, 255, 255, .10); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .12);
  --accent: #6E8BFF; --accent-ink: #A9B8FF; --accent-soft: rgba(110, 139, 255, .18); --on-accent: #000000;
  --good: #32D27A; --good-soft: rgba(50, 210, 122, .16); --bad: #FF6B7D; --bad-soft: rgba(255, 107, 125, .14);
  --warn: #FFB547; --warn-soft: rgba(255, 181, 71, .16);
  --glass: rgba(0, 0, 0, .72); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -28px rgba(0, 0, 0, .8);
  --series-other: #48484A;
  color-scheme: dark;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a, button, [role=button] { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.center { text-align: center; }

/* ── Top bar: glass, logo, tabs, actions ─────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.top.scrolled { border-bottom-color: var(--line); }
.top-inner {
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 34px; height: auto; overflow: visible; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin: 0 auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 999px; color: var(--ink-2); font-size: 15px; font-weight: 500;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.tab svg { width: 17px; height: 17px; }
.tab:hover { background: var(--fill); color: var(--ink); }
.tab.on { background: var(--ink); color: var(--bg); }
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.who { font-size: 14px; color: var(--muted); padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
  transition: background .2s var(--ease), transform .1s;
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }

/* ── Page ────────────────────────────────────────────────────────────────── */
.view { min-height: calc(100vh - var(--top-h)); transition: opacity .25s var(--ease); }
.view.loading { opacity: .45; pointer-events: none; }
.page { max-width: 1200px; margin: 0 auto; padding: 40px 24px 72px; display: flex; flex-direction: column; gap: 16px; }

.page-head { display: flex; flex-direction: column; gap: 22px; margin-bottom: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--accent); width: fit-content; }
.back-link svg { width: 16px; height: 16px; }
.page-title {
  margin: 0; font-size: clamp(36px, 5.4vw, 68px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02;
  display: flex; flex-direction: column; gap: 6px; text-wrap: balance;
}
.page-sub { color: var(--muted); font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -0.03em; line-height: 1.15; font-weight: 600; max-width: 30ch; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Segmented control: grey track, white pill on the chosen one. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); }
.seg button {
  border: 0; background: transparent; cursor: pointer; height: 36px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #48484A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #48484A; } }
.seg .seg-icon svg { width: 16px; height: 16px; }
.seg-small button { height: 30px; padding: 0 12px; font-size: 13px; }

.date-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border-radius: var(--r-inner); background: var(--surface); width: 100%; }
.date-panel[hidden] { display: none; }
.date-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.date-panel input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 42px; }
.date-error { color: var(--bad); font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { transform: scale(1.03); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--fill-2); }
.btn-wide { width: 100%; }

/* ── KPIs ────────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: 24px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: -0.01em; }
.kpi-accent { background: var(--ink); color: var(--bg); }
.kpi-accent .kpi-label, .kpi-accent .kpi-value small { color: color-mix(in srgb, var(--bg) 62%, transparent); }
.kpi-accent .delta.flat, .kpi-accent .delta em { color: color-mix(in srgb, var(--bg) 62%, transparent); }
.delta { font-size: 13px; font-weight: 600; }
.delta em { font-style: normal; font-weight: 400; color: var(--muted); }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); font-weight: 400; }
.kpi-accent .delta.up { color: #4FE08F; } .kpi-accent .delta.down { color: #FF8A9A; }

/* ── Cards & grids ───────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border-radius: var(--r-card); padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; }
.card-title svg { width: 20px; height: 20px; color: var(--accent); }
.card-note { color: var(--muted); font-size: 14px; }
.card-head .card-note:first-of-type { margin-left: auto; }
.card-link { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 500; }
.card-link svg { width: 16px; height: 16px; }
.card-head .card-note + .card-link { margin-left: 8px; }

/* Rows: label left, value right */
.rows { margin: 0; display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row dt { font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.row dt small { color: var(--muted); font-size: 13px; }
.row dd { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row dd.good { color: var(--good); } .row dd.bad { color: var(--bad); }

/* Pills, chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--ink-2); }
.pill-live { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip-count { font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--fill-2); display: inline-flex; align-items: center; justify-content: center; }
.chip[aria-pressed="true"] .chip-count { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.chip-glass { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -18px; }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.chart { display: flex; flex-direction: column; gap: 10px; }
.chart-head { display: flex; justify-content: flex-end; margin-top: -54px; }
.chart-plot { position: relative; }
.chart-plot svg { width: 100%; height: auto; overflow: visible; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent); transform-box: fill-box; transform-origin: bottom; transition: fill .2s var(--ease), opacity .2s; }
.chart .bar.on { fill: var(--ink); }
.chart .axis { fill: var(--muted); font: 500 11px var(--sans); }
.chart .mark circle { fill: var(--surface-2); stroke: var(--series-2); stroke-width: 2.5; }
.chart .mark text { fill: var(--ink); font: 700 10px var(--sans); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart:not(.drawn) .bar { transform: scaleY(0); }
.chart:not(.drawn) .mark { opacity: 0; }
.chart.drawn .bar { animation: grow .7s var(--ease) both; animation-delay: var(--d); }
.chart.drawn .mark { animation: pop .5s var(--ease) both; animation-delay: var(--d); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chart-tip {
  position: absolute; top: -6px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; min-width: 170px; box-shadow: var(--shadow);
}
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: 13px; text-transform: capitalize; margin-bottom: 2px; }
.chart-tip span { display: flex; justify-content: space-between; gap: 12px; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chart-tip strong { color: var(--bg); font-weight: 600; }
.chart-caption { margin: 0; font-size: 14px; color: var(--muted); }

/* ── Live list ───────────────────────────────────────────────────────────── */
.live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.live-item { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 16px; color: var(--ink); transition: background .2s var(--ease); }
.live-item:hover { background: var(--fill); }
.live-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.live-text b { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-text small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Gallery: what runs now ──────────────────────────────────────────────── */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: thin; }
.gallery-item { scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.gallery-media { position: relative; border-radius: 20px; overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.gallery-media .ad-media { border-radius: 20px; }
.gallery-item:hover .gallery-media { transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery-badge { position: absolute; top: 10px; left: 10px; }
.gallery-badge .pill { background: rgba(255, 255, 255, .92); color: #1E9E5A; }
.gallery-title { margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery-meta { font-size: 12.5px; color: var(--muted); }
.gallery-stats { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.gallery-stats strong { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }

/* ── Ad media ────────────────────────────────────────────────────────────── */
.ad-media { position: relative; overflow: hidden; background: var(--fill); border-radius: 14px; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.ad-media img { width: 100%; height: 100%; object-fit: cover; }
.ad-media-missing span { font-size: 12px; color: var(--muted); text-align: center; padding: 8px; }
.ad-media.thumb { width: 52px; flex-shrink: 0; border-radius: 12px; }
.ad-media.thumb span { display: none; }
.ad-media.large { border-radius: 0; }

/* ── Insights ────────────────────────────────────────────────────────────── */
.insights { background: var(--surface); }
.insight-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.insight { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: var(--r-inner); background: var(--surface-2); color: var(--ink); height: 100%; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.insight:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.insight-icon { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.insight-icon svg { width: 19px; height: 19px; }
.insight-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.insight-text b { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.insight-text span { font-size: 14px; color: var(--muted); }
.insight-go { width: 18px; height: 18px; color: var(--muted); margin-top: 10px; flex-shrink: 0; }

/* ── Funnel ──────────────────────────────────────────────────────────────── */
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.funnel-step { display: flex; gap: 14px; }
.funnel-n { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.funnel-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.funnel-top { display: flex; justify-content: space-between; gap: 12px; }
.funnel-top b { font-weight: 600; }
.funnel-top strong { font-size: 18px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.funnel-body p { margin: 0; font-size: 13.5px; color: var(--muted); }
.funnel-track, .share-track { height: 8px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.funnel-track i, .share-track i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent); animation: fill 1s var(--ease) both; }
.share-track.dim i { background: var(--series-other); }
@keyframes fill { from { width: 0; } to { width: var(--w); } }

/* Share rows */
.share-rows { display: flex; flex-direction: column; gap: 16px; }
.share-row { display: flex; flex-direction: column; gap: 8px; }
.share-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.share-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 500; min-width: 0; }
.share-right { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Spend split */
.split { display: flex; flex-direction: column; gap: 16px; }
.split-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 3px; }
.split-bar i { min-width: 4px; animation: grow-x .9s var(--ease) both; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: none; } }
.split-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.split-legend li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.split-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Big split (Facebook 68 % · Instagram 32 %) */
.big-split { display: flex; gap: 28px; flex-wrap: wrap; }
.big-split-item { display: flex; flex-direction: column; }
.big-split-item strong { font-size: 44px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.big-split-item span { font-size: 15px; font-weight: 600; margin-top: 6px; }
.big-split-item small { font-size: 13px; color: var(--muted); }

/* ── Ad grid & cards ─────────────────────────────────────────────────────── */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ad-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); overflow: hidden; color: var(--ink); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.ad-card:hover { transform: scale(1.015); box-shadow: var(--shadow); }
.ad-card-media { position: relative; }
.ad-card-media .ad-media { border-radius: 0; }
.ad-card-media .ad-media img { transition: transform .8s var(--ease); }
.ad-card:hover .ad-card-media img { transform: scale(1.04); }
.ad-card-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 6px; }
.ad-card-badges .pill { background: rgba(255, 255, 255, .92); color: #1D1D1F; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ad-card-badges .pill-live { color: #1E9E5A; }
.ad-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.ad-card-title { display: flex; align-items: flex-start; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.ad-card-title .swatch { margin-top: 6px; }
.ad-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-card-tags:empty { display: none; }
.ad-card-stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.stat dt { font-size: 12.5px; color: var(--muted); }
.stat dd { margin: 0; display: flex; flex-direction: column; }
.stat b { font-size: 18px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }
.ad-card-empty { margin: 0; font-size: 14px; color: var(--muted); }

/* ── Ad detail ───────────────────────────────────────────────────────────── */
.ad-detail { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ad-detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.preview { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.preview-phone { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.preview-head span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.preview-head b { font-size: 14px; }
.preview-head small { font-size: 12px; color: var(--muted); }
.preview-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.preview-body { margin: 0; padding: 0 16px 12px; font-size: 14px; line-height: 1.45; white-space: pre-line; max-height: 9.5em; overflow: auto; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 16px; }
.preview-foot b { font-size: 14px; line-height: 1.3; }
.preview-cta { flex-shrink: 0; background: var(--surface); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding: 0 16px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel figure { margin: 0; flex: 0 0 82%; scroll-snap-align: center; display: flex; flex-direction: column; gap: 6px; }
.carousel img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--fill); }
.carousel figcaption { font-size: 12px; color: var(--muted); }
.carousel-missing { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 12px; background: var(--fill); font-size: 12px; color: var(--muted); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th { text-align: right; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 8px 10px; white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table td { text-align: right; padding: 13px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.table td:first-child b { font-weight: 600; margin-right: 8px; }

/* ── Heat map ────────────────────────────────────────────────────────────── */
.heat { display: grid; gap: 6px; align-items: center; }
.heat-col { font-size: 12.5px; color: var(--muted); text-align: center; }
.heat-row { font-size: 14px; font-weight: 500; padding-right: 8px; }
.heat-cell {
  height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent) calc(var(--k) * 85%), var(--fill));
  color: var(--ink); animation: pop .6s var(--ease) both;
}
.heat-cell.strong { color: #FFFFFF; }

/* ── Notices, empty, footnote, skeleton ──────────────────────────────────── */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: var(--r-inner); background: var(--warn-soft); color: var(--ink); }
.notice svg { width: 20px; height: 20px; color: var(--warn); flex-shrink: 0; margin-top: 2px; }
.notice p { margin: 0; font-size: 15px; }
.notice[hidden] { display: none; }
.empty { background: var(--surface); border-radius: var(--r-card); padding: 48px 28px; text-align: center; }
.empty h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 44ch; }
.footnote { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; text-wrap: balance; }
.skeleton { height: 14px; width: 40%; border-radius: 8px; background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton-big { height: 34px; width: 70%; margin-top: 10px; }
.skeleton-title { height: 64px; width: 55%; border-radius: 16px; margin-bottom: 24px; }
.skeleton-card { height: 320px; width: 100%; border-radius: var(--r-card); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Entrance motion (webpartneren.dk: 32 px rise, editorial ease) ───────── */
.view.enter .reveal { animation: rise .9s var(--ease) both; }
.view.enter .page > :nth-child(2) .reveal, .view.enter .page > :nth-child(2).reveal { animation-delay: .05s; }
.view.enter .kpis .kpi:nth-child(2) { animation-delay: .06s; }
.view.enter .kpis .kpi:nth-child(3) { animation-delay: .12s; }
.view.enter .kpis .kpi:nth-child(4) { animation-delay: .18s; }
.view.enter .kpis .kpi:nth-child(5) { animation-delay: .24s; }
.view.enter .ad-grid .ad-card:nth-child(2) { animation-delay: .06s; }
.view.enter .ad-grid .ad-card:nth-child(3) { animation-delay: .12s; }
.view.enter .ad-grid .ad-card:nth-child(n+4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ── Login ───────────────────────────────────────────────────────────────── */
body.login { min-height: 100vh; overflow-x: hidden; }
.glow { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none; z-index: 0; }
.glow-1 { width: 520px; height: 520px; background: #6E8BFF; top: -160px; left: -120px; }
.glow-2 { width: 460px; height: 460px; background: #FF8FB0; bottom: -180px; right: -120px; }
.glow-3 { width: 380px; height: 380px; background: #FFD08A; top: 40%; left: 55%; opacity: .3; }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 32px; padding: 36px 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; animation: rise .9s var(--ease) both; }
.login-brand { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.login-brand svg { width: 38px; height: auto; overflow: visible; }
.login-card h1 { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.05; }
.login-card h1 span { color: var(--muted); font-size: 24px; letter-spacing: -0.03em; }
.login-card form { display: flex; flex-direction: column; gap: 8px; }
.login-card label { font-size: 14px; font-weight: 500; margin-top: 6px; }
.login-card input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.login-card .btn { margin-top: 14px; min-height: 50px; font-size: 16px; }
.login-card .btn:disabled { opacity: .6; cursor: progress; }
/* Login med kode (GOAL.md fase J) */
.login-card form[hidden] { display: none; }
.login-card .btn + .btn { margin-top: 4px; }
.login-step { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.login-sub { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.login-links { margin: 6px 0 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-card .link { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; }
.login-card .link:disabled { color: var(--muted); cursor: default; }
.login-card .pw-field { position: relative; display: flex; }
.login-card .pw-field input { flex: 1; min-width: 0; padding-right: 52px; }
.login-card .pw-toggle { position: absolute; top: 0; right: 4px; bottom: 0; width: 44px; display: grid; place-items: center; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; border-radius: 12px; transition: color .2s; }
.login-card .pw-toggle:hover, .login-card .pw-toggle:focus-visible { color: var(--ink); }
.login-card .pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.login-card .pw-toggle svg { width: 20px; height: 20px; }
.login-card .pw-toggle .eye-off, .login-card .pw-toggle[aria-pressed="true"] .eye-open { display: none; }
.login-card .pw-toggle[aria-pressed="true"] .eye-off { display: block; }
.login-card input::-ms-reveal { display: none; }
.login-card .code-input { font-size: 28px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.notice.notice-info { background: var(--accent-soft); }
.login-help { margin: 0; font-size: 14px; color: var(--muted); }

/* ── The iPhone app: Apple's own badge + a QR code for computers ─────────── */
.app-badge { display: inline-flex; width: fit-content; border-radius: 9px; transition: transform .25s var(--ease), opacity .25s var(--ease); }
.app-badge img { display: block; width: 150px; height: auto; }
.app-badge:hover { opacity: .85; }
.app-badge:active { transform: scale(.97); }
.app-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 28px; }
.app-card-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 46ch; }
.app-card-text .muted { font-size: 15px; }
.app-card-text .app-badge { margin-top: 4px; }
.app-qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.app-qr img { display: block; width: 120px; height: 120px; padding: 8px; background: #FFFFFF; border-radius: 16px; image-rendering: pixelated; }
.app-qr figcaption { font-size: 13px; color: var(--muted); }
.login-app { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--muted); }
.login-app .app-badge img { width: 120px; }
/* On a phone the QR code makes no sense: you tap the badge instead. */
@media (max-width: 640px), (pointer: coarse) {
  .app-qr { display: none; }
}


/* ── Clickable numbers ───────────────────────────────────────────────────── */
.kpi-button { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s var(--ease); }
.kpi-button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-button:active { transform: scale(.98); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-go { width: 16px; height: 16px; opacity: 0; transform: translateX(-4px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.kpi-button:hover .kpi-go, .kpi-button:focus-visible .kpi-go { opacity: 1; transform: none; }
.chart-plot.clickable .hit { cursor: pointer; }

/* ── Sheet (pop-up) ──────────────────────────────────────────────────────── */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); display: flex; align-items: center; justify-content: center; padding: 24px; transition: background .35s var(--ease); }
.sheet-backdrop.open { background: rgba(0, 0, 0, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet {
  width: min(560px, 100%); max-height: min(86vh, 820px); display: flex; flex-direction: column;
  background: var(--surface-2); color: var(--ink); border-radius: 30px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .5);
  transform: translateY(28px) scale(.97); opacity: 0; transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.sheet-backdrop.open .sheet { transform: none; opacity: 1; }
:root[data-theme="dark"] .sheet { background: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet { background: var(--surface); } }
.sheet:focus { outline: none; }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px 24px 8px; }
.sheet-head h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.sheet-close { flex-shrink: 0; background: var(--fill); font-size: 24px; line-height: 1; }
.sheet-body { overflow-y: auto; padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 24px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.sheet-section { display: flex; flex-direction: column; gap: 8px; }
.sheet-section h3 { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sheet-stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet-stats div { background: var(--fill); border-radius: 16px; padding: 12px 14px; }
.sheet-stats dt { font-size: 13px; color: var(--muted); }
.sheet-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.sheet-ad { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 16px; color: var(--ink); transition: background .2s var(--ease); }
.sheet-ad:hover { background: var(--fill); }
.sheet-ad-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sheet-ad-text b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-ad-text small { font-size: 12.5px; color: var(--muted); }
.sheet-ad-right { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.sheet-ad-right b { font-size: 15px; font-weight: 600; }
.sheet-ad-right small { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 28px 28px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 8px auto 0; }
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; box-shadow: var(--shadow); transition: transform .4s var(--ease), opacity .3s var(--ease); pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-error { background: var(--bad); color: #fff; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 48px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .seg { align-self: flex-start; max-width: 100%; }
.money-input { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.money-input:focus-within { border-color: var(--accent); }
.money-input input { border: 0; background: transparent; padding: 0; min-height: 0; font-size: 44px; font-weight: 600; letter-spacing: -0.04em; width: 100%; box-shadow: none !important; }
.money-input span { font-size: 22px; color: var(--muted); font-weight: 600; }
.form-error { margin: 0; color: var(--bad); font-size: 14px; min-height: 1px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-danger { background: var(--bad-soft); color: var(--bad); margin-right: auto; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.notice-info { background: var(--accent-soft); margin: 0; font-size: 14.5px; }

/* ── Leads ───────────────────────────────────────────────────────────────── */
.lead-list { display: flex; flex-direction: column; gap: 10px; }
.lead { background: var(--fill); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sheet .lead { background: var(--surface); }
.lead-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lead-who { display: flex; flex-direction: column; min-width: 0; }
.lead-who b { font-size: 16px; font-weight: 600; }
.lead-who small { font-size: 12.5px; color: var(--muted); }
.lead-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-small .chip { height: 32px; padding: 0 12px; font-size: 13px; }
.pill-acc { background: var(--accent-soft); color: var(--accent-ink); }

/* ── Sales ───────────────────────────────────────────────────────────────── */
.sale-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sale { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 8px; margin: 0 -8px; border: 0; background: transparent; border-radius: 16px; cursor: pointer; text-align: left; color: var(--ink); border-top: 1px solid var(--line); transition: background .2s var(--ease); }
.sale-list li:first-child .sale { border-top: 0; }
.sale:hover { background: var(--fill); }
.sale-date { width: 64px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.sale-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sale-text b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sale-amount { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ── Money: does it pay? ─────────────────────────────────────────────────── */
.money-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; }
.money-verdict { display: flex; flex-direction: column; gap: 2px; }
.money-sign { font-size: 15px; font-weight: 600; color: var(--good); }
.money-minus .money-sign { color: var(--bad); }
.money-verdict strong { font-size: clamp(40px, 5vw, 64px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.money-plus .money-verdict strong { background: linear-gradient(100deg, #12A594, #3355FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.money-verdict small { color: var(--muted); font-size: 14px; margin-top: 4px; }
.money-bars { display: flex; flex-direction: column; gap: 14px; }
.money-bar-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.money-bar-top b { font-variant-numeric: tabular-nums; }
.money-track { height: 14px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.money-track i { display: block; height: 100%; width: var(--w); border-radius: inherit; animation: fill 1.1s var(--ease) both; }
.money-bar.in .money-track i { background: linear-gradient(90deg, #12A594, #3355FF); }
.money-bar.out .money-track i { background: var(--series-2); }
.money-facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.money-facts div { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.money-facts dt { font-size: 13px; color: var(--muted); }
.money-facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.money-lead { margin: 0; font-size: 17px; color: var(--ink-2); max-width: 52ch; }
.money-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .money-main { grid-template-columns: 1fr; gap: 18px; }
  .money-facts { grid-template-columns: 1fr; }
}


/* ── Enquiry «when» facts ── */
.lead-whens { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.lead-when { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: 16px; padding: 12px 14px; }
.lead-when > svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.lead-when span { display: flex; flex-direction: column; min-width: 0; }
.lead-when small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.lead-when b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin-top: 2px; }
.lead-when em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent-ink); }

/* ── Enquiries ───────────────────────────────────────────────────────────── */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.lead-grid .lead { background: var(--surface); border-radius: 24px; padding: 18px 20px; }
.lead-new { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.lead-top { align-items: center; }
.lead-ad { flex-shrink: 0; }
.lead-ad .ad-media.thumb { width: 46px; }
.lead-who { flex: 1; }
.lead-who b { font-size: 18px; letter-spacing: -0.02em; }
.lead-from { color: var(--ink-2) !important; }
.lead-answers { margin: 0; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.sheet .lead-answers { background: var(--bg); }
.lead-answers dt { font-size: 12.5px; color: var(--muted); }
.lead-answers dd { margin: 1px 0 0; font-size: 15px; font-weight: 500; white-space: pre-line; }
.tab { position: relative; }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--series-2); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notice-lead { background: var(--ink); color: var(--bg); align-items: center; transition: transform .3s var(--ease); }
.notice-lead:hover { transform: translateY(-2px); }
.notice-lead p { flex: 1; color: inherit; }
.notice-lead svg { color: inherit; margin: 0; }
.notice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--series-2); flex-shrink: 0; animation: pulse 2s var(--ease) infinite; color: var(--series-2); }
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .who { display: none; }
}
@media (max-width: 860px) {
  :root { --top-h: 112px; }
  .top-inner { flex-wrap: wrap; height: auto; padding: 10px 16px 8px; gap: 8px 12px; }
  .top { height: auto; }
  .top-actions { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .grid-2, .insight-list, .ad-detail { grid-template-columns: 1fr; }
  .preview { position: static; }
  .page { padding: 28px 16px 56px; }
  .card { padding: 22px 20px; border-radius: 24px; }
  .chart-head { margin-top: 0; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi-accent { grid-column: span 2; }
  .kpi { padding: 16px 18px; }
  .filters { flex-direction: column; align-items: stretch; }
  .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; padding: 0 13px; }
  .ad-grid { grid-template-columns: 1fr; }
  .tab span { font-size: 14px; }
  .brand-text small { display: none; }
}
@media (pointer: coarse) {
  .seg button, .chip, .tab, .icon-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .chart:not(.drawn) .bar { transform: none; }
}

/* Android: «Installer» or the menu hint, never both. `.btn` sets display, so
   the hidden attribute needs help here. */
.install-card [hidden] { display: none; }
