/* Plakaten for /skvip — the engagement board.
   Split out of skvip/index.html, which was 1842 lines: 924 of CSS, 803 of
   script and the markup in between. Every other data-driven page on the site
   had already made this split (/plakaten has plakaten/app.js, /film has
   film/app.js); this was the one that never did. */

  :root {
    --bg: #130f18;
    --panel: #241827;
    --panel-2: rgba(40, 27, 43, 0.78);
    --ink: #fff3e2;
    --muted: #b8a9b8;
    --line: #4a344f;
    --brass: #ffd166;
    --accent: #ff8a5b;
    --fav: #ffd166;
    --boost: #5ee6a8;
    --reply: #f19ac0;
    --total: #7cc4ff;
    --violet: #b990ff;
    --cyan: #71e0ff;
    --shadow: rgba(0, 0, 0, 0.42);
    --page: min(1120px, calc(100% - 28px));
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; min-height: 100%; }

  body {
    color: var(--ink);
    background:
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 42px),
      radial-gradient(90% 44% at 50% -8%, rgba(74, 36, 56, 0.62) 0%, rgba(74, 36, 56, 0) 58%),
      linear-gradient(180deg, #1d1420 0%, var(--bg) 100%);
    font: 15px/1.5 Inter, system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
  }

  a { color: var(--brass); }
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  summary:focus-visible {
    outline: 3px solid var(--brass);
    outline-offset: 3px;
  }

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

  svg { display: block; width: 100%; height: auto; overflow: visible; }

  .topbar {
    width: var(--page);
    margin: 0 auto;
    padding: 16px 0 0;
    display: flex;
    gap: 18px;
    align-items: center;
    position: relative;
    z-index: 5;
  }

  .topbar a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0 4px;
    color: #c9b48d;
    text-decoration: none;
    font-size: 0.86rem;
    transition: color 0.2s;
  }

  .topbar a:hover { color: var(--brass); }

  .masthead {
    width: var(--page);
    margin: 0 auto;
    padding: 18px 0 12px;
  }

  .plaque {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(202, 164, 90, 0.35);
    border-radius: 14px;
    background:
      linear-gradient(135deg, rgba(255, 138, 91, 0.22), transparent 38%),
      linear-gradient(215deg, rgba(124, 196, 255, 0.16), transparent 36%),
      linear-gradient(180deg, rgba(65, 35, 48, 0.72), rgba(34, 22, 37, 0.46));
    padding: 20px 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .plaque::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--brass);
  }

  .eyebrow {
    margin: 0 0 5px;
    font: 600 11px/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
  }

  h1 {
    margin: 0;
    color: #f7ecd6;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(38px, 8vw, 68px);
    font-weight: 600;
    line-height: 0.94;
    letter-spacing: 0;
  }

  .sub {
    margin: 12px 0 0;
    max-width: 72ch;
    color: #d8c3a4;
    font-size: 15px;
    line-height: 1.5;
  }

  main {
    width: var(--page);
    margin: 0 auto;
    padding: 10px 0 40px;
    display: grid;
    gap: 16px;
  }

  main > * { min-width: 0; }

  .panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    box-shadow: 0 14px 40px var(--shadow);
    backdrop-filter: blur(7px);
  }

  .controls {
    min-width: 0;
    padding: 0;
    overflow: visible;
  }

  .controls summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    list-style: none;
    cursor: pointer;
  }

  .topbar .controls {
    margin-left: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    position: relative;
  }

  .topbar .controls[open] summary {
    position: relative;
    z-index: 7;
  }

  .controls summary::-webkit-details-marker { display: none; }

  .settings-title {
    display: inline-flex;
    align-items: center;
  }

  .settings-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 14, 9, 0.72);
    color: var(--brass);
    font-size: 18px;
    line-height: 1;
  }

  .settings-current {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .settings-body {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(520px, calc(100vw - 28px));
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(31, 20, 35, 0.98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.56);
  }

  .control-group {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }

  .field {
    min-width: 0;
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  input[type="date"] {
    min-height: 44px;
    color: var(--ink);
    background: #120e09;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 9px;
    font: 500 14px/1 Inter, system-ui, sans-serif;
    color-scheme: dark;
  }

  input[type="date"]:focus { border-color: var(--accent); }

  .preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
  }

  .preset {
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 14, 9, 0.74);
    color: #dfd0ba;
  }

  .preset:hover {
    border-color: var(--brass);
    color: var(--ink);
  }

  .segmented {
    min-width: 0;
    display: inline-grid;
    grid-template-columns: repeat(4, minmax(84px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--line);
  }

  button {
    min-width: 0;
    min-height: 44px;
    border: 0;
    background: var(--panel);
    color: var(--muted);
    font: 700 12px/1 Inter, system-ui, sans-serif;
    cursor: pointer;
  }

  button[aria-pressed="true"] {
    color: #1a1008;
    background: var(--active, var(--accent));
  }

  .toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

  .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(36, 24, 39, 0.76);
  }

  .stat {
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
  }

  .stat:last-child { border-right: 0; }

  .stat b {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 600;
    line-height: 1;
  }

  .stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .story-panel {
    overflow: hidden;
    padding: 0;
    background:
      linear-gradient(135deg, rgba(255, 209, 102, 0.2), transparent 34%),
      linear-gradient(225deg, rgba(124, 196, 255, 0.16), transparent 34%),
      rgba(36, 24, 39, 0.84);
  }

  .story-intro {
    display: grid;
    gap: 6px;
    padding: 18px 18px 0;
    margin-bottom: 10px;
  }

  .story-intro h2 {
    margin: 0;
    color: #fff7e8;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.08;
  }

  .story-lede {
    margin: 0;
    color: #dfcfbc;
    font-size: 13px;
    line-height: 1.5;
  }

  .story-grid {
    padding: 0 18px 18px;
  }

  .story-card {
    min-width: 0;
    min-height: 210px;
    display: grid;
    align-content: center;
    padding: clamp(22px, 5vw, 44px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
      rgba(18, 13, 20, 0.62);
  }

  .story-kicker {
    margin: 0 0 8px;
    color: var(--brass);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .story-card h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(54px, 13vw, 128px);
    font-weight: 600;
    line-height: 0.9;
  }

  .story-card p {
    margin: 0;
    color: #d9cbbb;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.18;
  }

  .story-card b { color: #fff7e8; }

  .story-link {
    display: inline-flex;
    width: max-content;
    margin-top: 18px;
    color: var(--brass);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
  }

  .story-link:hover { color: var(--ink); }

  .detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .detail-button {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 13, 20, 0.74);
    color: #f0dfc8;
  }

  .detail-button:hover {
    border-color: var(--brass);
    color: var(--ink);
  }

  .chart,
  .leader,
  .rank-panel {
    padding: 16px 18px 18px;
  }

  .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    margin-bottom: 10px;
  }

  .chart h2,
  .leader h2,
  .rank-panel h2 {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .panel-subtitle {
    margin: 0;
    color: #d8c9b8;
    font-size: 12px;
    line-height: 1.4;
  }

  .chart-summary {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
  }

  .chart-summary b { color: var(--ink); }

  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c);
  }

  .grid-line { stroke: rgba(202, 164, 90, 0.16); stroke-width: 1; }
  .axis-text { fill: #d6c8b4; font: 500 12px Inter, system-ui, sans-serif; }
  .axis-label { fill: var(--muted); font: 700 12px Inter, system-ui, sans-serif; }
  .axis-title { fill: #c8b8c7; font: 700 11px Inter, system-ui, sans-serif; letter-spacing: 0.08em; }
  .trend-line { fill: none; stroke: var(--active, var(--accent)); stroke-width: 2.5; }
  .trend-area { fill: var(--active, var(--accent)); opacity: 0.14; }
  .peak-value { fill: var(--fav); font: 700 13px Inter, system-ui, sans-serif; }
  .peak-date { fill: var(--muted); font: 600 12px Inter, system-ui, sans-serif; }
  .scatter-dot { cursor: pointer; }
  .scatter-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .rank-list {
    display: grid;
    gap: 9px;
  }

  .bar-head,
  .bar-row {
    display: grid;
    grid-template-columns: minmax(122px, 1fr) minmax(66px, 0.8fr) minmax(56px, 0.42fr) minmax(50px, 0.36fr);
    gap: 9px;
    align-items: center;
  }

  .bar-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .bar-row {
    color: var(--ink);
    font-size: 13px;
  }

  button.bar-row {
    width: 100%;
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }

  button.bar-row[aria-pressed="true"] {
    background: transparent;
  }

  button.bar-row:hover .bar-label,
  button.bar-row:focus-visible .bar-label,
  button.bar-row[aria-pressed="true"] .bar-label {
    color: var(--brass);
  }

  button.bar-row:focus-visible {
    outline: 2px solid var(--active, var(--accent));
    outline-offset: 3px;
    border-radius: 6px;
  }

  .bar-label {
    min-width: 0;
    overflow: visible;
    color: #dfd0ba;
    font-weight: 700;
    white-space: nowrap;
  }

  .bar-track {
    min-width: 0;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
  }

  .bar-fill {
    display: block;
    width: var(--w);
    height: 100%;
    border-radius: 999px;
    background: var(--active, var(--accent));
  }

  .bar-value,
  .bar-posts {
    color: var(--muted);
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  .bar-value { color: #d4c4aa; }

  .rows {
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 9px;
  }

  .leader-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: rgba(31, 26, 19, 0.9);
  }

  .leader-table thead tr,
  .leader-table tbody tr {
    display: grid;
    grid-template-columns: 44px 1fr 70px 70px 70px 70px;
    gap: 10px;
  }

  .leader-table thead tr {
    padding: 0 12px;
    background: rgba(18, 14, 9, 0.72);
  }

  .leader-table tbody tr {
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    background: rgba(31, 26, 19, 0.9);
  }

  .leader-table th,
  .leader-table td {
    min-width: 0;
    border-bottom: 1px solid var(--line);
    padding: 0;
    vertical-align: middle;
  }

  .leader-table td {
    display: flex;
    align-items: center;
  }

  .leader-table tbody tr:last-child td { border-bottom: 0; }
  .leader-table tbody tr:hover { background: rgba(53, 42, 29, 0.95); }

  .leader-table td:nth-child(n+3) { justify-content: flex-end; }

  .sort-button {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    text-align: right;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .leader-table th:nth-child(2) .sort-button {
    justify-content: flex-start;
    text-align: left;
  }

  .sort-button[aria-pressed="true"] {
    background: transparent;
    color: var(--active, var(--accent));
  }

  .sort-button::after {
    content: "↕";
    width: 1.1em;
    color: #6f6253;
    font-size: 10px;
  }

  .sort-button[data-dir="asc"]::after { content: "↑"; color: var(--active, var(--accent)); }
  .sort-button[data-dir="desc"]::after { content: "↓"; color: var(--active, var(--accent)); }

  .rank,
  .num {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
  }

  .label {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-decoration: none;
  }

  .label:hover { color: var(--brass); }

  .leader-cards {
    display: none;
    gap: 8px;
    background: rgba(31, 26, 19, 0.9);
  }

  .leader-card {
    display: grid;
    gap: 7px;
    padding: 13px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
  }

  .leader-card:last-child { border-bottom: 0; }
  .leader-card:hover { background: rgba(53, 42, 29, 0.95); }

  .leader-card-head {
    display: flex;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .leader-card-label {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.35;
  }

  .leader-card-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 13px;
    font-weight: 800;
  }

  .num[data-kind="fav"] { color: var(--fav); }
  .num[data-kind="boost"] { color: var(--boost); }
  .num[data-kind="reply"] { color: var(--reply); }
  .num[data-kind="total"] { color: var(--total); }

  .empty {
    padding: 16px;
    color: var(--muted);
    background: rgba(31, 26, 19, 0.9);
    font-size: 13px;
  }

  .footer-note {
    padding: 15px 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }

  .footer-note a {
    color: var(--brass);
    font-weight: 700;
    text-decoration: none;
  }

  .footer-note a:hover { color: var(--ink); }

  .tooltip {
    position: fixed;
    z-index: 20;
    max-width: min(330px, calc(100vw - 28px));
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(13, 10, 6, 0.96);
    box-shadow: 0 18px 44px var(--shadow);
    color: var(--ink);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 14px));
    transition: opacity 120ms ease;
  }

  .tooltip[data-show="true"] { opacity: 1; }
  .tip-title { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
  .tip-counts { display: flex; gap: 12px; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
  .tip-label { color: var(--ink); font-size: 13px; line-height: 1.35; }

  dialog {
    width: min(1040px, calc(100vw - 28px));
    max-height: min(86vh, 900px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #1e1421;
    color: var(--ink);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62);
  }

  dialog::backdrop {
    background: rgba(10, 7, 12, 0.72);
    backdrop-filter: blur(4px);
  }

  .modal-shell {
    display: grid;
    max-height: inherit;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(36, 24, 39, 0.92);
  }

  .modal-head h2 {
    margin: 0;
    color: var(--ink);
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(25px, 4vw, 38px);
    line-height: 1.05;
  }

  .modal-head p {
    margin: 6px 0 0;
    color: #d8c9b8;
    font-size: 13px;
    line-height: 1.45;
  }

  .modal-close {
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 13, 20, 0.74);
    color: var(--ink);
    font-size: 20px;
  }

  .modal-body {
    min-width: 0;
    overflow: auto;
    padding: 18px 20px 20px;
  }

  .modal-body .chart,
  .modal-body .rank-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  @media (max-width: 840px) {
    .settings-body,
    .story-intro { grid-template-columns: 1fr; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .leader-table { display: none; }
    .leader-cards { display: grid; }
  }

  @media (max-width: 640px) {
    :root { --page: calc(100% - 18px); }
    .plaque { padding: 18px; }
    .segmented { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field { width: 100%; }
    input[type="date"] { width: 100%; }
    .story-grid { grid-template-columns: 1fr; }
  }

/* Skip-to-content link (WCAG 2.4.1) — local copy; this page does not load shared.css. */
  /* Skip-to-content link (WCAG 2.4.1) — local copy; this page does not load shared.css. */
  .skip-link { position: fixed; top: -100%; left: 0.75rem; z-index: 1000; padding: 0.65rem 1.1rem;
    background: #04170c; color: #f4ffe8; border: 2px solid #d8ff4f; border-radius: 0.5rem;
    font-weight: 600; text-decoration: none; font-family: system-ui, sans-serif; }
  .skip-link:focus { top: 0.75rem; }
