/* Partikonton – dashboard styles
 * Intellecta · Hampus Brynolf · 2026
 * Linked from the live dashboard; edit this file directly (no rebuild needed for CSS).
 */

@font-face {
  font-family: "Oktah Neue";
  src: url("/fonts/OktahNeue-Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-latin-wght.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-latin-wght-Italic.woff2") format("woff2");
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("/fonts/DMSerifDisplay-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("/fonts/DMSerifDisplay-latin-400-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: light;
  --color-notion-blue: #0075de;
  --color-paper: #f6f5f4;
  --color-white: #ffffff;
  --color-ink: #000000;
  --color-graphite: #615d59;
  --color-stone: #757575;
  --color-sky-tint: #e6f3fe;
  --color-marigold: #ffb110;
  --color-coral: #f64932;
  --color-peach: #f6d5b8;
  --color-intellecta-red: #e1294a;
  --color-signal-blue: #097fe8;
  --color-sky-wash: #62aef0;
  --color-midnight: #02093a;
  --color-mocha: #b18164;

  --page: var(--color-paper);
  --surface-1: var(--color-white);
  --text-primary: var(--color-ink);
  --text-secondary: var(--color-graphite);
  --text-muted: var(--color-stone);
  --grid: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.08);
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-heading: "Oktah Neue", "Inter", ui-sans-serif, system-ui, sans-serif;

  --series-1: var(--color-notion-blue);
  --series-2: var(--color-coral);
  --series-3: var(--color-marigold);
  --series-4: var(--color-mocha);
  --series-5: var(--color-coral);

  --brand-instagram: #e4405f;
  --brand-tiktok: #111111;
  --brand-youtube: #ff0000;
  --brand-facebook: #1877f2;

  --seq-250: #e6f3fe;
  --seq-300: #b7dbf9;
  --seq-400: #62aef0;
  --seq-450: #097fe8;
  --seq-550: #0075de;
  --seq-650: #02093a;

  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-pill: 9999px;
  --radius-sm: 4px;
  --ease: 200ms ease;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #02093a;
  --surface-1: #0b1450;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.62);
  --text-muted: rgba(255,255,255,0.42);
  --grid: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.12);
  --seq-250: #152056;
  --seq-300: #1c2d78;
  --seq-400: #2a4cb0;
  --seq-450: #3d6fd6;
  --seq-550: #62aef0;
  --seq-650: #e6f3fe;
  --brand-tiktok: #f4f4f4;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-feature-settings: "lnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
}
.skip-link {
  position: absolute;
  left: 16px; top: 12px; z-index: 100;
  padding: 8px 14px; border-radius: var(--radius-btn);
  background: var(--color-ink); color: #fff; font-size: 14px; font-weight: 500;
  text-decoration: none;
  clip-path: inset(50%);
  width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.skip-link:focus {
  clip-path: none; width: auto; height: auto; overflow: visible;
  outline: 2px solid var(--color-intellecta-red); outline-offset: 2px;
}
:root[data-theme="dark"] .skip-link { background: #fff; color: var(--color-midnight); }

.nav {
  position: sticky; top: 0; z-index: 30;
  overflow: visible;
  background: var(--page);
  box-shadow: 0 0.7px 1.462px rgb(0 0 0 / 0.015), 0 3px 9px rgb(0 0 0 / 0.03);
  transition: box-shadow var(--ease);
}
.nav.is-scrolled {
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 20px rgb(0 0 0 / 0.08);
}
:root[data-theme="dark"] .nav.is-scrolled {
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.06), 0 10px 24px rgb(0 0 0 / 0.35);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: nowrap;
}
.nav-inner .logo { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--text-primary); }
.logo svg { display: block; height: 20px; width: auto; }
.nav-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
@media (max-width: 720px) {
  .nav-inner { padding: 10px 12px; gap: 8px; }
  .logo svg { height: 15px; }
  .nav-actions { gap: 4px; }
  .nav-actions .btn-icon { width: 32px; height: 32px; }
  #shareLink { display: none; }
}
@media (max-width: 380px) {
  .nav-inner { padding: 10px; gap: 6px; }
  .logo svg { height: 14px; }
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 8px 24px 96px; --wrap-max: 1120px; --wrap-pad: 24px; }

.hero { padding: 56px 0 40px; }
.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 16px;
}
h1 {
  font-family: var(--font-heading); font-size: clamp(32px, 5.4vw, 52px); font-weight: 700; line-height: 1.28;
  letter-spacing: -0.02em; margin: 0 0 18px; max-width: 20em;
}
.hl-em {
  font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-intellecta-red);
}
.lede {
  font-family: var(--font-serif); font-size: 18px; font-weight: 400;
  line-height: 1.56; color: var(--text-secondary); max-width: 40em; margin: 0 0 12px;
}
.credit {
  font-family: var(--font-serif); font-size: 16px; font-weight: 400;
  line-height: 1.56; color: var(--text-secondary); max-width: 40em; margin: 0;
}
.view-updated {
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  max-width: 40em;
  margin: 14px 0 0;
}
.lede a, .credit a, footer.note a {
  color: inherit; text-decoration: underline; text-underline-offset: 2px;
}

.btn {
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.2;
  border-radius: var(--radius-btn); padding: 6px 15px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: rgba(0,0,0,0.9);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
:root[data-theme="dark"] .btn { color: rgba(255,255,255,0.9); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
:root[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
}
.theme-icon { width: 18px; height: 18px; display: block; }
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
.btn-outline {
  border-color: rgba(0,0,0,0.2); color: rgba(0,0,0,0.9); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 13px;
}
:root[data-theme="dark"] .btn-outline { border-color: rgba(255,255,255,0.22); color: rgba(255,255,255,0.9); }
.btn-outline:hover { background: rgba(0,0,0,0.04); }
:root[data-theme="dark"] .btn-outline:hover { background: rgba(255,255,255,0.08); }

.include-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0;
}
.include-toggle input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--color-notion-blue); cursor: pointer; }

section.card {
  position: relative;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 24px; margin-bottom: 16px;
}
section.card h2 {
  font-family: var(--font-heading); font-size: 22px; font-weight: 700; line-height: 1.27; letter-spacing: -0.01em; margin: 0 0 6px;
}
section.card:has(.table-toggle:not([hidden])) h2,
section.card:has(.table-tools) h2,
section.card:has(.chart-export) h2 {
  padding-right: 12rem;
}
section.card .desc { font-size: 14px; line-height: 1.43; color: var(--text-secondary); margin: 0 0 20px; }
section.card--midnight {
  background: var(--color-midnight); border-color: transparent; color: #fff;
}
section.card--midnight h2 { color: #fff; }
section.card--midnight .desc { color: rgba(255,255,255,0.62); }
:root[data-theme="dark"] section.card--midnight {
  background: #0b1450; border: 1px solid rgba(255,255,255,0.12);
}

.legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; padding: 0;
  list-style: none; font-size: 12px; color: var(--text-secondary);
}
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: var(--radius-sm); display: inline-block; }
.swatch.light { box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); }
.period-kicker {
  font-size: 12px; color: var(--text-muted); margin: 0 0 12px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.period-legend { margin: 14px 0 0; font-size: 13px; }
.period-legend .period-n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.card--midnight .legend { color: rgba(255,255,255,0.72); }

.chart-row, .p-row { transition: opacity 0.4s ease; }
.chart-row.is-dim, .p-row.is-dim, .trend-card.is-dim { opacity: 0.2; }
.n-hint { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

.chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: default; }
.chart-row .party-label { width: 168px; flex-shrink: 0; font-size: 13px; color: var(--text-primary); text-align: right; padding-right: 4px; }
.chart-row:has(.party-code) .party-label { width: 222px; }
.party-name { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.party-logo { width: 18px; height: 18px; flex: 0 0 auto; display: block; object-fit: contain; }
.party-code { font-weight: 600; }
.chart-row .bar-track { position: relative; flex: 1; height: 22px; background: transparent; }
.chart-row .value-label { width: 84px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.chart-row .count-label { width: 44px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; }
.chart-row--head { margin-bottom: 4px; }
.chart-row--head .bar-track { height: auto; }
.chart-row--head .value-label,
.chart-row--head .count-label { font-size: 11px; color: var(--text-tertiary, var(--text-secondary)); }

.seg { position: absolute; top: 0; height: 22px; }
.seg .inline-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 11px;
  font-weight: 600; color: #fff; white-space: nowrap; pointer-events: none;
}
.seg.light .inline-label { color: #000; }
.simple-bar { position: absolute; top: 0; left: 0; height: 22px; border-radius: var(--radius-sm); background: var(--series-1); }
.chart-row--dual .party-label {
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.chart-row--dual .bar-pair {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.chart-row--dual .value-label { width: 96px; white-space: nowrap; }
.chart-row--dual .value-label .dot { color: var(--text-muted); }
.chart-row--dual .bar-track { height: 10px; }
.chart-row--dual .simple-bar { height: 10px; }
.legend + .chart-row--dual { margin-top: 8px; }
.party-ch-bar { position: relative; overflow: hidden; background: transparent; }
.party-ch-bar .seg.is-leader { opacity: 0.58; }
.legend .swatch-muted { opacity: 0.55; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th, table.data-table td {
  text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums; vertical-align: top;
}
table.data-table th {
  color: var(--text-muted); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
table.data-table td.num, table.data-table th.num { text-align: right; white-space: nowrap; }
table.data-table .th-party {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
table.data-table a.acct-handle {
  color: var(--text-muted); text-decoration: none;
}
table.data-table a.acct-handle:hover { text-decoration: underline; text-underline-offset: 2px; }
table.data-table .chip {
  display: inline-block; background: var(--page); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px 10px; margin: 2px 4px 2px 0;
  font-size: 12px; color: var(--text-secondary);
}

.table-tools {
  position: absolute; top: 18px; right: 16px; z-index: 2;
  display: flex; align-items: center; gap: 2px; margin: 0;
  background: var(--surface-1); border-radius: var(--radius-btn);
}
.table-tools--end { justify-content: flex-end; }
.table-tools--end .copy-excel { margin: 0; }
.copy-excel {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; height: 28px; margin: 0; padding: 0 8px 0 6px; border: 0;
  border-radius: var(--radius-btn); background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: 0.02em;
  cursor: pointer; transition: color var(--ease), background var(--ease), opacity var(--ease);
}
.copy-excel:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.copy-excel:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.copy-excel svg { width: 14px; height: 14px; display: block; }
.copy-excel-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.copy-excel.is-copied { color: var(--series-1); }
:root[data-theme="dark"] .copy-excel:hover { background: rgba(255,255,255,0.08); }
.card--midnight .copy-excel { color: rgba(255,255,255,0.62); }
.card--midnight .copy-excel:hover { color: #fff; background: rgba(255,255,255,0.08); }
.card--midnight .copy-excel.is-copied { color: #fff; }
.card--midnight .table-tools { background: var(--color-midnight); }
:root[data-theme="dark"] .card--midnight .table-tools { background: #0b1450; }
details.table-toggle { margin-top: 0; }
details.table-toggle[open] { margin-top: 16px; }
details.table-toggle summary {
  position: absolute; top: 18px; right: 16px; z-index: 2;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-secondary); list-style: none;
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-btn);
  padding: 4px 4px 4px 8px; margin: 0; white-space: nowrap;
  background: var(--surface-1);
  transition: color var(--ease), opacity var(--ease);
}
details.table-toggle summary:hover { color: var(--text-primary); }
details.table-toggle summary::-webkit-details-marker { display: none; }
details.table-toggle summary::before {
  content: "";
  width: 14px; height: 14px; flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='2'/%3E%3Cpath d='M3.5 10h17M10 4.5v15'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='2'/%3E%3Cpath d='M3.5 10h17M10 4.5v15'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (hover: hover) and (pointer: fine) {
  details.table-toggle:not([open]) summary:not(:has(.chart-export)),
  .table-tools:not(:has(.chart-export)) {
    opacity: 0;
    pointer-events: none;
  }
  section.card:hover details.table-toggle summary,
  section.card:focus-within details.table-toggle summary,
  details.table-toggle[open] summary,
  details.table-toggle summary:focus-visible,
  section.card:hover .table-tools,
  section.card:focus-within .table-tools {
    opacity: 1;
    pointer-events: auto;
  }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
details.table-toggle .table-wrap { margin-top: 10px; }
.table-wrap .data-table + .data-table { margin-top: 20px; }
.table-wrap--accounts table { min-width: 720px; }
.table-wrap--accounts th, .table-wrap--accounts td { white-space: nowrap; }
.card--midnight details.table-toggle summary { color: rgba(255,255,255,0.62); background: var(--color-midnight); }
.card--midnight details.table-toggle summary:hover { color: #fff; }
:root[data-theme="dark"] .card--midnight details.table-toggle summary { background: #0b1450; }
.card--midnight table.data-table th, .card--midnight table.data-table td { border-bottom-color: rgba(255,255,255,0.12); color: #fff; }
.card--midnight table.data-table th { color: rgba(255,255,255,0.5); }
.card--midnight .chip { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.82); }

.tooltip {
  position: fixed; pointer-events: none; z-index: 50;
  background: var(--color-midnight); color: #fff;
  font-size: 12px; padding: 8px 12px; border-radius: var(--radius-btn);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  opacity: 0; transition: opacity var(--ease); max-width: 260px; line-height: 1.45;
}
.tooltip.show { opacity: 1; }
.tooltip b { font-weight: 600; }

.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .platform-grid { grid-template-columns: 1fr; } }
.week-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; align-items: start; }
.week-grid-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
@media (max-width: 900px) { .week-grid { grid-template-columns: 1fr; } }
.platform-panel h3 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--text-primary); }
.platform-panel .p-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.platform-panel .p-label { width: 118px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.platform-panel .p-label--acct {
  width: 200px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.platform-panel .p-label--acct .plat-ico { width: 14px; height: 14px; flex: 0 0 14px; }
.platform-panel .p-label--acct .acct-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.platform-panel .p-label:has(.party-code) { width: 180px; overflow: visible; text-overflow: clip; }
.week-grid-side .party-full,
.week-grid-side .party-code { display: none; }
.week-grid-side .platform-panel .p-label {
  width: 22px; overflow: visible; text-overflow: clip;
}
.platform-panel .p-track { position: relative; flex: 1; height: 14px; }
.platform-panel .p-bar { position: absolute; top: 0; left: 0; height: 14px; border-radius: var(--radius-sm); }
.platform-panel .p-value { width: 52px; flex-shrink: 0; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.trend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.trend-grid--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 36rem; }
@media (max-width: 980px) { .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .trend-grid, .trend-grid--pair { grid-template-columns: minmax(0, 1fr); }
}
.trend-card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; background: var(--page); min-width: 0; }
.trend-card .tc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; min-width: 0; }
.trend-card .tc-name { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; }
.trend-card .tc-name .party-name { min-width: 0; }
.trend-card .party-full { display: none; }
.trend-card .tc-delta { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.trend-card .tc-spark { position: relative; height: 46px; }
.trend-card svg { display: block; width: 100%; height: 46px; }
.trend-card .tc-dots { position: absolute; inset: 0; pointer-events: none; }
.trend-card .tc-dot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--series-1); transform: translate(-50%, -50%);
  pointer-events: auto;
}

.plat-inline {
  display: inline-flex; align-items: baseline; gap: 0.28em; white-space: nowrap;
  color: inherit; font-weight: 500;
}
.plat-inline svg {
  width: 1em; height: 1em; flex-shrink: 0; position: relative; top: 0.12em;
  color: var(--icon-color, currentColor);
}
.plat-ico {
  width: 16px; height: 16px; flex: 0 0 auto;
  color: var(--icon-color, var(--text-primary));
  display: inline-flex; align-items: center; justify-content: center;
}
.plat-ico svg { width: 100%; height: 100%; display: block; }
.acct-cell {
  display: inline-flex; align-items: center; gap: 8px;
}
.acct-cell-text { min-width: 0; }
h2 .plat-inline { font-weight: inherit; }
.platform-panel h3.plat-h { display: flex; align-items: center; gap: 6px; }
.chip .plat-inline { font-weight: 500; }

#accountMatrix {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px;
}
@media (max-width: 720px) {
  .party-full { display: none; }
  .trend-card .party-full { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .chart-row .party-code,
  .platform-panel .p-label .party-code,
  .trend-card .party-code { display: none; }
  .chart-row:has(.party-logo) .party-label { width: 28px; padding-right: 0; }
  .platform-panel .p-label:has(.party-logo) { width: 28px; overflow: visible; }
  #accountMatrix { grid-template-columns: 1fr; }
  .chart-row:not(.chart-row--dual):not(:has(.party-logo)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    row-gap: 4px;
    align-items: baseline;
    .party-label {
      width: auto;
      max-width: 100%;
      text-align: left;
      padding-right: 0;
      grid-column: 1;
      grid-row: 1;
    }
    .value-label {
      width: auto;
      text-align: right;
      white-space: nowrap;
      grid-column: 2;
      grid-row: 1;
    }
    .bar-track {
      grid-column: 1 / -1;
      grid-row: 2;
      height: 16px;
    }
    .simple-bar { height: 16px; }
  }
}
.matrix-rows { list-style: none; margin: 0; padding: 0; }
.matrix-party { margin-bottom: 0; }
.matrix-party h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.matrix-row {
  display: flex; align-items: center; gap: 14px; padding: 8px 0;
  border-bottom: 1px solid var(--grid);
}
.matrix-row:last-child { border-bottom: none; }
.matrix-row .m-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary); }
.matrix-row .m-icons { display: flex; gap: 10px; flex-shrink: 0; }
.acct-icon { width: 20px; height: 20px; display: inline-flex; color: inherit; text-decoration: none; }
.acct-icon svg { width: 100%; height: 100%; }
.acct-icon.present { color: var(--icon-color, var(--text-primary)); }
.acct-icon.absent { color: var(--text-muted); opacity: 0.28; pointer-events: none; }
a.acct-icon.present:hover { opacity: 0.7; }

footer.note {
  font-family: var(--font-serif); font-size: 15px; color: var(--text-secondary);
  line-height: 1.56; margin-top: 40px; max-width: 46em;
}
footer.note p { margin: 0 0 0.75em; }
footer.note p:last-child { margin-bottom: 0; }
footer.note .sources {
  font-size: 14px;
  color: var(--text-muted);
}

.heat-wrap { overflow-x: auto; }
table.heat {
  border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums;
  table-layout: fixed; width: 100%;
}
table.heat th.heat-corner { width: 188px; }
table.heat th.heat-col {
  font-weight: 600; font-size: 11px; color: rgba(255,255,255,0.55);
  text-align: center; padding: 0 0 6px; vertical-align: bottom;
}
table.heat th.heat-col .party-logo { margin: 0 auto 3px; }
table.heat th.heat-row {
  text-align: right; padding: 0 10px 0 0; font-weight: 500;
  font-size: 13px; color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
table.heat td.heat-cell {
  height: 36px; text-align: center; font-size: 11px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: default;
}
table.heat td.heat-diag { color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); font-weight: 500; }
.heat-legend {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  font-size: 12px; color: rgba(255,255,255,0.62); margin-top: 16px;
}
.heat-legend .ramp {
  display: block; flex: 1; min-width: 0; height: 10px; border-radius: var(--radius-sm);
  background: linear-gradient(to right, hsl(40 48% 14%), hsl(40 100% 56%));
}
@media (max-width: 720px) {
  table.heat th.heat-corner { width: 4.2em; }
  table.heat th.heat-row { padding-right: 6px; font-size: 12px; }
  table.heat td.heat-cell { font-size: 10px; height: 32px; }
}

/* Live dashboard: Konton / Poster */
.view-tabs { display: inline-flex; gap: 2px; background: var(--page); border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 2px; }
.view-tab {
  font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  padding: 5px 12px; border-radius: 6px;
}
.view-tab.is-active { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.view-tab:hover { color: var(--text-primary); }
.view-tab:focus-visible,
.sort-btn:focus-visible,
.range-btn:focus-visible,
.series-range-btn:focus-visible,
#shareLink:focus-visible,
#themeToggle:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .view-tab { padding: 4px 7px; font-size: 12px; }
}
@media (max-width: 380px) {
  .view-tab { padding: 4px 5px; font-size: 11px; }
}
.live-status { font-size: 13px; color: var(--text-muted); margin: -24px 0 28px; }

.puff {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; margin: 0 0 16px; padding: 28px 28px 26px;
  text-decoration: none; color: #fff;
  background: var(--color-midnight); border-radius: var(--radius-card);
  transition: background var(--ease);
}
.puff:hover { background: #0b1450; }
.puff:focus-visible { outline: 2px solid var(--color-intellecta-red); outline-offset: 3px; }
:root[data-theme="dark"] .puff {
  background: #0b1450; border: 1px solid rgba(255,255,255,0.12);
}
:root[data-theme="dark"] .puff:hover { background: #121c62; }
.puff-copy { min-width: 0; }
.puff-title {
  font-family: var(--font-heading); font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; color: #fff;
}
.puff p:not(.puff-title) {
  font-family: var(--font-serif); font-size: 17px; font-weight: 400;
  line-height: 1.5; color: rgba(255,255,255,0.72); max-width: 34em; margin: 0;
}
.puff-cta {
  flex-shrink: 0; font-size: 15px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; color: #fff;
}
@media (max-width: 640px) {
  .puff { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px; }
}
.nav-filters {
  border-top: 1px solid var(--border);
  background: var(--page);
  overflow: visible;
}
.nav-filters[hidden] { display: none !important; }
.nav-filters-toggle {
  display: none;
  align-items: center; justify-content: flex-end; gap: 8px;
  width: 100%; margin: 0; padding: 10px 16px;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--text-primary); background: transparent; border: 0; cursor: pointer;
  text-align: right;
}
.nav-filters-toggle::after {
  content: ""; flex: 0 0 auto;
  width: 7px; height: 7px; margin-top: 0;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.nav-filters.is-open .nav-filters-toggle::after {
  transform: rotate(-135deg); margin-top: -2px;
}
.nav-filters-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px 12px;
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end;
}
.nav-filter { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nav-filter-label { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.02em; }
.nav-filter select {
  font-family: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; min-width: 148px; max-width: 220px;
}
.nav-filter .include-toggle {
  font-size: 13px; min-height: 32px; color: var(--text-primary);
}
@media (max-width: 640px) {
  .nav-filters-toggle { display: flex; }
  .nav-filters-inner { display: none; }
  .nav-filters.is-open .nav-filters-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 0 16px 10px;
  }
  .nav-filter select {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 6px 8px;
  }
}
.post-kpis {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}
.post-kpi {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px 14px;
  min-width: 0;
}
.post-kpi-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.post-kpi-value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.post-kpi-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.post-kpi--quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  align-items: start;
}
.post-kpi--quad .post-kpi-hint {
  grid-column: 1 / -1;
  margin: 0;
}
.post-kpi-stat { min-width: 0; }
.post-kpi--quad .post-kpi-value { font-size: clamp(24px, 2.8vw, 34px); }
.post-kpi--gauge {
  display: flex;
  flex-direction: column;
}
.post-kpi-gauge {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 4px auto 0;
  overflow: visible;
}
.post-kpi-gauge-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: butt;
}
.post-kpi-gauge-arc--track { stroke: var(--grid); }
.post-kpi-gauge-arc--left { stroke: var(--color-intellecta-red); }
.post-kpi-gauge-arc--right { stroke: var(--color-midnight); }
:root[data-theme="dark"] .post-kpi-gauge-arc--right { stroke: var(--seq-400); }
.post-kpi-gauge-needle {
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-linecap: round;
}
.post-kpi-gauge-hub {
  fill: var(--surface-1);
  stroke: var(--text-primary);
  stroke-width: 2;
}
.post-kpi-sides {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}
.post-kpi-side {
  min-width: 0;
}
.post-kpi-side--left { text-align: left; }
.post-kpi-side--right { text-align: right; }
.post-kpi-side-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.post-kpi-side--left .post-kpi-side-name { color: var(--color-intellecta-red); }
.post-kpi-side--right .post-kpi-side-name { color: var(--color-midnight); }
:root[data-theme="dark"] .post-kpi-side--right .post-kpi-side-name { color: var(--seq-400); }
.post-kpi-side-val {
  display: block;
  margin-top: 2px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.post-kpi-side-pct {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .post-kpis { grid-template-columns: 1fr; }
}
.series-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 0 0 10px;
}
.series-range-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.series-range-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.series-range-opts {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.series-range-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  padding: 3px 8px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.series-range-btn:hover { color: var(--text-secondary); }
.series-range-btn.is-active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--surface-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.range-toggle {
  display: flex; gap: 4px;
  background: var(--page); border: 1px solid var(--border);
  border-radius: 14px; padding: 5px; margin: 0 0 16px;
}
.range-btn {
  flex: 1; font-family: inherit; font-size: 16px; font-weight: 600;
  line-height: 1.2; padding: 16px 18px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-secondary); cursor: pointer;
}
.range-btn:hover { color: var(--text-primary); }
.range-btn.is-active {
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
@media (max-width: 640px) {
  .range-btn { font-size: 14px; padding: 12px 10px; }
}
.sort-toggle {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--page); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin: 0 0 16px;
}
.sort-btn {
  flex: 1; min-width: 0; font-family: inherit; font-size: 13px; font-weight: 600;
  line-height: 1.2; padding: 10px 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-secondary); cursor: pointer;
}
.sort-btn:hover { color: var(--text-primary); }
.sort-btn.is-active {
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.load-more-wrap {
  display: flex; justify-content: center; margin: 16px 0 0;
}
.load-more-wrap[hidden] { display: none !important; }
.load-more {
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  padding: 12px 22px; min-width: 180px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--page); color: var(--text-primary); cursor: pointer;
}
.load-more:hover { border-color: var(--text-muted); }
.load-more:disabled { opacity: 0.55; cursor: wait; }
.empty-note { color: var(--text-muted); font-size: 14px; margin: 0; }
#reachChart, #genderChart, #ageChart { min-height: 220px; }
.line-chart { position: relative; height: 320px; }
.line-chart canvas { display: block; }
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
#view-poster .post-grid,
#view-trend .post-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#view-poster .post-card .thumb,
#view-trend .post-card .thumb {
  aspect-ratio: 9 / 16;
}
@media (max-width: 900px) {
  #view-poster .post-grid,
  #view-trend .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  #view-poster .post-grid,
  #view-trend .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.post-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
  background: var(--page); transition: border-color var(--ease);
}
.post-card:hover { border-color: var(--text-muted); }
.post-card .thumb { position: relative; aspect-ratio: 1; background: var(--grid); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
}
.post-card .type-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; line-height: 1;
  padding: 6px 8px; border-radius: 6px; color: #fff;
  background: rgba(2, 9, 58, 0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.post-card .type-badge svg { width: 12px; height: 12px; display: block; flex: 0 0 auto; }
.post-card .type-badge--story {
  background: linear-gradient(135deg, #f58529, #dd2a7b 45%, #8134af);
}
.post-card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 0; }
.post-card .engagement {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
  gap: 6px; font-size: 11px; font-weight: 600; line-height: 1; color: var(--text-primary);
  padding-bottom: 8px;
}
.post-card .eng-item {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; min-width: 0;
  color: var(--text-muted);
}
.post-card .eng-item.is-sort { color: var(--text-primary); }
.post-card .eng-item svg { width: 13px; height: 13px; display: block; flex: 0 0 auto; }
.post-card .account {
  display: flex; align-items: center; gap: 6px;
  margin: 0; padding: 8px 0 0;
  border-top: 1px solid var(--grid);
  font-size: 13px; font-weight: 600; line-height: 1.2;
  min-width: 0;
}
.post-card .engagement + .account { padding-top: 10px; }
.post-card .party-logo { width: 16px; height: 16px; }
.post-card .handle {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; color: var(--text-primary);
}
.post-card .when {
  margin-left: auto; flex-shrink: 0;
  font-weight: 400; font-size: 11px; color: var(--text-muted);
}
.post-card .snippet {
  margin: 8px 0 0;
  font-size: 12px; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}
.post-pills {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 8px 0 0; padding: 0;
}
.post-pill {
  display: inline-block;
  font-size: 10px; font-weight: 600; line-height: 1.2; letter-spacing: 0.02em;
  padding: 3px 7px; border-radius: var(--radius-pill);
  background: var(--page); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.nav-filters .analys-filters {
  margin: 0;
}
.nav-filters .analys-metric {
  margin: 0;
  background: var(--surface-1);
}
.nav-filters .analys-metric .sort-btn { flex: none; padding: 6px 12px; }
.analys-filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px;
  margin: 0 0 24px;
}
.multi-select { position: relative; min-width: 148px; max-width: 220px; }
.multi-select-toggle {
  position: relative;
  font-family: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px; width: 100%; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.multi-select-toggle::after {
  content: ""; position: absolute; right: 11px; top: 50%;
  width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); pointer-events: none;
}
.multi-select-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg); margin-top: -1px;
}
.multi-select-menu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  min-width: 100%; width: max-content; max-width: 280px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
:root[data-theme="dark"] .multi-select-menu { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.multi-select-option {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer;
  white-space: nowrap;
}
.multi-select-option:hover { background: var(--page); }
.multi-select-option input { width: 14px; height: 14px; accent-color: var(--color-notion-blue); cursor: pointer; }
.analys-status { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; }
.analys-ex-group { margin: 0 0 22px; }
.analys-ex-group h3 {
  font-size: 15px; font-weight: 650; margin: 0 0 10px;
}
.post-card .over-kicker {
  margin: 0 0 6px; font-size: 11px; font-weight: 650;
  color: var(--text-primary);
}

.admin-body { background: var(--page); }
.admin-wrap { max-width: none; padding: 12px 16px 24px; }
.admin-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }
.admin-head h1 { font-size: 18px; margin: 0; }
.admin-tabs { margin-left: 4px; }
.admin-tabs .view-tab {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.admin-lede { margin: 0; color: var(--text-muted); font-size: 12px; }
.admin-pane[hidden] { display: none; }
.admin-health {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.admin-health[hidden] { display: none; }
.admin-health-err {
  margin: 0 0 10px;
  color: #a33;
  font-size: 13px;
}
.admin-health-err[hidden] { display: none; }
.admin-health-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
}
.admin-health-card h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.admin-health-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}
.admin-health-card .admin-health-detail {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.admin-health-card.is-ok {
  border-left-color: #2f6f3e;
  background: #f3f8f4;
}
.admin-health-card.is-warn {
  border-left-color: #b8860b;
  background: #fff8e8;
}
.admin-health-card.is-err {
  border-left-color: #a33;
  background: #fbf3f3;
}
@media (max-width: 1100px) {
  .admin-health { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .admin-health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.admin-now {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
}
.admin-now[hidden] { display: none; }
.admin-now.is-idle { color: var(--text-secondary); }
.admin-now.is-on {
  border-left: 4px solid #b8860b;
  background: #fff8e8;
}
.admin-now-title { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--text-primary); }
.admin-now-meta { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-secondary); }
.admin-now-job + .admin-now-job { margin-top: 10px; }
.admin-now.is-on .admin-now-title { color: #6b4e00; }
.admin-live-log {
  margin: 6px 0 0; padding: 0; list-style: none;
  font-size: 11px; color: var(--text-muted);
  max-height: 9.5em; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.admin-live-log li { padding: 1px 0; }
.admin-jobs { margin: 0 0 14px; }
.admin-jobs h2 { margin: 0 0 4px; font-size: 14px; }
.admin-jobs-lede { margin: 0 0 12px; font-size: 12px; color: var(--text-muted); }
.admin-job-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.admin-job-row--more { border-top-style: dashed; }
.admin-job-copy h3 { margin: 0 0 3px; font-size: 13px; font-weight: 650; }
.admin-job-copy p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.admin-job-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-job-actions button {
  font: inherit; font-size: 12px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary); cursor: pointer;
}
.admin-job-actions button:hover { border-color: var(--text-muted); }
.admin-job-actions button:disabled { opacity: 0.45; cursor: default; }
.admin-jobs .admin-muted { margin: 8px 0 0; }
@media (max-width: 640px) {
  .admin-job-row { grid-template-columns: 1fr; }
}
.admin-runs { margin: 16px 0 0; }
.admin-runs[hidden] { display: none; }
.admin-runs-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.admin-runs-head h2 { margin: 0; font-size: 14px; }
.admin-runs-head label { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--text-muted); }
.admin-runs-head select { font: inherit; font-size: 12px; padding: 3px 6px; }
.admin-runs-table { table-layout: fixed; width: 100%; min-width: 720px; }
.admin-runs-col-when { width: 11rem; }
.admin-runs-col-job { width: 10rem; }
.admin-runs-col-status { width: 6.5rem; }
.admin-runs-table tr.is-click { cursor: pointer; }
.admin-runs-table tr.is-click:hover td { background: rgba(0,0,0,0.03); }
.admin-runs-table tr.admin-run-detail-row td {
  cursor: auto; padding: 0 8px 10px; background: var(--page);
}
.admin-runs-table tr.admin-run-detail-row:hover td { background: var(--page); }
.admin-run-detail { margin: 0; user-select: text; }
.admin-run-detail pre {
  margin: 0; padding: 8px; max-height: 240px; overflow: auto;
  font-size: 11px; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 4px;
  user-select: text;
}
.admin-tr-flag { display: block; margin-top: 4px; font-size: 11px; color: #8a6200; }
.admin-tr-pill {
  display: inline-flex; align-items: center; max-width: 100%;
  margin: 4px 0 0; padding: 2px 8px;
  border: 0; border-radius: var(--radius-pill);
  background: #eee; color: var(--text-secondary);
  font: inherit; font-size: 11px; font-weight: 550; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; text-align: left;
}
.admin-tr-pill.is-ok { background: #e6f3ea; color: #2f6f3e; }
.admin-tr-pill.is-missing { background: #fff3d1; color: #8a6200; }
.admin-tr-pill.is-queued { background: #fff3d1; color: #8a6200; }
.admin-tr-pill.is-empty { background: #eee; color: var(--text-muted); }
.admin-tr-pill.is-na { background: #eee; color: var(--text-muted); }
.admin-tr-pill:hover { filter: brightness(0.97); }
.admin-runs-wrap { max-height: min(70vh, 720px); overflow: auto; }
.admin-runs-table td:nth-child(1) { white-space: nowrap; }
.admin-runs-table td:nth-child(2),
.admin-runs-table td:nth-child(3) { white-space: nowrap; }
.admin-runs-table tr.is-error td:nth-child(3),
.admin-runs-table tr.is-err td:nth-child(3) { color: #a33; font-weight: 650; }
.admin-runs-table tr.is-running td:nth-child(3) { color: #b8860b; font-weight: 650; }
.admin-runs-err { margin-top: 4px; font-size: 12px; }
.admin-runs-err ul { margin: 4px 0 0; padding-left: 16px; }
.admin-gate { display: flex; align-items: end; gap: 8px; margin: 0 0 12px; }
.admin-gate[hidden] { display: none; }
.admin-gate input { font: inherit; padding: 4px 8px; }
.admin-filters {
  display: flex; flex-wrap: wrap; gap: 10px 12px;
  align-items: end; margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 550; color: var(--text-secondary);
}
.admin-filters select, .admin-filters input {
  font: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--page); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; min-width: 108px;
}
.admin-search { flex: 1 1 240px; min-width: 220px; }
.admin-search input { width: 100%; }
.admin-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 10px; font-size: 13px; color: var(--text-secondary);
}
.admin-pager[hidden] { display: none; }
.admin-pager p { margin: 0; }
.admin-pager button {
  font: inherit; font-size: 12px; padding: 3px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary); cursor: pointer;
}
.admin-pager button:disabled { opacity: 0.45; cursor: default; }
.admin-th-sort button {
  display: inline-flex; align-items: center; gap: 3px;
  margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; text-align: inherit;
}
.admin-sort-mark { font-size: 9px; color: var(--text-muted); min-width: 0.7em; }
.admin-th-sort.is-asc .admin-sort-mark, .admin-th-sort.is-desc .admin-sort-mark { color: var(--text-primary); }
.admin-table-wrap {
  overflow: auto;
  max-height: min(78vh, 920px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
}
.admin-table { table-layout: fixed; width: max(100%, 1940px); min-width: 1940px; }
.admin-table th.admin-col-acct, .admin-table td.admin-col-acct { width: 260px; overflow: hidden; }
.admin-basis { margin-top: 2px; min-width: 0; }
.admin-basis-input {
  font-size: 11px; font-weight: 550; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-basis-meta {
  margin-top: 1px; font-size: 10px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-basis-meta.is-flag { color: #8a6200; font-weight: 550; }
.admin-table th.admin-col-plat, .admin-table td.admin-col-plat { width: 88px; }
.admin-table th.admin-col-type, .admin-table td.admin-col-type { width: 88px; }
.admin-type-pill {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 650; line-height: 1.2;
  padding: 2px 7px; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.admin-type-pill.is-reel { background: #fde8e4; color: #c43a28; }
.admin-type-pill.is-video { background: var(--color-sky-tint); color: var(--color-notion-blue); }
.admin-type-pill.is-short { background: #fff3d1; color: #8a6200; }
.admin-type-pill.is-photo { background: #f3e6dc; color: #7a5340; }
.admin-type-pill.is-carousel { background: #eef0f8; color: #3d4a73; }
.admin-type-pill.is-post { background: #eee; color: var(--text-secondary); }
.admin-type-pill.is-story { background: #f6e8f0; color: #8a3d62; }
.admin-type-pill.is-other { background: #eee; color: var(--text-muted); }
.admin-table th.admin-col-date, .admin-table td.admin-col-date { width: 88px; white-space: nowrap; }
.admin-table th.admin-col-num, .admin-table td.admin-col-num { width: 72px; }
.admin-th-icon { display: flex; align-items: center; justify-content: inherit; }
.admin-col-num .admin-th-icon { justify-content: flex-end; }
.admin-th-icon svg { width: 14px; height: 14px; display: block; }
.admin-table th.admin-col-text, .admin-table td.admin-col-text { width: 320px; overflow: hidden; }
.admin-table th.admin-col-dim, .admin-table td.admin-col-dim { width: 112px; }
.admin-table th.admin-col-tema, .admin-table td.admin-col-tema { width: 180px; }
.admin-table.data-table th, .admin-table.data-table td {
  padding: 8px 8px; font-size: 13px; vertical-align: middle;
}
.admin-table tbody tr:hover td { background: rgba(0, 0, 0, 0.035); }
.admin-table thead th {
  position: sticky; top: 0; background: var(--surface-1); z-index: 2;
  font-size: 11px; font-weight: 650;
  box-shadow: 0 1px 0 var(--border);
}
.admin-table th.admin-th-sort.is-asc,
.admin-table th.admin-th-sort.is-desc {
  background: #eef4fb;
}
.admin-acct {
  display: flex; gap: 8px; align-items: flex-start;
  min-width: 0; max-width: 100%;
}
.admin-acct > div { min-width: 0; overflow: hidden; }
.admin-acct img, .admin-thumb-empty {
  width: 36px; height: 36px; object-fit: cover; border-radius: 4px;
  display: block; background: var(--grid); flex: none;
}
.admin-acct img.is-cached { cursor: zoom-in; }
.admin-thumb-pop {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 4px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
}
.admin-thumb-pop[hidden] { display: none; }
.admin-thumb-pop img {
  display: block; max-width: min(360px, 70vw); max-height: min(280px, 50vh);
  width: auto; height: auto; border-radius: 4px; background: var(--grid);
}
.admin-handle {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-muted { color: var(--text-muted); font-size: 10px; }
.admin-text { min-width: 0; max-width: none; }
.admin-clip, .admin-trhint {
  display: block; width: 100%; margin: 0; padding: 0;
  border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; color: var(--text-secondary); line-height: 1.35;
  white-space: normal; overflow: hidden;
}
.admin-clip { max-height: 2.7em; }
.admin-trhint {
  max-height: 1.35em; margin-top: 2px;
  color: var(--text-muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis;
}
.admin-clip:hover, .admin-trhint:hover { color: var(--text-primary); }
.admin-sel {
  font: inherit; font-size: 11px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 4px; max-width: 132px;
}
.admin-plain { font-size: 11px; color: var(--text-secondary); }
.admin-tema { display: flex; flex-wrap: wrap; gap: 3px; max-width: 200px; }
.admin-pill {
  display: inline-flex; align-items: center;
  font: inherit; font-size: 10px; font-weight: 650; line-height: 1.2;
  padding: 3px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--page);
  color: var(--text-secondary); cursor: pointer;
}
.admin-pill.on {
  background: var(--color-sky-tint); border-color: #c5e2fb;
  color: var(--color-notion-blue);
}
.admin-pill.add { padding: 2px 6px; color: var(--text-muted); }
.admin-pop {
  position: fixed; z-index: 40;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: flex; flex-wrap: wrap; gap: 4px;
}
.admin-pop[hidden] { display: none; }
.admin-rationale {
  font: inherit; font-size: 13px; line-height: 1.45; color: var(--text-secondary);
  width: 100%; min-height: 10em; resize: vertical;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
}
.admin-save-ok { color: #2f6f3e; }
.admin-save-err { color: #a33; }
.admin-modal { border: 0; padding: 0; background: transparent; max-width: 920px; width: calc(100vw - 32px); }
.admin-modal::backdrop { background: rgba(15, 12, 8, 0.35); }
.admin-modal-card {
  background: var(--page); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}
.admin-modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin: 0 0 12px; }
.admin-modal-head h2 { font-size: 16px; margin: 0; }
.admin-modal-close {
  font: inherit; font-size: 12px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); cursor: pointer;
}
.admin-modal-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px 20px;
}
.admin-modal-grid h3 { font-size: 11px; margin: 0 0 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-modal-text {
  white-space: pre-wrap; font-size: 13px; line-height: 1.45;
  color: var(--text-secondary); max-height: 40vh; overflow: auto;
  margin: 0 0 14px;
}
@media (max-width: 720px) {
  .admin-modal-grid { grid-template-columns: 1fr; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Editorial long read (start view) */
body.is-story { overflow-x: clip; }
body.is-story .wrap { padding-top: 12px; }

.story-progress {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31;
  height: 3px; margin: 0; background: transparent; pointer-events: none;
}
.story-progress span {
  display: block; height: 100%; width: 0;
  background: var(--color-intellecta-red);
  transition: width 80ms linear;
}
.story-h { scroll-margin-top: 72px; }
.story-h { position: relative; }
.story-anchor {
  display: inline-block; margin-left: 0.35em;
  font-family: var(--font-sans); font-size: 0.55em; font-weight: 600;
  font-style: normal; letter-spacing: 0; line-height: 1;
  color: var(--color-intellecta-red); text-decoration: none;
  vertical-align: 0.12em; opacity: 0.55;
}
.story-anchor:hover, .story-anchor:focus-visible { opacity: 1; }
.story-h:hover .story-anchor, .story-h:focus-within .story-anchor { opacity: 1; }

.story {
  --story-measure: 66ch;
  --story-head: 40.5rem;
  --story-sticky: 64px;
  --story-fade: 18px;
  --story-fade-top: 28px;
  --story-gutter: max(var(--wrap-pad), calc((100vw - var(--wrap-max)) / 2 + var(--wrap-pad)));
  --story-lift:
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 16px 40px rgba(0, 0, 0, 0.1);
  position: relative;
}
:root[data-theme="dark"] .story {
  --story-lift:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.4);
}
@media (min-width: 900px) {
  .story { --story-sticky: 80px; }
}

.story-loading {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-secondary);
  padding: 48px 0 24px;
  max-width: 40em;
}

.story data {
  font: inherit;
  color: inherit;
}

.story::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  width: 100vw;
  height: 85vh;
  height: 85svh;
  margin-left: -50vw;
  background:
    radial-gradient(ellipse 55vw 48vh at 0% 12%, rgba(225, 41, 74, 0.16), transparent 72%),
    radial-gradient(ellipse 50vw 52vh at 100% 18%, rgba(2, 9, 58, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(225, 41, 74, 0.05), transparent 55%);
  -webkit-mask-image: linear-gradient(to bottom, #000 12%, transparent 58%);
  mask-image: linear-gradient(to bottom, #000 12%, transparent 58%);
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] .story::before {
  background:
    radial-gradient(ellipse 55vw 48vh at 0% 12%, rgba(225, 41, 74, 0.28), transparent 72%),
    radial-gradient(ellipse 50vw 52vh at 100% 18%, rgba(98, 174, 240, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(225, 41, 74, 0.1), transparent 62%);
}

.story-hero,
.story-body,
.story-exit {
  position: relative;
  z-index: 1;
}

.story-hero { padding: 48px 0 56px; margin: 0 0 8px; }
.story-hero::after {
  content: "";
  position: absolute;
  left: 0;
  top: 52px;
  width: 3px;
  height: 42%;
  background: var(--color-intellecta-red);
}
.story-hero-copy { position: relative; z-index: 1; max-width: 42rem; padding-left: 22px; }
.story-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 7.2vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: none;
  margin: 0 0 18px;
}
.story-hero h1 em { font-style: italic; color: var(--color-intellecta-red); }
.story-byline,
.hscroll-kicker,
.story-exit-kicker {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.story-byline { font-weight: 600; letter-spacing: 0.12em; margin: 0 0 0.35em; }
.story-byline a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.story-byline + .story-dek { margin-top: 10px; }
.story-dek {
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.1vw, 23px);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 38em;
  margin: 0;
}
.story-updated {
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  max-width: 38em;
  margin: 16px 0 0;
}
.story-dek + .story-updated { margin-top: 18px; }

.story-body {
  font-family: var(--font-serif);
  font-size: 19.5px;
  font-weight: 400;
  line-height: 1.62;
  color: var(--text-primary);
}
.story-body > p,
.story-body > h2,
.story-body > h3,
.story-body > ul,
.story-body > ol,
.story-body > blockquote,
.scrolly-steps {
  max-width: var(--story-measure);
  margin-left: auto;
  margin-right: auto;
}
.story-body > p { margin: 0 0 1.15em; }
.story-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.35em;
  line-height: 0.78;
  padding: 0.08em 0.1em 0 0;
  color: var(--color-intellecta-red);
}
.story-body > h2.story-h {
  max-width: var(--story-head);
  margin: 3.25rem 0 0.7rem;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.3vw, 38px);
  line-height: 1.16;
  letter-spacing: -0.03em;
}
.story-body > h2.story-h::before {
  content: "";
  display: block;
  width: 2.15rem;
  height: 3px;
  margin: 0 0 0.58em;
  background: var(--color-intellecta-red);
}
.story-body > h3.story-h {
  max-width: var(--story-head);
  margin: 1.7em 0 0.45em;
  padding: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15em;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.story-body a:not(.story-anchor) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.story-body > ul,
.story-body > ol { padding-left: 1.2em; margin-bottom: 1.2em; }
.story-body > ul li,
.story-body > ol li { margin: 0 0 0.35em; }
.story-body blockquote {
  margin: 1.4em auto;
  padding: 0 0 0 1.1em;
  border-left: 3px solid var(--color-intellecta-red);
  font-style: italic;
  color: var(--text-secondary);
}

.story-pull {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin: 2.6em calc(50% - 50vw) 2.8em;
  padding: 36px 0 32px;
  background-color: color-mix(in srgb, var(--color-intellecta-red) 5.5%, var(--page));
}
.story-pull::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70vw 160% at 0% 50%, rgba(225, 41, 74, 0.14), transparent 75%),
    radial-gradient(ellipse 60vw 160% at 100% 50%, rgba(2, 9, 58, 0.1), transparent 75%);
  pointer-events: none;
}
:root[data-theme="dark"] .story-pull {
  background-color: color-mix(in srgb, var(--color-intellecta-red) 12%, var(--page));
}
:root[data-theme="dark"] .story-pull::before {
  background:
    radial-gradient(ellipse 70vw 160% at 0% 50%, rgba(225, 41, 74, 0.24), transparent 75%),
    radial-gradient(ellipse 60vw 160% at 100% 50%, rgba(98, 174, 240, 0.14), transparent 75%);
}
.story-pull-copy {
  position: relative;
  z-index: 1;
  max-width: var(--story-measure);
  margin-left: var(--story-gutter);
}
.story-pull-copy p:first-child {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--text-primary);
}
.story-pull-copy p:last-child {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

.story-chart { margin: 2.2em 0 2.6em; min-width: 0; }
.story-chart-frame { position: relative; }
.story-chart:has([data-chart="tempo"]) .line-chart { height: 320px; }
.story-chart-frame[data-chart="account-matrix"] {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px 48px;
}
.story-chart-frame[data-chart="account-matrix"] .m-icons {
  gap: 6px;
}
.story-chart-frame[data-chart="party-channels"] .party-label {
  width: 148px;
  text-align: left;
}
.story .chart-row .value-label { width: 118px; }
.story .chart-row--dual .value-label { width: 96px; }
.story-chart:has(table.heat) .story-chart-frame,
.story-chart-frame:has(table.heat) {
  background: var(--color-midnight);
  color: #fff;
  padding: 22px 22px 18px;
  border-radius: var(--radius-card);
}
.story-chart-frame .heat-legend { color: rgba(255, 255, 255, 0.7); margin-top: 12px; }

.tema-andel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}
@media (max-width: 760px) {
  .story-chart-frame[data-chart="account-matrix"] { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .story-chart-frame[data-chart="account-matrix"],
  .tema-andel-grid { grid-template-columns: 1fr; }
}

.story-hscroll { margin-bottom: 2.8em; min-width: 0; }
.story-hscroll .hscroll-track { position: relative; min-width: 0; }
.story-hscroll.is-hscroll .hscroll-pin {
  position: sticky;
  top: var(--story-sticky);
  z-index: 2;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 0 8px;
}
.story-hscroll.is-hscroll .tema-andel-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  width: max-content;
  will-change: transform;
}
.scrolly-sticky .story-chart-frame,
.story-hscroll.is-hscroll .platform-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--story-lift);
}
.story-hscroll.is-hscroll .platform-panel { padding: 18px 16px 14px; }
.story-hscroll.is-hscroll .platform-panel.is-active {
  border-color: color-mix(in srgb, var(--text-primary) 18%, var(--border));
}
.hscroll-kicker { margin: 12px 0 0; min-height: 1.2em; }

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin: 20px 0 0;
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.scroll-hint.is-end { opacity: 0; }
.scroll-hint span {
  position: relative;
  display: block;
  width: 42px;
  height: 6px;
  animation: scroll-hint-fall 1.55s ease-in-out infinite;
}
.scroll-hint span::before,
.scroll-hint span::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.scroll-hint span::before { left: 0; transform: rotate(14deg); transform-origin: left center; }
.scroll-hint span::after { right: 0; transform: rotate(-14deg); transform-origin: right center; }
.scroll-hint span:nth-child(1) { opacity: 0.28; }
.scroll-hint span:nth-child(2) { opacity: 0.5; animation-delay: 0.14s; }
.scroll-hint span:nth-child(3) { opacity: 0.78; animation-delay: 0.28s; }
.scroll-hint-copy {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
}
@keyframes scroll-hint-fall {
  0%, 100% { transform: translateY(-3px); }
  45% { transform: translateY(3px); }
}

.story-scrolly {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 2.6em 0 3em;
}
.scrolly-sticky {
  position: sticky;
  top: var(--story-sticky);
  z-index: 2;
  align-self: start;
  padding: var(--story-fade-top) 0 var(--story-fade);
  background: linear-gradient(
    to bottom,
    transparent,
    var(--page) var(--story-fade-top),
    var(--page) calc(100% - var(--story-fade)),
    transparent
  );
}
.scrolly-sticky::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--story-fade-top));
  height: var(--story-fade-top);
  background: linear-gradient(to bottom, transparent, var(--page));
  pointer-events: none;
}
.scrolly-sticky .story-chart-frame { padding: 16px 14px 14px; }
.scrolly-sticky .line-chart { height: 260px; }
.scrolly-sticky .legend { margin-bottom: 10px; }
.scrolly-steps { list-style: none; padding: 0; }
.scrolly-step {
  min-height: 52vh;
  min-height: 52svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.6em 0 2.2em;
  margin: 0;
  border-top: 1px solid var(--border);
  opacity: 0.42;
  transition: opacity 0.35s ease;
}
.scrolly-step:first-child { border-top: none; }
.scrolly-step.is-active { opacity: 1; }
.scrolly-step h3 {
  font-family: var(--font-serif);
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0 0 0.5em;
}
.scrolly-step p { margin: 0 0 0.8em; }
@media (min-width: 900px) {
  .story-scrolly {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 40px 48px;
    align-items: start;
  }
  .scrolly-sticky {
    min-height: calc(100vh - 104px);
    min-height: calc(100svh - 104px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 12px 8px 0;
    background: transparent;
  }
  .scrolly-sticky::before { content: none; }
  .scrolly-sticky .story-chart-frame { padding: 22px 20px 18px; }
  .scrolly-sticky .line-chart { height: 320px; }
  .scrolly-steps { margin: 0; max-width: none; }
  .scrolly-step {
    min-height: calc(100vh - 104px);
    min-height: calc(100svh - 104px);
    padding: 12vh 0;
    padding: 12svh 0;
  }
}

.story-posts { max-width: none; margin: 1.6em 0 2.4em; }
.story-posts .post-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.story-posts .post-card .thumb { aspect-ratio: 9 / 16; }
.story-body .story-posts .post-card,
.story-body .story-posts .post-card .over-kicker,
.story-body .story-posts .post-card .handle,
.story-body .story-posts .post-card .snippet {
  text-decoration: none;
}
@media (max-width: 800px) {
  .story-posts .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-posts .post-grid .post-card:nth-child(n + 3) { display: none; }
}
.story-ex-label {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.story-exit { margin: 3.5em 0 1em; }
.story-exit-kicker { margin: 0 0 14px; }
.story-exit-grid { display: grid; gap: 12px; }
@media (min-width: 800px) {
  .story-exit-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.story-exit .puff {
  margin: 0;
  min-height: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
}
.story-exit .puff-copy { flex: 1; }
.story-exit .puff p:not(.puff-title) { max-width: none; }
.story-exit .puff-cta { align-self: flex-end; }

.trend-ticker {
  margin: 0 0 16px;
  padding: 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-1);
  overflow: hidden;
}
.trend-ticker-kicker {
  margin: 0 16px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trend-ticker-viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.trend-ticker-track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: trend-ticker 42s linear infinite;
}
.trend-ticker:hover .trend-ticker-track,
.trend-ticker.is-static .trend-ticker-track { animation-play-state: paused; }
.trend-ticker.is-static .trend-ticker-track { animation: none; }
.trend-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px 0 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.trend-ticker-item + .trend-ticker-item {
  border-left: 1px solid var(--border);
}
.trend-ticker-item .party-logo { width: 18px; height: 18px; }
.trend-ticker-item strong { font-weight: 700; }
@keyframes trend-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.trend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.trend-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 16px;
}
.trend-kpis[hidden],
.trend-gauges[hidden] { display: none !important; }
.trend-gauges .post-kpi-gauge { max-width: 220px; }
.trend-kpi {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px 14px;
  min-width: 0;
}
.trend-kpi-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trend-kpi-title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
}
.trend-kpi-title .party-logo { width: 18px; height: 18px; flex: 0 0 auto; }
.trend-kpi-value {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.trend-kpi-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.trend-today-grid { margin-top: 4px; }
.trend-delta--up { color: var(--color-signal-blue); }
.trend-delta--down { color: var(--color-intellecta-red); }
@media (max-width: 900px) {
  .trend-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .trend-kpis,
  .trend-gauges { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-row, .p-row, .scrolly-step { transition: none; }
  .scroll-hint span { animation: none; }
  .trend-ticker-track { animation: none; }
  .story-hscroll.is-hscroll .hscroll-pin { position: static; overflow: visible; }
  .story-hscroll.is-hscroll .tema-andel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    transform: none !important;
  }
}
