/* Taitoo campaign dashboard.
   Look: a tattoo flash sheet. "ink" = black ink on dark, "paper" = the cream flash sheet.
   Chart colours were checked with the dataviz palette validator in both modes
   (ink: #c08a1a / #27a399 / #e5482f on #171412, paper: #b07a08 / #008c82 / #c9321c on #f6efe1). */

:root {
  color-scheme: dark;
  --bg: #100e0c;
  --surface: #171412;
  --surface-2: #1f1b18;
  --line: #2b2622;
  --line-strong: #3b352f;
  --text: #f4ecdc;
  --text-2: #b9ae9c;
  --text-3: #8d8375;
  --accent: #e5482f;
  --accent-soft: rgba(229, 72, 47, 0.14);
  --on-accent: #fff6ea;
  --tattoo: #c08a1a;
  --piercing: #27a399;
  --neutral-bar: #6d6458;
  --good: #63b574;
  --bad: #f0806a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.07;
  --r: 14px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: "Karantina", "Rubik", system-ui, sans-serif;
}

:root[data-theme="paper"] {
  color-scheme: light;
  --bg: #ece2cd;
  --surface: #f6efe1;
  --surface-2: #ede3ce;
  --line: #ddd0b6;
  --line-strong: #c6b797;
  --text: #1b1612;
  --text-2: #594f44;
  --text-3: #766b5d;
  --accent: #c9321c;
  --accent-soft: rgba(201, 50, 28, 0.11);
  --on-accent: #fff6ea;
  --tattoo: #b07a08;
  --piercing: #008c82;
  --neutral-bar: #a3967f;
  --good: #2c7d43;
  --bad: #b8371f;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 12px 26px -20px rgba(60, 40, 10, 0.55);
  --grain-opacity: 0.1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }

/* ---------- top bar ---------- */
.top { position: relative; z-index: 2; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: 54px; line-height: 0.9;
  letter-spacing: 0.06em; background: none; border: 0; padding: 0 0 2px; color: var(--text);
  direction: ltr;
}
.wordmark::first-letter { color: var(--accent); }
.wordmark.buzz { animation: buzz 0.5s linear; }
@keyframes buzz {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-1px, 1px) rotate(-0.6deg); }
  20% { transform: translate(1px, -1px) rotate(0.6deg); }
  30% { transform: translate(-1px, -1px); }
  40% { transform: translate(1px, 1px) rotate(-0.4deg); }
  50% { transform: translate(-1px, 1px); }
  60% { transform: translate(1px, -1px) rotate(0.4deg); }
  70% { transform: translate(-1px, 0); }
  80% { transform: translate(1px, 1px); }
  90% { transform: translate(0, -1px); }
}
.brand-sub { display: flex; flex-direction: column; font-size: 13px; color: var(--text-2); line-height: 1.35; border-inline-start: 1px solid var(--line-strong); padding-inline-start: 14px; }
.brand-tag { color: var(--text-3); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); display: grid; place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.theme-btn {
  display: inline-flex; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 3px; gap: 2px; height: 38px; align-items: center;
}
.theme-btn span { padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); }
:root[data-theme="ink"] .theme-btn span[data-for="ink"],
:root[data-theme="paper"] .theme-btn span[data-for="paper"] { background: var(--text); color: var(--bg); font-weight: 600; }
@media (max-width: 640px) {
  .wordmark { font-size: 44px; }
  .brand-tag { display: none; }
  .brand-sub { font-size: 12px; }
}

/* ---------- filters ---------- */
main { padding-bottom: 60px; }
section { margin-top: 34px; }
.filters { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.dates { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.dates input {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 6px 8px; font-size: 13px; margin-inline-start: 4px; color-scheme: inherit;
}
.updated { margin-inline-start: auto; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 640px) { .updated { margin-inline-start: 0; width: 100%; } .seg { width: 100%; } .seg button { flex: 1; padding: 6px 4px; } }

.error {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--r);
  border: 1px solid var(--bad); background: var(--accent-soft); color: var(--text);
}

/* ---------- campaign strip ---------- */
.campaign { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.campaign-name { font-weight: 600; font-size: 16px; margin-inline-end: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--text-2); background: var(--surface); white-space: nowrap;
}
.pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; margin-bottom: 14px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.sec-title {
  font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.sec-head .sec-title { margin-bottom: 0; }
.star {
  width: 18px; height: 18px; flex-shrink: 0; background: var(--accent);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.link-btn { background: none; border: 0; color: var(--text-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

/* ---------- hero ---------- */
.hero { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; }
.hero-main {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 0; box-shadow: var(--shadow);
  min-height: 300px;
}
.hero-label { font-size: 14px; color: var(--text-2); font-weight: 500; }
.hero-num { font-size: clamp(84px, 13vw, 132px); line-height: 0.95; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; }
.hero-line { margin-top: 10px; font-size: 14px; color: var(--text-2); max-width: 30ch; }
.hero-line b { color: var(--text); }
.hero-spark { margin: auto -22px 0; padding-top: 14px; }
.hero-spark svg { display: block; width: 100%; height: 76px; }
.hero-spark-cap { padding: 0 22px 4px; font-size: 11.5px; color: var(--text-3); }
.flash { position: absolute; inset-inline-end: 14px; top: 14px; width: 150px; height: 150px; color: var(--text); pointer-events: none; }
.flash svg { position: absolute; overflow: visible; }
.flash .f1 { width: 62px; inset-inline-end: 6px; top: 2px; transform: rotate(12deg); }
.flash .f2 { width: 44px; inset-inline-end: 84px; top: 30px; transform: rotate(-14deg); }
.flash .f3 { width: 40px; inset-inline-end: 30px; top: 84px; transform: rotate(-6deg); }
.flash svg { animation: float 6s ease-in-out infinite; }
.flash .f2 { animation-delay: -2s; }
.flash .f3 { animation-delay: -4s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.ink { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ink-red { fill: var(--accent); stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.ink-gold { fill: var(--tattoo); stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-2); }
.kpi-val { font-size: 30px; font-weight: 600; line-height: 1.15; margin-top: 6px; letter-spacing: -0.01em; white-space: nowrap; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.delta { display: block; font-size: 12.5px; margin-top: 8px; color: var(--text-2); line-height: 1.4; }
.delta b { font-weight: 600; white-space: nowrap; }
.delta.good b { color: var(--good); }
.delta.bad b { color: var(--bad); }
.delta small { color: var(--text-3); font-weight: 400; font-size: 12px; white-space: nowrap; }
.hero-line .delta { margin-top: 4px; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } .hero-main { min-height: 260px; } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 13px; } .kpi-val { font-size: 24px; } .flash { transform: scale(0.8); transform-origin: top left; } }

/* ---------- funnel ---------- */
.funnel { margin-top: 14px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.step { padding: 14px 18px; min-width: 0; }
.step-label { font-size: 12.5px; color: var(--text-2); }
.step-val { font-size: 22px; font-weight: 600; margin-top: 2px; }
.step-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 6px; color: var(--text-3); font-size: 11.5px; gap: 2px; border-inline: 1px solid var(--line); background: var(--surface-2); min-width: 92px; text-align: center; }
.step-arrow b { color: var(--text); font-size: 14px; font-weight: 600; }
.step-arrow svg { width: 18px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  .funnel { grid-template-columns: 1fr; }
  .step-arrow { flex-direction: row; gap: 8px; padding: 6px 18px; justify-content: flex-start; border-inline: 0; border-block: 1px solid var(--line); }
  .step-arrow svg { transform: rotate(-90deg); }
}

/* ---------- insights ---------- */
.insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 1100px) { .insights { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } }
@media (max-width: 600px) { .insights { grid-template-columns: 1fr; } }
.insight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 16px 18px; box-shadow: var(--shadow); border-inline-start: 3px solid var(--accent); }
.insight-k { font-size: 12px; color: var(--text-3); font-weight: 500; }
.insight-t { margin-top: 4px; font-size: 15px; line-height: 1.5; }
.insight-t b { font-weight: 600; }
.insight-n { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; direction: ltr; overflow: visible; }
.chart-cap { position: absolute; inset-inline-start: 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.chart-cap i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.grid line { stroke: var(--line); stroke-width: 1; }
.bar-accent { fill: var(--accent); }
.bar-neutral { fill: var(--neutral-bar); }
.hover-band { fill: var(--text); opacity: 0.07; }
.ev-line { stroke: var(--line-strong); stroke-width: 1; }
.ev-flag circle { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.2; }
.ev-flag text { fill: var(--text); font-size: 10.5px; font-weight: 600; font-family: var(--font); }
.event-legend { list-style: none; padding: 12px 0 0; margin: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-2); }
.event-legend li { display: flex; align-items: baseline; gap: 6px; }
.event-legend .n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--text-2); font-size: 10.5px; font-weight: 600; color: var(--text); flex-shrink: 0; transform: translateY(2px); }
.event-legend time { color: var(--text-3); font-variant-numeric: tabular-nums; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; min-width: 150px; max-width: 260px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.tip h4 { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; }
.tip .row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .ev { margin-top: 5px; padding-top: 5px; border-top: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); }

.table-wrap { max-height: 420px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: start; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--text-2); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
td { font-variant-numeric: tabular-nums; }

/* ---------- duel ---------- */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch; }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.side-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.sw-tattoo { background: var(--tattoo); }
.sw-piercing { background: var(--piercing); }
.sw-other { background: var(--neutral-bar); }
.side-big { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.side-big strong { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.side-big span { color: var(--text-2); font-size: 14px; }
.side-tag { display: inline-block; margin-top: 8px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.meters { margin-top: 14px; display: grid; gap: 10px; }
.meter-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.meter-row > span:first-child { color: var(--text-2); }
.meter-row > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 62px; text-align: end; }
.track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 999px; width: 0; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.vs { display: grid; place-items: center; padding: 0 10px; }
.vs span { font-family: var(--display); font-weight: 700; font-size: 34px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transform: rotate(-8deg); border: 2px solid var(--text); margin-inline: -18px; position: relative; z-index: 2; direction: ltr; }
@media (max-width: 760px) { .duel { grid-template-columns: 1fr; } .vs { padding: 0; } .vs span { margin: -14px auto; } }

/* ---------- ads ---------- */
.ad-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--text-2); }
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.sort { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.sort select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 5px 8px; font-size: 13px; }
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ad { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform 0.25s ease, border-color 0.25s ease; min-width: 0; }
.ad:hover { transform: translateY(-4px) rotate(-0.4deg); border-color: var(--line-strong); }
.ad.dim { opacity: 0.78; }
.ad-img { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0; overflow: hidden; display: block; }
.ad-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.badges { position: absolute; inset: 8px 8px auto 8px; display: flex; justify-content: flex-start; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: rgba(16, 14, 12, 0.78); color: #f4ecdc; backdrop-filter: blur(4px); }
.badge .dot { width: 7px; height: 7px; }
.badge .dot.on { background: #63b574; }
.play { position: absolute; inset-inline-start: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(16, 14, 12, 0.78); display: grid; place-items: center; }
.play::after { content: ""; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #f4ecdc; margin-left: 3px; }
.stamp {
  position: absolute; z-index: 3; top: -14px; inset-inline-end: -10px; width: 74px; height: 74px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 0.9; transform: rotate(10deg);
  border: 2px solid var(--text); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
}
.stamp small { display: block; font-family: var(--font); font-size: 9.5px; font-weight: 500; letter-spacing: 0.02em; margin-top: 2px; }
.ad-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ad-course { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.ad-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.ad-lead { display: flex; align-items: baseline; gap: 6px; }
.ad-lead strong { font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.ad-lead span { font-size: 13px; color: var(--text-2); }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 0; }
.ad-stats div { min-width: 0; }
.ad-stats dt { font-size: 11.5px; color: var(--text-3); }
.ad-stats dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ad-note { font-size: 12px; color: var(--text-3); padding-top: 8px; border-top: 1px solid var(--line); margin-top: auto; }
.ad-note.hot { color: var(--text); }
.share { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.empty { padding: 26px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: var(--r); }

/* ---------- bar lists ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.barlist { display: grid; gap: 12px; }
.bl-row { display: grid; gap: 5px; }
.bl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.bl-top span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-top b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bl-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bl-meta { font-size: 12px; color: var(--text-3); }
.regions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.regions h4 { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.segbar { display: flex; gap: 2px; height: 8px; }
.segbar i { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.seg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.seg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seg-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 64px 18px 1fr; gap: 10px; align-items: start; padding: 9px 0; position: relative; }
.timeline time { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; text-align: end; }
.timeline .node { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin: 6px auto 0; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 82.5px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:first-child::before { top: 14px; }
.timeline li:last-child::before { bottom: calc(100% - 14px); }
.timeline .what { font-size: 14px; }
.timeline .names { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* loading: hold the previous render at reduced opacity, no layout jump */
#app.loading > section:not(.filters) { opacity: 0.45; transition: opacity 0.2s; }
.skeleton { border-radius: var(--r); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }

.reveal { opacity: 0; transform: translateY(10px); animation: rise 0.5s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .grain, .top-actions, .filters .seg, .link-btn, .ad-controls { display: none !important; }
  body { background: #fff; }
}
