@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/fraunces-wght.woff2') format('woff2-variations'),
         url('/static/fonts/fraunces-wght.woff2') format('woff2');
  }
  @font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/fraunces-wght-italic.woff2') format('woff2-variations'),
         url('/static/fonts/fraunces-wght-italic.woff2') format('woff2');
  }

  :root {
    --ground: #f6f4ee;
    --card: #ffffff;
    --border: rgba(21, 24, 33, 0.06);
    --rule: rgba(21, 24, 33, 0.08);
    --rule-soft: rgba(21, 24, 33, 0.04);
    --hover-wash: rgba(245, 158, 11, 0.05);
    --shadow: 0 1px 2px rgba(21, 24, 33, 0.04), 0 6px 16px rgba(21, 24, 33, 0.04);
    --shadow-lift: 0 1px 2px rgba(21, 24, 33, 0.05), 0 12px 28px rgba(21, 24, 33, 0.06);

    --text: #151821;
    --text-2: #4a4f60;
    --text-3: #8a8fa1;
    --text-4: #c7cad4;

    --violet: #8b5cf6;
    --violet-soft: rgba(139, 92, 246, 0.12);
    --violet-deep: #6d28d9;
    --pink: #ec4899;
    --pink-soft: rgba(236, 72, 153, 0.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --amber-warm: #b45309;
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.12);
    --emerald-text: #047857;
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);
    --red-text: #b91c1c;
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.12);
    --blue-text: #1d4ed8;
    --warn-text: #b45309;
    --slate-soft: rgba(21, 24, 33, 0.06);

    --nav-active: #151821;

    --serif: 'Fraunces', 'Iowan Old Style', Charter, 'Source Serif Pro', Georgia, serif;
    --prose: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  }

  * { box-sizing: border-box; }
  html, body {
    background: var(--ground); color: var(--text); margin: 0;
  }
  body {
    font-family: var(--prose);
    font-size: 14px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  a { color: inherit; text-decoration: none; }
  .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .mono { font-family: var(--mono); }

  /* ------- shell ------- */
  .shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 20px 24px 12px;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
  }

  /* ------- sidebar ------- */
  aside.sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px 14px 14px;
    display: flex; flex-direction: column;
    position: sticky; top: 12px;
    height: calc(100vh - 36px);
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 6px 18px;
  }
  .brand-mark {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
  }
  .brand-mark svg { display: block; width: 100%; height: 100%; }
  .brand-name {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 24, "SOFT" 30;
    line-height: 1;
    padding-top: 2px;
  }

  .flux-picker {
    display: flex; flex-direction: column; gap: 4px;
    padding: 2px 4px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--rule);
  }
  .flux-label {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
    padding-left: 4px;
  }
  .flux-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--ground);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    padding: 7px 26px 7px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
    transition: border-color 120ms, box-shadow 120ms;
  }
  .flux-select:hover { border-color: var(--text-3); }
  .flux-select:focus-visible {
    outline: 0;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  }

  nav.nav-main { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--text-2);
    font-size: 13.5px; font-weight: 500;
    cursor: pointer;
    transition: background 120ms, color 120ms;
  }
  .nav-item:hover { background: rgba(15, 23, 42, 0.04); color: var(--text); }
  .nav-item:focus-visible {
    outline: 0;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
  }
  .nav-item.active {
    background: var(--nav-active);
    color: #ffffff;
  }
  .nav-item.active .nav-ico { color: #ffffff; }
  .nav-ico {
    width: 18px; height: 18px; flex: none;
    color: var(--text-3);
  }
  .nav-item:hover .nav-ico { color: var(--text-2); }
  .nav-label { flex: 1; }
  .nav-badge {
    font-family: var(--mono);
    font-size: 10.5px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-2);
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: 0.01em;
  }
  .nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }
  /* Hot badge — pending-triage count on the Today link. Violet fill so the
     number actually pops in the sidebar. */
  .nav-badge.nav-badge-hot {
    background: var(--violet);
    color: #ffffff;
    font-weight: 600;
    padding: 2px 7px;
  }
  .nav-item.active .nav-badge.nav-badge-hot {
    background: #ffffff;
    color: var(--violet);
  }
  .nav-kbd {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--text-3);
    border: 1px solid var(--border);
    background: var(--ground);
    padding: 0px 5px;
    border-radius: 4px;
    line-height: 1.45;
  }
  .nav-item.active .nav-kbd {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
  }
  .nav-rule {
    height: 1px; background: var(--rule);
    margin: 10px 8px;
  }

  .sidebar-spacer { flex: 1; }

  .promo-card {
    border-radius: 14px;
    padding: 14px;
    background:
      radial-gradient(circle at 0% 0%, rgba(236, 72, 153, 0.22) 0%, transparent 60%),
      radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.28) 0%, transparent 65%),
      linear-gradient(180deg, #f5f3ff 0%, #fdf2f8 100%);
    border: 1px solid rgba(139, 92, 246, 0.18);
    position: relative;
    overflow: hidden;
  }
  .promo-card::before {
    content: '';
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c084fc 0%, #ec4899 100%);
    opacity: 0.6;
    filter: blur(8px);
  }
  .promo-title {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: #6d28d9;
    margin-bottom: 6px;
    position: relative;
  }
  .promo-value {
    font-family: var(--mono);
    font-size: 22px; font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
  }
  .promo-sub {
    font-size: 12px; color: var(--text-2);
    margin-top: 4px;
    position: relative;
  }
  .promo-link {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px;
    font-size: 11.5px; color: #7c3aed; font-weight: 500;
    position: relative;
  }
  .promo-link:hover { color: #6d28d9; }

  /* ------- main ------- */
  main.main { min-width: 0; }

  .topbar {
    display: flex; align-items: center; gap: 18px;
    padding: 10px 4px 22px;
  }
  .topbar-titles { flex: 1; min-width: 0; }
  .topbar h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: 28px; font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-variation-settings: "opsz" 30, "SOFT" 30;
    text-wrap: balance;
  }
  .topbar .subtitle {
    margin-top: 5px;
    font-size: 12px; color: var(--text-3);
    font-family: var(--mono);
    letter-spacing: 0.01em;
  }
  .subtitle-pill {
    display: inline-block;
    background: none;
    border: 0;
    padding: 1px 4px;
    margin: 0 -3px;
    border-radius: 5px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background 120ms, color 120ms;
  }
  .subtitle-pill:hover { background: rgba(15, 23, 42, 0.06); color: var(--text-2); }
  .subtitle-pill.on { background: var(--violet-soft); color: #6d28d9; }
  .subtitle-pill:focus-visible { outline: 0; box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35); }
  .topbar .subtitle .live-dot {
    display: inline-block;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 3px var(--emerald-soft);
    margin-right: 6px;
    transform: translateY(-1px);
    animation: pulse 2.6s ease-in-out infinite;
  }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--emerald-soft); }
    50% { box-shadow: 0 0 0 5px rgba(16,185,129,0.04); }
  }

  .topbar-actions { display: flex; align-items: center; gap: 10px; }
  .search-box {
    display: flex; align-items: center; gap: 8px;
    background: rgba(15, 23, 42, 0.045);
    border-radius: 10px;
    padding: 0 12px;
    height: 36px;
    width: 280px;
    transition: background 120ms, box-shadow 120ms;
  }
  .search-box:focus-within {
    background: var(--card);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2), 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  .search-box svg { color: var(--text-3); flex: none; }
  .search-box input {
    flex: 1; background: transparent; border: 0; outline: 0;
    font-family: var(--prose); font-size: 13px;
    color: var(--text);
  }
  .search-box input::placeholder { color: var(--text-3); }
  .search-box .kbd {
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1px 5px; border-radius: 4px;
  }
  .icon-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.045);
    border: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    position: relative;
    flex: none;
  }
  .icon-btn:hover { background: rgba(15, 23, 42, 0.08); color: var(--text); }
  .icon-btn .dot-red {
    position: absolute; top: 8px; right: 8px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--pink);
    border: 2px solid var(--ground);
  }
  .user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 36px;
    box-shadow: var(--shadow);
  }
  .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 600;
  }
  .user-chip .user-name {
    font-size: 13px; font-weight: 500; color: var(--text);
  }

  /* ------- card ------- */
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px;
    gap: 12px;
  }
  .card-body { padding: 0 18px 18px; }
  .card-title {
    font-size: 13px; font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .card-action {
    font-size: 11.5px; color: var(--text-3);
    font-family: var(--mono);
  }
  .card-action a { color: var(--violet); font-weight: 500; }
  .card-action a:hover { text-decoration: underline; }

  /* ------- grid ------- */
  .grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }
  .col-12 { grid-column: span 12; }
  .col-8 { grid-column: span 8; }
  .col-7 { grid-column: span 7; }
  .col-5 { grid-column: span 5; }
  .col-4 { grid-column: span 4; }

  .settings-input {
    width: 100%; box-sizing: border-box;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px; height: 36px; padding: 0 11px;
    font: inherit; font-size: 13.5px; color: var(--text);
    transition: border-color 120ms, background 120ms, box-shadow 120ms;
  }
  .settings-input:focus {
    outline: 0;
    background: var(--card);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
  }
  .settings-submit {
    align-self: flex-start;
    background: var(--text); color: #fff;
    border: 0; border-radius: 8px;
    height: 34px; padding: 0 16px;
    font: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer; margin-top: 2px;
  }
  .settings-submit:hover { background: #0b1220; }

  /* ------- search empty state ------- */
  .search-empty { padding: 48px 32px 56px; max-width: 640px; margin: 0 auto; }
  .search-empty-title {
    font-size: 18px; font-weight: 600; color: var(--text);
    letter-spacing: -0.01em;
  }
  .search-empty-sub {
    margin-top: 6px;
    font-size: 13px; color: var(--text-3); line-height: 1.5;
  }
  .search-empty-row {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px; margin-top: 22px;
  }
  .search-empty-label {
    font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-3); font-weight: 600;
    min-width: 50px;
  }
  .search-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    background: rgba(15, 23, 42, 0.045);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    font-size: 12.5px; color: var(--text-2);
    font-family: var(--mono);
    transition: background 120ms, color 120ms, border-color 120ms;
  }
  .search-chip:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    color: var(--violet);
  }
  .search-chip.topic { font-family: var(--prose); }
  .search-chip .sq { width: 8px; height: 8px; border-radius: 2px; flex: none; }

  /* ------- pills ------- */
  .pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.4;
    letter-spacing: 0.02em;
  }
  .pill.live    { background: var(--emerald-soft); color: var(--emerald-text); }
  .pill.warn    { background: var(--amber-soft); color: var(--warn-text); }
  .pill.fail    { background: var(--red-soft); color: var(--red-text); }
  .pill.off     { background: var(--slate-soft); color: var(--text-2); }
  .pill.info    { background: var(--blue-soft); color: var(--blue-text); }
  .pill.violet  { background: var(--violet-soft); color: #6d28d9; }
  .pill .pd { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
  .pill.live .pd { background: var(--emerald); }
  .pill.warn .pd { background: var(--amber); }
  .pill.fail .pd { background: var(--red); }
  .pill.off  .pd { background: var(--text-3); }
  .pill.info .pd { background: var(--blue); }

  /* ------- ingestion tile ------- */
  .ingestion-body { padding: 0 18px 18px; }
  .ingestion-stat {
    display: flex; align-items: baseline; gap: 14px;
    margin-bottom: 4px;
  }
  .ingestion-stat .big-num {
    font-family: var(--mono); font-size: 36px; font-weight: 600;
    letter-spacing: -0.02em; color: var(--text); line-height: 1;
  }
  .ingestion-stat .trend {
    font-size: 12px; color: var(--emerald-text); font-weight: 500;
    background: var(--emerald-soft);
    padding: 2px 7px; border-radius: 6px;
    font-family: var(--mono);
  }
  .ingestion-pills {
    display: flex; gap: 8px;
    margin-top: 8px;
  }
  .stat-chip {
    display: inline-flex; flex-direction: column;
    background: rgba(15, 23, 42, 0.035);
    padding: 6px 12px;
    border-radius: 8px;
    min-width: 88px;
  }
  .stat-chip .lbl {
    font-size: 10.5px; color: var(--text-3);
    letter-spacing: 0.04em; text-transform: uppercase;
    font-weight: 500;
  }
  .stat-chip .val {
    font-family: var(--mono); font-size: 14px;
    color: var(--text); font-weight: 600;
    margin-top: 2px;
  }
  .stat-chip.accent .val { color: var(--violet); }
  .ingestion-chart {
    margin-top: 6px;
    width: 100%;
  }
  .ingestion-chart svg { display: block; width: 100%; height: 130px; }

  /* ------- ring (budget) ------- */
  .ring-card .card-body {
    padding: 0 18px 18px;
    display: flex; align-items: center; gap: 16px;
  }
  .ring-wrap {
    width: 96px; height: 96px;
    flex: none;
    position: relative;
  }
  .ring-wrap svg { transform: rotate(-90deg); }
  .ring-center {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
  }
  .ring-center .ring-pct {
    font-family: var(--mono); font-size: 18px; font-weight: 600;
    color: var(--text); letter-spacing: -0.02em;
  }
  .ring-center .ring-sub {
    font-size: 10px; color: var(--text-3);
    letter-spacing: 0.04em; text-transform: uppercase;
    margin-top: 1px;
  }
  .ring-meta { flex: 1; min-width: 0; }
  .ring-meta .ring-num {
    font-family: var(--mono); font-size: 26px; font-weight: 600;
    color: var(--text); letter-spacing: -0.02em; line-height: 1;
  }
  .ring-meta .ring-cap {
    font-family: var(--mono); font-size: 11.5px;
    color: var(--text-3); margin-top: 4px;
  }
  .ring-meta .ring-breakdown {
    margin-top: 10px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .ring-meta .ring-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px;
    font-family: var(--mono);
    color: var(--text-2);
  }
  .ring-meta .ring-row .dot {
    width: 7px; height: 7px; border-radius: 50%;
    display: inline-block; margin-right: 6px;
  }
  .ring-meta .ring-row.mini .dot { background: var(--violet); }
  .ring-meta .ring-row.full .dot { background: var(--pink); }
  .ring-meta .ring-row .v { color: var(--text); font-weight: 600; }

  /* ------- donut ------- */
  .donut-card .card-body {
    padding: 4px 18px 18px;
    display: flex; align-items: center; gap: 14px;
  }
  .donut-wrap {
    width: 132px; height: 132px;
    flex: none; position: relative;
  }
  .donut-center {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
  }
  .donut-center .donut-num {
    font-family: var(--mono); font-size: 22px; font-weight: 600;
    color: var(--text); letter-spacing: -0.02em; line-height: 1;
  }
  .donut-center .donut-lbl {
    font-size: 10px; color: var(--text-3);
    letter-spacing: 0.04em; text-transform: uppercase;
    margin-top: 2px;
  }
  .donut-legend { flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 8px; }
  .legend-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 12.5px;
  }
  .legend-row .sq {
    width: 10px; height: 10px; border-radius: 3px;
  }
  .legend-row .name { color: var(--text); font-weight: 500; }
  .legend-row .pct {
    font-family: var(--mono); color: var(--text-2); font-size: 12px;
  }
  .legend-row .delta {
    grid-column: 2 / 4;
    margin-top: -2px;
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3);
  }
  .legend-row .delta.up { color: var(--emerald-text); }
  .legend-row .delta.down { color: var(--red-text); }

  .topic-spark {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    height: 44px;
    margin-top: 8px;
    align-items: end;
  }
  .topic-spark-col { position: relative; height: 100%; }
  .topic-spark-track {
    position: absolute; inset: 0;
    border-radius: 3px;
    opacity: 0.08;
  }
  .topic-spark-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    border-radius: 3px;
    min-height: 3px;
  }
  .topic-spark-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-3);
    text-align: center;
  }

  .item-rationale {
    margin-top: 20px;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--violet);
    border-radius: 0 6px 6px 0;
  }
  .item-rationale-label {
    font-size: 10.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--violet);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .item-rationale-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
  }

  .entity-grid {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .entity-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: start;
  }
  .entity-label {
    font-size: 12px;
    color: var(--text-3);
    padding-top: 4px;
  }
  .entity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .entity-chip {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-soft, rgba(15,23,42,0.04));
    color: var(--text);
    border: 1px solid var(--rule);
  }

  .meta-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px 14px;
    font-size: 13px;
    align-items: baseline;
    padding-top: 4px;
  }
  .meta-k { color: var(--text-3); font-size: 12px; }
  .meta-v { color: var(--text); word-break: break-word; }
  .meta-v.mono, .meta-v .mono { font-family: var(--mono); font-size: 12.5px; }
  .meta-v .score { color: var(--violet); font-weight: 600; font-family: var(--mono); }
  .meta-link { color: var(--violet); font-weight: 500; }
  .meta-link:hover { text-decoration: underline; }

  .open-source-btn {
    display: block;
    margin-top: 16px;
    padding: 9px 12px;
    background: var(--text);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
  }
  .open-source-btn:hover { opacity: 0.9; }

  .sq.security    { background: var(--amber); }
  .sq.ai-llm      { background: var(--violet); }
  .sq.market { background: var(--pink); }

  /* ------- classifier health tile ------- */
  /* Cards in the same row share row-height; without flex-grow on the body
     the content clusters at the top and the rest is dead air. */
  .col-4.card { display: flex; flex-direction: column; }
  .col-4.card > .card-body,
  .col-4.card > .health-body { flex: 1; display: flex; flex-direction: column; }
  .health-body { padding: 0 18px 18px; flex: 1; display: flex; flex-direction: column; }
  .health-big {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 10px;
  }
  .health-big .num {
    font-family: var(--mono); font-size: 30px; font-weight: 600;
    color: var(--text); letter-spacing: -0.02em; line-height: 1;
  }
  .health-big .pct-sub {
    font-size: 12px; color: var(--text-3); font-family: var(--mono);
  }
  .h-bar {
    position: relative;
    height: 8px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
  }
  .h-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--violet) 0%, var(--pink) 100%);
    border-radius: 999px;
  }
  .health-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--mono); font-size: 11.5px;
    color: var(--text-2);
    margin-top: auto;        /* anchor to bottom of card */
    padding-top: 12px;
    border-top: 1px solid var(--rule-soft);
  }
  .health-spark {
    margin-top: 6px;
    padding: 10px 12px 12px;
    background: rgba(15, 23, 42, 0.025);
    border: 1px solid var(--rule-soft);
    border-radius: 10px;
  }
  .health-spark-label {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 6px;
  }
  .heartbeat-mini {
    display: flex; align-items: flex-end; gap: 4px; height: 36px;
  }
  .heartbeat-mini span {
    flex: 1;
    background: linear-gradient(180deg, var(--violet) 0%, var(--pink) 100%);
    border-radius: 2px;
    opacity: 0.7;
    min-height: 3px;
  }
  .heartbeat-mini span.tall { height: 100%; opacity: 1; }
  .heartbeat-mini span.mid  { height: 55%; opacity: 0.85; }
  .heartbeat-mini span.lo   { height: 22%; opacity: 0.5; }

  /* ------- digest tile ------- */
  .digest-tile .card-body {
    padding: 0 18px 18px;
    flex: 1; display: flex; flex-direction: column;
  }
  .digest-state {
    font-family: var(--mono); font-size: 13px;
    color: var(--text-2);
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
  }
  .digest-state .v { color: var(--text); font-weight: 600; }
  .digest-subject {
    font-size: 13px; color: var(--text);
    font-weight: 500;
    margin: 8px 0 10px;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .digest-preview {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .digest-preview li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text);
  }
  .digest-preview a {
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .digest-preview a:hover { color: var(--violet); }
  .digest-preview .tdot {
    flex: none;
    width: 6px; height: 6px;
    border-radius: 2px;
    margin-top: 7px;
    background: var(--text-3);
  }
  .digest-preview .tdot.security    { background: var(--amber); }
  .digest-preview .tdot.ai-llm      { background: var(--violet); }
  .digest-preview .tdot.market { background: var(--pink); }
  .digest-counts {
    display: flex; gap: 12px;
    font-family: var(--mono); font-size: 11.5px;
    color: var(--text-2);
    margin-top: auto;        /* anchor to bottom of card */
    padding-top: 12px;
    border-top: 1px solid var(--rule-soft);
  }
  .digest-counts .c {
    display: inline-flex; align-items: center; gap: 5px;
  }
  .digest-counts .c .dot {
    width: 7px; height: 7px; border-radius: 2px;
  }
  .digest-counts .c.security .dot    { background: var(--amber); }
  .digest-counts .c.ai-llm .dot      { background: var(--violet); }
  .digest-counts .c.market .dot { background: var(--pink); }
  .digest-counts .c .v { color: var(--text); font-weight: 600; }

  /* ------- sources table ------- */
  .sources-controls {
    display: flex; gap: 8px; align-items: center;
  }
  .mini-input, .mini-select {
    background: rgba(15, 23, 42, 0.045);
    border: 1px solid transparent;
    border-radius: 8px;
    height: 30px;
    padding: 0 10px;
    font-family: var(--prose);
    font-size: 12.5px;
    color: var(--text);
    outline: 0;
    transition: background 120ms, border-color 120ms, box-shadow 120ms;
  }
  .mini-input:focus, .mini-select:focus {
    background: var(--card);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
  }
  .mini-input { width: 160px; }
  .mini-input::placeholder { color: var(--text-3); }
  .mini-select {
    appearance: none; -webkit-appearance: none;
    padding-right: 26px;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
      linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
  }

  .table-wrap { overflow-x: auto; }
  table.sources {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
  }
  table.sources thead th {
    position: sticky; top: 0;
    background: var(--card);
    color: var(--text-3);
    font-weight: 500;
    text-align: left;
    padding: 10px 18px;
    border-bottom: 1px solid var(--rule);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer; user-select: none;
    white-space: nowrap;
    font-family: var(--prose);
  }
  table.sources thead th .sort-ind {
    color: var(--text-4); margin-left: 4px; font-size: 9px;
  }
  table.sources thead th.active { color: var(--text); }
  table.sources thead th.active .sort-ind { color: var(--violet); }
  table.sources thead th.num-col, table.sources tbody td.num-col { text-align: right; }
  table.sources tbody tr {
    border-bottom: 1px solid var(--rule-soft);
    transition: background 100ms;
  }
  table.sources tbody tr:last-child { border-bottom: 0; }
  table.sources tbody tr:hover { background: rgba(245, 158, 11, 0.04); }
  table.sources tbody td {
    padding: 12px 18px;
    color: var(--text);
    white-space: nowrap;
    font-size: 13px;
    height: 44px;
  }
  td.src-name {
    display: flex; align-items: center; gap: 10px;
  }
  .kind-tag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 20px;
    border-radius: 5px;
    font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em;
  }
  .kind-tag.rss { background: var(--amber-soft); color: var(--warn-text); }
  .kind-tag.hn  { background: rgba(249, 115, 22, 0.12); color: #c2410c; }
  .kind-tag.x   { background: var(--slate-soft); color: var(--text-2); }
  td.dim-col { color: var(--text-2); font-family: var(--mono); font-size: 12.5px; }
  td.amber-num { color: var(--violet); font-family: var(--mono); font-weight: 600; font-size: 13px; }
  td .stale-time { color: var(--red-text); }
  tr.row-off td:not(.action-col) { color: var(--text-3); }
  tr.row-off td.src-name { color: var(--text-3); }
  tr.row-off .kind-tag { opacity: 0.55; }

  .rate-bar {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%; justify-content: flex-end;
  }
  .rate-bar .num {
    min-width: 38px; text-align: right;
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    color: var(--text);
  }
  .rate-bar .bar {
    flex: 1; height: 5px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    overflow: hidden;
    max-width: 80px;
  }
  .rate-bar .bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--violet) 0%, var(--pink) 100%);
    border-radius: 999px;
  }
  .rate-bar.low .bar > span {
    background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 100%);
  }

  .cap-note {
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3); margin-left: 6px;
  }

  /* ------- recent items ------- */
  .items-list .item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 14px 18px;
    border-top: 1px solid var(--rule-soft);
    align-items: start;
  }
  .items-list .item:first-child { border-top: 0; }
  .items-list .item:hover { background: var(--hover-wash); }
  .item-title {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 6px;
    font-weight: 500;
  }
  .item-title a:hover { color: var(--violet); }
  .item-meta {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11.5px;
    color: var(--text-3);
    flex-wrap: wrap;
  }
  .item-meta .sep { color: var(--text-4); }
  .item-meta .src { color: var(--text-2); }
  .item-meta .score { color: var(--violet); font-weight: 600; }
  .topic-chip {
    display: inline-block;
    font-size: 10.5px;
    font-family: var(--prose);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
  }
  .topic-chip.security    { background: var(--amber-soft); color: var(--warn-text); }
  .topic-chip.ai-llm      { background: var(--violet-soft); color: #6d28d9; }
  .topic-chip.market { background: var(--pink-soft); color: #be185d; }
  .flux-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
  }
  .flux-tag.flux-konvu { background: #f0fdf4; color: #15803d; border-color: #86efac; }
  .flux-tag.flux-hugo  { background: #eef2ff; color: #4338ca; border-color: #a5b4fc; }
  .item-rel {
    font-family: var(--mono); font-size: 11.5px;
    color: var(--text-3);
    text-align: right;
    white-space: nowrap;
  }
  .item-rel .v {
    display: inline-block;
    background: var(--violet-soft);
    color: #6d28d9;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
  }
  .item-rel .id { display: block; margin-top: 4px; color: var(--text-4); font-size: 10.5px; }

  /* ------- digest history (compact) ------- */
  .digest-history-list { padding: 4px 0 4px; }
  .digest-row {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 18px;
    border-top: 1px solid var(--rule-soft);
  }
  .digest-row:first-child { border-top: 0; }
  .digest-row:hover { background: rgba(15, 23, 42, 0.02); }
  .digest-date {
    font-family: var(--mono); font-size: 12px;
    color: var(--text); font-weight: 500;
  }
  .digest-date .dow { color: var(--text-3); margin-left: 4px; font-size: 10.5px; }
  .digest-mini-counts {
    display: flex; gap: 10px;
    font-family: var(--mono); font-size: 11px;
    color: var(--text-2);
  }
  .digest-mini-counts .c {
    display: inline-flex; align-items: center; gap: 4px;
  }
  .digest-mini-counts .c .dot {
    width: 6px; height: 6px; border-radius: 50%;
  }
  .digest-mini-counts .c.security .dot    { background: var(--amber); }
  .digest-mini-counts .c.ai-llm .dot      { background: var(--violet); }
  .digest-mini-counts .c.market .dot { background: var(--pink); }
  .digest-mini-counts .c .v { color: var(--text); font-weight: 600; }
  .digest-row.quiet .digest-mini-counts { color: var(--text-3); }
  .digest-row.quiet .digest-mini-counts .v { color: var(--text-3); font-weight: 500; }
  .digest-row.failed .digest-date { color: var(--red-text); }
  .digest-row.failed .digest-mini-counts { color: var(--text-3); }

  /* ------- responsive ------- */

  /* < 1280px — tighten layout but keep the two-col grid (8/4) */
  @media (max-width: 1280px) {
    .shell { padding: 12px; }
    .search-box { width: 220px; }
  }

  /* < 1100px — 8/4 tiles collapse to 12/6 (two equal halves) */
  @media (max-width: 1100px) {
    .col-8 { grid-column: span 12; }
    .col-7 { grid-column: span 12; }
    .col-5 { grid-column: span 12; }
    .col-4 { grid-column: span 6; }
    .search-box { width: 200px; }
  }

  /* < 900px — sidebar collapses to icon rail; cards become full-width */
  @media (max-width: 900px) {
    .shell { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; gap: 12px; }
    aside.sidebar { padding: 14px 8px; }
    .brand-name, .nav-label, .nav-badge, .nav-kbd, .nav-rule, .promo-card { display: none; }
    .brand { justify-content: center; padding: 2px 0 14px; }
    .nav-item { justify-content: center; padding: 10px; }
    .col-4 { grid-column: span 12; }
    .search-box { width: 160px; }
    .topbar h1 { font-size: 18px; }
    /* the user chip can crowd the search input — drop the name label */
    .user-chip .user-name { display: none; }
    .user-chip { padding: 4px; }
    /* digest tile counts wrap on narrow screens — let them */
    .digest-counts { flex-wrap: wrap; }
  }

  /* < 700px — true mobile. Sidebar drops to a top strip; topbar stacks. */
  @media (max-width: 700px) {
    .shell {
      grid-template-columns: minmax(0, 1fr);
      padding: 8px;
      gap: 12px;
    }
    aside.sidebar {
      position: static;
      height: auto;
      padding: 10px 12px;
      flex-direction: row;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
    }
    .brand { padding: 0; flex: none; }
    .sidebar-spacer { display: none; }
    nav.nav-main { flex-direction: row; flex: 1; gap: 4px; }
    .nav-item { padding: 6px 8px; }
    /* topbar — search drops below title on narrow phones */
    .topbar { flex-wrap: wrap; padding: 6px 4px 16px; }
    .topbar-actions { width: 100%; order: 2; }
    .search-box { width: 100%; flex: 1; }
    .icon-btn:nth-of-type(2) { display: none; }
    /* SVG charts should scale */
    .ingestion-chart svg { width: 100%; height: auto; }
    /* ring card stacks vertically */
    .ring-card .card-body { flex-direction: column; align-items: flex-start; }
    .ring-meta { width: 100%; }
    /* donut card stacks too */
    .donut-card .card-body { flex-direction: column; align-items: flex-start; }
    .donut-wrap { margin: 0 auto; }
  }

  /* ------- ring tile: ensure it fills its row partner ------- */
  .ring-card { display: flex; flex-direction: column; }
  .ring-card .card-body { flex: 1; }

  /* ------- today intel triage: single-card stack ------- */
  .intel-stack-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 48px;
  }
  .intel-counter {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--text-3, #94a3b8);
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .intel-counter .bar {
    width: 220px;
    height: 4px;
    background: var(--rule);
    border-radius: 3px;
    overflow: hidden;
  }
  .intel-counter .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), #a78bfa);
    border-radius: 3px;
    transition: width .35s cubic-bezier(.2,.7,.3,1);
  }
  .intel-counter-done {
    font-variant-numeric: tabular-nums;
  }
  .intel-stack {
    position: relative;
    width: min(680px, 100%);
    /* Height is set by JS to match the top card so the hint bar below never
       gets covered when the summary is long. --top-h is used by the deep
       cards to anchor their peek strip to the top card's bottom edge. */
  }
  .intel-card {
    position: absolute;
    inset: 0 0 auto 0;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 16px;
    padding: 22px 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 40px rgba(15, 23, 42, .08);
    z-index: calc(100 - var(--i));
    transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .28s ease, box-shadow .28s ease;
    pointer-events: none;
  }
  /* Only the top card is interactive. Deeper cards are silhouettes — their
     content is hidden so the reader isn't distracted by peek text. */
  .intel-stack > .intel-card:first-child {
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 20px 60px rgba(15, 23, 42, .1);
  }
  .intel-stack > .intel-card:not(:first-child) > * {
    visibility: hidden;
  }
  /* Deep cards render as thin strips whose top edge sits just below the
     top card's bottom — regardless of how tall the top card is. */
  .intel-stack > .intel-card:not(:first-child) {
    height: 44px;
    overflow: hidden;
    background: #fafafb;
    transform-origin: bottom center;
    transform:
      translateY(calc(var(--top-h, 340px) - 44px + var(--i) * 10px))
      scale(calc(1 - var(--i) * 0.02));
  }
  .intel-stack > .intel-card:nth-child(n+4) { display: none; }

  /* Exit animations — direction hints what the action does. */
  .intel-card-exit-drop {
    transform: translate(-140%, 20px) rotate(-14deg) !important;
    opacity: 0 !important;
  }
  .intel-card-exit-snooze {
    transform: translate(140%, 20px) rotate(14deg) !important;
    opacity: 0 !important;
  }
  .intel-card-exit-done {
    transform: translateY(24px) scale(.96) !important;
    opacity: 0 !important;
  }
  .intel-card-exit-check {
    transform: translateY(-40px) scale(1.03) !important;
    opacity: 0 !important;
  }

  .intel-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-2);
    min-height: 22px;
  }
  .intel-card-head-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .intel-card-src {
    color: var(--text-3, #94a3b8);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
  }
  .intel-card-score {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(139, 92, 246, .08);
    color: #6d28d9;
    font-weight: 600;
  }
  .intel-card-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--text-1, #0f172a);
  }
  .intel-card-title a { color: inherit; text-decoration: none; }
  .intel-card-title a:hover { color: var(--violet); }
  .intel-card-media {
    margin: 0 -4px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 23, 42, .04);
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .intel-card-media img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    object-position: center;
  }

  .intel-card-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    font-size: 12.5px;
    color: var(--text-2);
    margin-top: -6px;
    line-height: 1.4;
  }
  .intel-card-byline > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .intel-card-byline svg {
    width: 13px;
    height: 13px;
    color: var(--text-3, #94a3b8);
    flex: none;
  }
  .intel-card-orgs { color: var(--text-1, #0f172a); font-weight: 500; }

  .intel-card-lead {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text-1, #0f172a);
    font-weight: 500;
    padding-left: 12px;
    border-left: 3px solid var(--violet);
    text-wrap: pretty;
  }
  .intel-card-body {
    margin: 0;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    text-wrap: pretty;
  }
  .intel-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--rule-soft);
  }
  .intel-card-time {
    font-size: 12px;
    color: var(--text-3, #94a3b8);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .intel-card-actions {
    display: flex;
    gap: 6px;
  }
  .intel-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 13px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--text-2);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease, color .12s ease, border-color .12s ease, transform .1s ease;
  }
  .intel-btn:active { transform: translateY(1px); }
  .intel-btn svg { width: 14px; height: 14px; }
  .intel-btn:hover { background: rgba(15, 23, 42, .04); color: var(--text-1, #0f172a); }

  /* Drop is destructive — permanently red, deeper on hover. */
  .intel-btn-drop {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, .28);
    background: rgba(239, 68, 68, .05);
  }
  .intel-btn-drop:hover {
    color: #fff;
    border-color: #b91c1c;
    background: #dc2626;
  }
  .intel-btn-drop:hover kbd {
    color: rgba(255, 255, 255, .8);
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .08);
  }

  .intel-btn-snooze:hover { color: #b45309; border-color: rgba(180, 83, 9, .3); background: rgba(245, 158, 11, .08); }

  /* Done — the "kept in KB, summary was enough" path. Emerald accent. */
  .intel-btn-done {
    color: #047857;
    border-color: rgba(4, 120, 87, .22);
  }
  .intel-btn-done:hover {
    color: #065f46;
    border-color: rgba(4, 120, 87, .45);
    background: rgba(16, 185, 129, .1);
  }

  .intel-btn-check:hover { color: #6d28d9; border-color: rgba(109, 40, 217, .35); background: var(--violet-soft); }

  .intel-btn kbd {
    font: inherit;
    font-size: 10.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 2px 5px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    color: var(--text-3, #94a3b8);
    background: rgba(15, 23, 42, .03);
    line-height: 1;
  }
  .intel-btn:hover kbd { border-color: currentColor; opacity: .7; }

  .intel-hint {
    margin-top: 32px;
    font-size: 11.5px;
    color: var(--text-3, #94a3b8);
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .02em;
  }
  .intel-hint .sep { color: rgba(148, 163, 184, .5); }

  .intel-empty,
  .intel-done {
    padding: 100px 24px 24px;
    text-align: center;
    color: var(--text-3, #94a3b8);
    width: min(640px, 100%);
    margin: 0 auto;
  }
  .intel-empty-emoji { font-size: 52px; margin-bottom: 14px; }
  .intel-empty-title { font-size: 17px; font-weight: 600; color: var(--text-1, #0f172a); }
  .intel-empty-sub { font-size: 13.5px; margin-top: 6px; }

  @media (max-width: 720px) {
    .intel-stack-wrap { padding: 20px 12px 40px; }
    .intel-card { padding: 18px 18px 14px; }
    .intel-card-title { font-size: 17px; }
    .intel-card-lead { font-size: 13.5px; padding-left: 10px; }
    .intel-card-body { font-size: 13.5px; line-height: 1.55; }
    .intel-btn { padding: 7px 10px; font-size: 12.5px; }
    .intel-btn kbd { display: none; }
    .intel-card-foot { flex-wrap: wrap; gap: 12px; }
    .intel-card-actions { flex: 1; justify-content: flex-end; }
    .intel-hint { flex-wrap: wrap; justify-content: center; gap: 10px; }
  }

  /* ------- ultra-narrow phones (< 480px) — tighten everything ------- */
  @media (max-width: 480px) {
    .shell { padding: 6px; gap: 8px; }
    .topbar { padding: 4px 2px 12px; }
    .topbar h1 { font-size: 16px; }
    .subtitle { font-size: 11.5px; }
    .card { border-radius: 12px; }
    .card-head { padding: 12px 12px 8px; }
    .card-body { padding: 0 12px 12px; }

    .intel-stack-wrap { padding: 14px 6px 32px; }
    .intel-card { padding: 14px 14px 12px; border-radius: 12px; gap: 10px; }
    .intel-card-media, .intel-card-media img { max-height: 180px; }
    .intel-card-title { font-size: 15px; }
    .intel-card-lead { font-size: 13px; padding-left: 8px; }
    .intel-card-body { font-size: 12.5px; line-height: 1.5; }
    .intel-card-head { gap: 6px; }
    .intel-card-head-right { gap: 6px; }
    .intel-btn { padding: 6px 8px; font-size: 12px; gap: 4px; }
    .intel-btn svg { width: 12px; height: 12px; }
    .intel-btn span { display: inline; }
    .intel-counter { font-size: 11px; margin-bottom: 12px; letter-spacing: .02em; }
    .intel-counter .bar { width: 80px; }
    .intel-card-time { font-size: 11px; }
    .intel-hint { font-size: 10.5px; gap: 8px; }
  }

  /* ------- ultra-narrow: buttons wrap onto their own row cleanly ------- */
  @media (max-width: 380px) {
    .intel-card-actions { width: 100%; justify-content: space-between; }
    .intel-btn { flex: 1; justify-content: center; padding: 8px 4px; }
    .intel-btn span { font-size: 11px; }
  }

  /* ─── story card additions (multi-source chips + N-sources pill) ─── */
  .intel-card-src-multi {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #6d28d9;
    background: rgba(139, 92, 246, .08);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
  }
  .intel-card-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: -4px;
  }
  .intel-source-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10.5px;
    color: var(--text-3, #94a3b8);
    background: rgba(15, 23, 42, .04);
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0;
  }
  .intel-source-chip-more {
    color: #6d28d9;
    background: rgba(139, 92, 246, .08);
    font-weight: 600;
  }

  /* ─── story full page ─── */
  .story {
    max-width: 780px;
    margin: 8px auto 40px;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .story-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .05);
    color: var(--text-2);
    text-decoration: none;
    margin-right: 8px;
    font-weight: 500;
    vertical-align: middle;
  }
  .story-back:hover { background: rgba(139, 92, 246, .12); color: var(--violet, #6d28d9); }

  .story-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 -8px;
    padding: 12px 12px 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--rule);
  }
  .story-head-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 20px;
  }
  .story-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .story-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
  }
  .story-meta-sep { color: var(--text-4); }

  .story-head-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
  }
  .story-title {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 22px;
    line-height: 1.28;
    letter-spacing: -0.015em;
    font-weight: 650;
    color: var(--text);
    margin: 0;
    text-wrap: balance;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .story-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
  }

  .story-media {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 23, 42, .04);
    max-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .story-media img {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
  }

  .story-lead {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-1, #0f172a);
    font-weight: 500;
    margin: 0;
    padding-left: 14px;
    border-left: 3px solid var(--violet, #6d28d9);
  }
  .story-summary {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-1, #0f172a);
    white-space: pre-wrap;
  }

  .story-entities {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, .03);
    border-radius: 12px;
  }
  .story-entity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }
  .story-entity-label {
    flex: 0 0 84px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3, #94a3b8);
    padding-top: 4px;
    font-weight: 500;
  }
  .story-entity-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }

  .story-timeline {
    padding: 12px 16px;
    background: rgba(139, 92, 246, .05);
    border-radius: 12px;
    border-left: 3px solid rgba(139, 92, 246, .35);
  }
  .story-timeline-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6d28d9;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .story-timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
  }
  .story-timeline-list a { color: var(--text-2); text-decoration: none; }
  .story-timeline-list a:hover { color: var(--violet, #6d28d9); text-decoration: underline; }
  .story-timeline-current { color: var(--text-1, #0f172a); font-weight: 600; }

  .story-sources {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
  }
  .story-sources-head {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3, #94a3b8);
    font-weight: 600;
    margin-bottom: 2px;
  }
  .story-source {
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .story-source-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-3, #94a3b8);
    flex-wrap: wrap;
  }
  .story-source-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text-2);
    font-weight: 500;
  }
  .story-source-time { color: var(--text-3, #94a3b8); }
  .story-source-link {
    margin-left: auto;
    color: var(--violet, #6d28d9);
    text-decoration: none;
    font-weight: 500;
  }
  .story-source-link:hover { text-decoration: underline; }
  .story-source-title {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text-1, #0f172a);
  }
  .story-source-lead {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-1, #0f172a);
    font-weight: 500;
  }
  .story-source-body {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
  }

  @media (max-width: 720px) {
    .story { padding: 0 4px; margin: 6px auto 32px; gap: 14px; }
    .story-title { font-size: 19px; }
    .story-lead { font-size: 15px; padding-left: 10px; }
    .story-summary { font-size: 14px; }
    .story-head { margin: 0 -4px; padding: 10px 10px; gap: 8px; }
    .story-entities { padding: 12px 12px; }
    .story-entity-row { flex-direction: column; gap: 4px; }
    .story-entity-label { flex: none; padding-top: 0; }
    .story-media, .story-media img { max-height: 240px; }
    .story-source { padding: 12px 12px; }
    .story-source-title { font-size: 14px; }
  }
  @media (max-width: 480px) {
    .story-title { font-size: 17px; -webkit-line-clamp: 3; }
    .story-actions .intel-btn { padding: 6px 10px; font-size: 12px; }
    .story-actions .intel-btn kbd { display: none; }
  }

  /* ── discovery landing ─────────────────────────────────────────────── */

  .disco-section { margin-top: 40px; }
  .disco-section:first-child { margin-top: 8px; }
  .disco-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0 2px 14px; border-bottom: 1px solid var(--text);
    margin-bottom: 22px; gap: 14px;
  }
  .disco-section-kicker {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-3);
    line-height: 1;
    margin-bottom: 6px;
  }
  .disco-section-title {
    font-family: var(--serif);
    font-size: 32px; font-weight: 500;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1;
    font-variation-settings: "opsz" 36, "SOFT" 30;
  }
  .disco-section-count {
    flex-shrink: 0;
    font-family: var(--mono); font-size: 11px; color: var(--text-3);
    letter-spacing: 0.06em; text-transform: uppercase;
    padding-bottom: 4px;
  }

  .disco-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 22px;
  }
  .disco-grid > .disco-beat-feature { grid-column: span 2; }

  .disco-beat {
    position: relative;
    display: flex; flex-direction: column;
    padding: 4px 4px 4px 0;
    text-decoration: none; color: inherit;
    border-top: 1px solid var(--rule);
    padding-top: 14px;
    transition: transform 0.15s ease;
  }
  .disco-beat:hover { transform: translateY(-1px); }
  .disco-beat:hover .disco-beat-name { color: var(--violet-deep); }

  .disco-beat-meta {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3); letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 10px;
  }
  .disco-beat-meta .disco-beat-slug { color: var(--text-3); }
  .disco-beat-meta .disco-beat-heat { color: var(--amber-warm); }
  .disco-beat-meta .disco-beat-heat-hot { color: var(--violet-deep); font-weight: 600; }

  .disco-beat-name {
    font-family: var(--serif);
    font-size: 22px; font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 8px;
    font-variation-settings: "opsz" 24, "SOFT" 30;
    text-wrap: balance;
    transition: color 0.12s ease;
  }
  .disco-beat-feature .disco-beat-name {
    font-size: 32px; font-style: italic;
    font-variation-settings: "opsz" 34, "SOFT" 100;
  }

  .disco-beat-desc {
    font-family: var(--serif);
    font-size: 15px; color: var(--text-2);
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    font-variation-settings: "opsz" 14, "SOFT" 30;
  }
  .disco-beat-feature .disco-beat-desc { -webkit-line-clamp: 3; font-size: 16px; }

  .disco-beat-recent {
    list-style: none; padding: 0; margin: 0 0 12px;
  }
  .disco-beat-recent li {
    padding: 4px 0 4px 14px; position: relative;
    line-height: 1.4;
    font-size: 13px; color: var(--text-2);
    border-bottom: 1px solid var(--rule-soft);
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .disco-beat-recent li:last-child { border-bottom: 0; }
  .disco-beat-recent li::before {
    content: ''; position: absolute; left: 0; top: 12px;
    width: 6px; height: 1px; background: var(--text-4);
  }

  .disco-beat-cta {
    margin-top: auto;
    font-family: var(--mono); font-size: 11px;
    color: var(--violet-deep); letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: 6px;
  }
  .disco-beat-stale-flag {
    position: absolute; top: 14px; right: 0;
    font-family: var(--mono); font-size: 9.5px;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--amber-warm);
  }
  .disco-beat-stale-flag::before {
    content: '● ';
  }

  .disco-longtail {
    margin-top: 40px;
    border-top: 1px solid var(--rule);
    padding-top: 20px;
  }
  .disco-longtail summary {
    cursor: pointer;
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-2);
    padding: 4px 0;
    list-style: none;
  }
  .disco-longtail summary::-webkit-details-marker { display: none; }
  .disco-longtail summary::before {
    content: '+ ';
    display: inline-block;
    margin-right: 4px;
    color: var(--text-3);
  }
  .disco-longtail[open] summary::before { content: '– '; }
  .disco-longtail-count {
    font-family: var(--mono); font-size: 11px; color: var(--text-3);
    margin-left: 8px;
    letter-spacing: 0.06em;
  }
  .disco-longtail-list {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 2px 24px;
    margin-top: 14px;
  }
  .disco-longtail-item {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 12px; align-items: baseline;
    padding: 8px 4px;
    border-bottom: 1px solid var(--rule-soft);
    text-decoration: none; color: inherit;
    transition: color 0.12s ease;
  }
  .disco-longtail-item:hover { color: var(--violet-deep); }
  .disco-longtail-name {
    font-family: var(--serif);
    font-size: 15px; letter-spacing: -0.01em;
  }
  .disco-longtail-topic {
    font-family: var(--mono); font-size: 10px;
    color: var(--text-3); text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .disco-longtail-n {
    font-family: var(--mono); font-size: 11px; color: var(--text-3);
    min-width: 20px; text-align: right;
  }

  /* ── discovery search results ─────────────────────────────────────── */

  .disco-results {
    display: flex; flex-direction: column;
    margin-top: 8px;
  }
  .disco-hit {
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
  }
  .disco-hit:first-child { padding-top: 6px; }
  .disco-hit-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; margin-bottom: 6px;
  }
  .disco-hit-title {
    font-family: var(--serif);
    font-size: 22px; font-weight: 500;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-variation-settings: "opsz" 24, "SOFT" 30;
    text-wrap: balance;
    transition: color 0.12s ease;
  }
  .disco-hit-title:hover { color: var(--violet-deep); }
  .disco-hit-day {
    flex-shrink: 0;
    font-family: var(--mono); font-size: 11px; color: var(--text-3);
    letter-spacing: 0.08em; text-transform: uppercase;
  }
  .disco-hit-beats {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 12px 6px; margin-bottom: 10px;
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .disco-hit-beats::before {
    content: 'in';
    color: var(--text-4);
    margin-right: 2px;
  }
  .disco-beat-chip {
    color: var(--text-2); text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease;
  }
  .disco-beat-chip:hover {
    color: var(--violet-deep); border-color: var(--violet-deep);
  }
  .disco-beat-chip-primary { color: var(--violet-deep); }
  .disco-hit-src {
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-4); letter-spacing: 0.06em;
    margin-left: auto;
  }
  .disco-hit-lead {
    font-family: var(--serif);
    font-size: 16px; color: var(--text-2);
    line-height: 1.5;
    margin: 4px 0 6px;
    font-style: italic;
    font-variation-settings: "opsz" 16, "SOFT" 100;
  }
  .disco-hit-body {
    font-size: 14px; color: var(--text-2);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .disco-empty {
    text-align: center; padding: 80px 20px;
    color: var(--text-3);
  }
  .disco-empty-emoji { font-size: 36px; margin-bottom: 14px; opacity: 0.7; }
  .disco-empty-title {
    font-family: var(--serif);
    font-size: 22px; color: var(--text-2);
    letter-spacing: -0.015em;
    margin-bottom: 6px;
    font-style: italic;
  }
  .disco-empty-sub {
    font-size: 13px; color: var(--text-3);
    max-width: 420px; margin: 0 auto;
    line-height: 1.5;
  }

  /* ── beat detail: masthead + timeline ─────────────────────────────── */

  .beat-page { max-width: 780px; }

  .beat-masthead {
    padding: 8px 0 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--text);
  }
  .beat-masthead-topline {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 18px;
  }
  .beat-kicker {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3); letter-spacing: 0.14em;
    text-transform: uppercase; line-height: 1;
  }
  .beat-kicker a { color: var(--text-3); text-decoration: none; transition: color 0.12s ease; }
  .beat-kicker a:hover { color: var(--violet-deep); }
  .beat-kicker-sep { color: var(--text-4); }
  .beat-actions {
    display: flex; gap: 6px;
  }
  .beat-action {
    appearance: none; background: none; border: 0;
    font: inherit; font-family: var(--mono);
    font-size: 10.5px; letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px 8px; border-radius: 5px;
    transition: color 0.12s ease, background 0.12s ease;
    text-decoration: none;
  }
  .beat-action:hover { color: var(--text); background: var(--rule-soft); }
  .beat-action-primary { color: var(--violet-deep); }

  .beat-title {
    font-family: var(--serif);
    font-size: 52px; font-weight: 400;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.02;
    margin: 0 0 18px;
    font-variation-settings: "opsz" 60, "SOFT" 30;
    text-wrap: balance;
  }
  .beat-title-curated {
    font-style: italic;
    font-variation-settings: "opsz" 60, "SOFT" 100;
  }
  .beat-description {
    font-family: var(--serif);
    font-size: 19px; color: var(--text-2);
    line-height: 1.4;
    margin: 0 0 22px;
    max-width: 620px;
    font-variation-settings: "opsz" 18, "SOFT" 30;
    text-wrap: pretty;
    border-left: 0; padding-left: 0;
  }

  .beat-metaline {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 14px;
    font-family: var(--mono); font-size: 11px;
    color: var(--text-3); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .beat-metaline strong {
    color: var(--text); font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .beat-metaline-sep { color: var(--text-4); }

  .beat-sparkline {
    margin-top: 20px;
    height: 44px;
    display: flex; align-items: flex-end;
    gap: 3px;
    color: var(--amber);
  }
  .beat-spark-bar {
    flex: 1; min-width: 2px;
    background: currentColor;
    border-radius: 1.5px 1.5px 0 0;
    opacity: 0.85;
    min-height: 1px;
    transition: opacity 0.12s ease;
  }
  .beat-spark-bar:hover { opacity: 1; }
  .beat-spark-bar-hot { color: var(--violet); }
  .beat-spark-legend {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 9.5px;
    color: var(--text-4); letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
  }

  .beat-stale {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid var(--amber);
    border-radius: 0 6px 6px 0;
    margin-bottom: 22px;
    font-family: var(--serif); font-size: 15px;
    color: var(--text-2);
    font-variation-settings: "opsz" 15, "SOFT" 30;
  }
  .beat-stale strong { color: var(--text); font-weight: 600; }
  .beat-stale-actions {
    display: flex; gap: 8px; flex-shrink: 0;
  }

  /* Edit drawer — hidden by default, revealed via :target */
  .beat-edit-panel {
    display: none;
    padding: 18px 20px 22px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 10px;
    margin-bottom: 24px;
  }
  .beat-edit-panel:target { display: block; }
  .beat-edit-panel-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px;
  }
  .beat-edit-panel-title {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-3);
  }
  .beat-edit-close {
    font-family: var(--mono); font-size: 11px;
    color: var(--text-3); text-decoration: none;
  }
  .beat-edit-close:hover { color: var(--text); }
  .beat-edit-groups {
    display: grid; gap: 20px;
    grid-template-columns: 1fr 1fr;
  }
  .beat-edit-group {
    display: flex; flex-direction: column; gap: 10px;
  }
  .beat-edit-group-title {
    font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3);
    padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft);
  }
  .beat-edit-form {
    display: flex; flex-direction: column; gap: 8px;
  }
  .beat-edit-form label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 11px; color: var(--text-3);
    font-family: var(--mono);
    letter-spacing: 0.06em; text-transform: uppercase;
  }
  .beat-edit-form input,
  .beat-edit-form select {
    font: inherit; font-family: var(--prose); font-size: 14px;
    padding: 8px 12px; border: 1px solid var(--rule);
    border-radius: 6px; background: var(--ground);
    color: var(--text);
    text-transform: none; letter-spacing: 0;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  }
  .beat-edit-form input:focus,
  .beat-edit-form select:focus {
    outline: none; border-color: var(--violet);
    background: var(--card);
    box-shadow: 0 0 0 3px var(--violet-soft);
  }
  .beat-edit-form button { align-self: flex-start; margin-top: 4px; }

  /* Entity index — count-weighted type, no chips */
  .beat-entities {
    display: flex; flex-direction: column;
    gap: 14px;
    padding: 20px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-bottom: 32px;
  }
  .beat-entity-row {
    display: grid; grid-template-columns: 110px 1fr;
    gap: 20px; align-items: baseline;
  }
  .beat-entity-label {
    font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3);
    padding-top: 4px;
  }
  .beat-entity-words {
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 4px 14px;
    font-family: var(--serif);
    line-height: 1.3;
    font-variation-settings: "opsz" 16, "SOFT" 30;
  }
  .beat-entity-word {
    color: var(--text);
    letter-spacing: -0.005em;
    display: inline-flex; align-items: baseline; gap: 4px;
  }
  .beat-entity-word .n {
    font-family: var(--mono); font-size: 10px;
    color: var(--text-4);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    vertical-align: super;
  }

  /* Story timeline */
  .beat-stories { display: flex; flex-direction: column; }
  .beat-month {
    font-family: var(--serif);
    font-size: 22px; font-weight: 400;
    color: var(--text);
    letter-spacing: -0.02em;
    padding: 28px 0 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--rule);
    font-variation-settings: "opsz" 24, "SOFT" 30;
    font-style: italic;
  }
  .beat-stories .beat-month:first-child { padding-top: 8px; }

  .beat-story {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 4px 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .beat-story-bullet {
    grid-column: 1;
    padding-top: 8px;
    display: flex; justify-content: center;
    font-size: 12px; line-height: 1;
    color: var(--violet-deep);
  }
  .beat-story-bullet-also { color: var(--text-4); }
  .beat-story-main { grid-column: 2; min-width: 0; }
  .beat-story-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 4px;
  }
  .beat-story-title {
    font-family: var(--serif);
    font-size: 20px; font-weight: 500;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.015em;
    line-height: 1.2;
    font-variation-settings: "opsz" 22, "SOFT" 30;
    text-wrap: balance;
    transition: color 0.12s ease;
  }
  .beat-story-title:hover { color: var(--violet-deep); }
  .beat-story-day {
    flex-shrink: 0;
    font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
    letter-spacing: 0.1em; text-transform: uppercase;
  }
  .beat-story-meta {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px;
    font-family: var(--mono); font-size: 10.5px;
    color: var(--text-3); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .beat-story-meta-sep { color: var(--text-4); }
  .beat-story-also {
    color: var(--amber-warm);
    letter-spacing: 0.08em;
  }
  .beat-story-topic { color: var(--text-3); }
  .beat-story-lead {
    font-family: var(--serif);
    font-size: 16px; color: var(--text-2);
    line-height: 1.5;
    margin: 0 0 6px;
    font-style: italic;
    font-variation-settings: "opsz" 16, "SOFT" 100;
    text-wrap: pretty;
  }
  .beat-story-body {
    font-size: 13.5px; color: var(--text-2);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .beat-more { padding: 24px 0; text-align: center; }

  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    font: inherit; font-family: var(--prose);
    font-size: 12.5px; font-weight: 500;
    border: 1px solid var(--violet);
    background: var(--violet); color: white;
    border-radius: 7px; cursor: pointer;
    text-decoration: none;
    transition: filter 0.12s ease, transform 0.12s ease;
  }
  .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
  .btn-soft {
    background: var(--card); color: var(--text);
    border-color: var(--rule);
  }
  .btn-soft:hover {
    border-color: var(--text-3); filter: none;
  }

  @media (max-width: 900px) {
    .disco-grid { grid-template-columns: repeat(2, 1fr); }
    .disco-grid > .disco-beat-feature { grid-column: span 2; }
    .disco-longtail-list { grid-template-columns: 1fr; }
    .beat-entity-row { grid-template-columns: 1fr; gap: 4px; }
    .beat-edit-groups { grid-template-columns: 1fr; }
    .beat-title { font-size: 40px; }
  }
  @media (max-width: 560px) {
    .disco-grid { grid-template-columns: 1fr; }
    .disco-grid > .disco-beat-feature { grid-column: span 1; }
    .disco-beat-feature .disco-beat-name { font-size: 26px; }
    .disco-section-title { font-size: 26px; }
    .beat-stale { flex-direction: column; align-items: flex-start; }
    .beat-title { font-size: 32px; }
    .beat-description { font-size: 16px; }
    .beat-story { grid-template-columns: 16px 1fr; }
    .beat-story-title { font-size: 17px; }
    .disco-hit-title { font-size: 18px; }
  }

  /* ── Story rating (▲/▼) ─────────────────────────────────────────────── */
  .rate-pair {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
  }
  .rate-btn {
    width: 22px; height: 22px;
    padding: 0;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-3);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: color 120ms, background 120ms, border-color 120ms;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .rate-btn:hover { color: var(--text); background: rgba(15, 23, 42, .04); }
  .rate-btn.rate-plus-on {
    color: var(--emerald-text);
    background: var(--emerald-soft);
    border-color: rgba(16, 185, 129, .35);
  }
  .rate-btn.rate-minus-on {
    color: var(--red-text);
    background: var(--red-soft);
    border-color: rgba(239, 68, 68, .35);
  }

  /* Story-detail: full-size buttons matching intel-btn pattern */
  .intel-btn-boost.rate-active {
    color: var(--emerald-text);
    border-color: rgba(16, 185, 129, .35);
    background: var(--emerald-soft);
  }
  .intel-btn-reject.rate-active {
    color: var(--red-text);
    border-color: rgba(239, 68, 68, .35);
    background: var(--red-soft);
  }
  .intel-btn-boost:hover {
    color: var(--emerald-text);
    border-color: rgba(16, 185, 129, .35);
    background: var(--emerald-soft);
  }
  .intel-btn-reject:hover {
    color: var(--red-text);
    border-color: rgba(239, 68, 68, .35);
    background: var(--red-soft);
  }
