/* ═══════════════════════════════════════════════════════════
   AI Digest — Design System
   Inspired by Ramotion / Borea AI visual identity
   Aurora gradients · Deep navy · Electric blue · Premium
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens — DARK (default) ──────────────────────── */
:root,
[data-theme="dark"] {
  --bg:           #0c0d12;
  --bg-alt:       #101118;
  --surface:      #16171f;
  --surface-2:    #1c1d28;
  --surface-3:    #252633;
  --border:       #2a2b3a;
  --border-light: #35374a;

  --accent:       #6366f1;
  --accent-glow:  rgba(99, 102, 241, 0.18);
  --accent-hover: #818cf8;
  --aurora-1:     #06b6d4;
  --aurora-2:     #8b5cf6;
  --aurora-3:     #6366f1;

  --text:         #eaeaf0;
  --text-2:       #a1a1b5;
  --muted:        #6b6b80;
  --muted-2:      #4a4a5c;

  --green:        #22c55e;
  --green-bg:     rgba(34, 197, 94, 0.1);
  --green-border: rgba(34, 197, 94, 0.3);
  --red:          #ef4444;
  --red-bg:       rgba(239, 68, 68, 0.1);
  --red-border:   rgba(239, 68, 68, 0.3);
  --yellow:       #f59e0b;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.5);
  --shadow-md:    0 4px 20px rgba(0,0,0,.6);
  --shadow-glow:  0 0 24px rgba(99, 102, 241, 0.12);
  --radius:       10px;
  --radius-sm:    6px;
}

/* ── Design tokens — LIGHT ────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f0f4fc;
  --bg-alt:       #e8eef9;
  --surface:      #ffffff;
  --surface-2:    #f5f8ff;
  --surface-3:    #eaf0fb;
  --border:       #d4dff5;
  --border-light: #e2eafc;

  --accent:       #2563eb;
  --accent-glow:  rgba(37, 99, 235, 0.12);
  --accent-hover: #1d4ed8;
  --aurora-1:     #0891b2;
  --aurora-2:     #7c3aed;
  --aurora-3:     #2563eb;

  --text:         #0f172a;
  --text-2:       #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;

  --green:        #059669;
  --green-bg:     rgba(5, 150, 105, 0.08);
  --green-border: rgba(5, 150, 105, 0.25);
  --red:          #dc2626;
  --red-bg:       rgba(220, 38, 38, 0.08);
  --red-border:   rgba(220, 38, 38, 0.25);
  --yellow:       #d97706;

  --shadow-sm:    0 1px 3px rgba(15,23,42,.08);
  --shadow-md:    0 4px 16px rgba(15,23,42,.12);
  --shadow-glow:  0 0 24px rgba(37, 99, 235, 0.08);
  --radius:       10px;
  --radius-sm:    6px;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
}

/* Aurora background decoration — dark only */
[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 10% 0%, rgba(59,127,255,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 5%, rgba(0,196,180,.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(124,93,245,.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] nav {
  background: rgba(13, 22, 41, 0.88);
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--aurora-3), var(--aurora-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* Onboarding pulse on the ❓ guide link (tabs empty OR login_count ≤ 3) */
.nav-link-pulse {
  color: var(--text);
  background: rgba(99, 102, 241, .12);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, .55);
  animation: nav-pulse 1.8s ease-in-out infinite;
}
.nav-link-pulse:hover { animation: none; background: rgba(99, 102, 241, .25); }
@keyframes nav-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(99, 102, 241, .55); }
  60%  { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0);   }
}
@media (prefers-reduced-motion: reduce) {
  .nav-link-pulse { animation: none; }
}

.nav-user {
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.admin-badge {
  font-size: .68rem;
  font-style: normal;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(255, 208, 96, .12);
  border: 1px solid rgba(255, 208, 96, .25);
  padding: .1rem .4rem;
  border-radius: 4px;
  letter-spacing: .02em;
}

.btn-nav-logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .82rem;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.btn-nav-logout:hover { color: var(--red); background: var(--red-bg); }

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  width: 36px;
  height: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background .25s, border-color .25s;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform .25s, background .25s;
}
[data-theme="light"] .theme-toggle { background: var(--accent); border-color: var(--accent); }
[data-theme="light"] .theme-toggle::after { transform: translateX(16px); background: white; }
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--muted);
}

/* ── APP LAYOUT ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 53px);
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: width .22s cubic-bezier(.4,0,.2,1);
}
.sidebar::-webkit-scrollbar { width: 2px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* collapsed state */
.sidebar.collapsed { width: 52px; }

/* ── Sidebar header (label + toggle) ── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1rem 1rem 14px;
  gap: .5rem;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-header { justify-content: flex-start; padding: 1.4rem 0 1rem 14px; }

.sidebar-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  max-width: 120px;
  transition: max-width .2s cubic-bezier(.4,0,.2,1), opacity .15s;
}
.sidebar.collapsed .sidebar-label { max-width: 0; opacity: 0; }

.sidebar-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  padding: 0;
}
.sidebar-toggle:hover { color: var(--text-2); background: var(--surface-2); }
.sidebar-toggle svg { transition: transform .22s cubic-bezier(.4,0,.2,1); display: block; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* ── Nav items ── */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  padding: .25rem 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem .55rem 11px;
  border-left: 3px solid transparent;
  font-size: .83rem;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s, gap .22s;
}
.sidebar-item:hover { color: var(--text-2); background: var(--surface-2); text-decoration: none; }
.sidebar-item.active {
  color: var(--text);
  font-weight: 500;
  background: linear-gradient(90deg, var(--accent-glow) 0%, transparent 100%);
  border-left-color: var(--accent);
}
.sidebar.collapsed .sidebar-item { justify-content: flex-start; padding: .55rem 0 .55rem 11px; gap: 0; }

.sidebar-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-size: .95rem;
  overflow: hidden;
}
.sidebar-icon .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.sidebar-icon .brand-icon svg { width: 15px; height: 15px; }

.sidebar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 148px;
  transition: max-width .2s cubic-bezier(.4,0,.2,1), opacity .12s;
}
.sidebar.collapsed .sidebar-name { max-width: 0; opacity: 0; }

/* ── Footer ── */
.sidebar-footer {
  padding: .5rem 0;
  flex-shrink: 0;
}

.sidebar-manage {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .77rem;
  color: var(--muted-2);
  padding: .5rem .75rem .5rem 14px;
  overflow: hidden;
  transition: color .15s, background .15s, padding .22s cubic-bezier(.4,0,.2,1), gap .22s;
}
.sidebar-manage:hover { color: var(--muted); background: var(--surface-2); text-decoration: none; }
.sidebar-manage svg { flex-shrink: 0; opacity: .55; }
.sidebar.collapsed .sidebar-manage { justify-content: flex-start; padding: .5rem 0 .5rem 14px; gap: 0; }

.sidebar-manage-text {
  white-space: nowrap;
  overflow: hidden;
  max-width: 80px;
  transition: max-width .2s cubic-bezier(.4,0,.2,1), opacity .12s;
}
.sidebar.collapsed .sidebar-manage-text { max-width: 0; opacity: 0; }

/* ── LAYOUT ───────────────────────────────────────────────── */
main { max-width: 880px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.app-layout main { flex: 1; min-width: 0; margin: 0; max-width: none; }

.flash {
  padding: .8rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: .87rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.flash-error   { background: var(--red-bg);   border: 1px solid var(--red-border);   color: var(--red); }
.flash-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }

.empty-state {
  text-align: center;
  padding: 5rem 0;
  color: var(--muted);
}
.empty-state p:first-child { font-size: 2rem; margin-bottom: 1rem; }
.empty-state code {
  font-size: .8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .2rem .5rem;
  border-radius: 4px;
  color: var(--aurora-1);
}

/* ── FETCH GROUP ──────────────────────────────────────────── */
.fetch-group { margin-bottom: 3.5rem; }

.fetch-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.fetch-date {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.fetch-meta { font-size: .78rem; color: var(--muted); }

/* ── THEME CARD ───────────────────────────────────────────── */
.theme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  margin-bottom: 1rem;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: var(--shadow-sm);
}
.theme-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.theme-header {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: .7rem;
}

/* Vote score pill */
.vote-score {
  min-width: 2.6rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  padding: .22rem .5rem;
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color .2s, background .2s, border-color .2s;
}
.vote-score.pos {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}
.vote-score.neg {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

.theme-title {
  flex: 1;
  font-size: .97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -.01em;
}

.vote-controls { display: flex; gap: .3rem; flex-shrink: 0; }
.btn-vote {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-vote:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-vote.active-up {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}
.btn-vote.active-down {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.theme-summary {
  font-size: .87rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1rem;
}
.theme-summary ul {
  margin: .25rem 0;
  padding-left: 1.3rem;
}
.theme-summary li {
  margin-bottom: .3rem;
}
.theme-summary li::marker {
  color: var(--accent);
}

/* ── SOURCES ──────────────────────────────────────────────── */
.sources-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .77rem;
  color: var(--muted);
  padding: .2rem 0;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: color .15s;
  margin-bottom: .4rem;
}
.sources-toggle:hover { color: var(--accent); }

.sources-list {
  display: none;
  list-style: none;
  padding: .5rem 0 .5rem .85rem;
  border-left: 2px solid var(--border);
  margin-bottom: .5rem;
}
.sources-list.open { display: block; }
.sources-list li { margin: .28rem 0; }
.sources-list a {
  font-size: .79rem;
  color: var(--aurora-1);
  transition: color .15s;
}
.sources-list a:hover { color: var(--accent); }
.src-label { font-size: .71rem; color: var(--muted-2); margin-left: .35rem; }

/* ── DETAILED SUMMARY ─────────────────────────────────────── */
.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .77rem;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: .3rem .8rem;
  cursor: pointer;
  margin-top: .4rem;
  transition: background .15s, box-shadow .15s;
}
.btn-detail:hover { background: rgba(0, 212, 160, .18); box-shadow: 0 0 12px rgba(0,212,160,.12); }
.btn-detail:disabled { opacity: .5; cursor: wait; }

.detail-box {
  display: none;
  margin-top: .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: .85rem;
  color: var(--text-2);
}
.detail-box.open { display: block; }
.detail-box ul { padding-left: 1.1rem; }
.detail-box li { margin: .38rem 0; line-height: 1.55; }

.spinner { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AUTH ─────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Aurora background for login page */
[data-theme="dark"] .auth-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 30%, rgba(59,127,255,.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(0,196,180,.07) 0%, transparent 55%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

[data-theme="dark"] .auth-card {
  box-shadow: var(--shadow-md), 0 0 60px rgba(59,127,255,.06);
}

.auth-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--aurora-3), var(--aurora-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .3rem;
}

.auth-tagline {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: .4rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

input[type=text],
input[type=password],
input[type=email] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .5rem;
  letter-spacing: .01em;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(59,127,255,.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .82rem;
  color: var(--muted);
}
.auth-link a { color: var(--accent); font-weight: 500; }

/* ── SETTINGS ─────────────────────────────────────────────── */
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 2rem;
}

.settings-section { margin-bottom: 2.5rem; }

.settings-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.topic-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  transition: border-color .15s, box-shadow .15s;
}
.topic-row:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }

.topic-icon { font-size: 1.2rem; width: 1.8rem; text-align: center; flex-shrink: 0; }
.topic-name { flex: 1; font-size: .9rem; font-weight: 500; color: var(--text); }
.topic-status { font-size: .75rem; color: var(--muted); margin-right: .5rem; }

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-icon:disabled { opacity: .3; cursor: default; }
.btn-show {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-bg);
  font-size: .74rem;
  width: auto;
  padding: 0 .7rem;
}

.hint { color: var(--muted); font-size: .8rem; margin-top: 1rem; line-height: 1.5; }

/* ── ADMIN ────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  margin-top: 1rem;
}
.admin-table th {
  text-align: left;
  padding: .6rem .85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}
.admin-table tr:hover td { background: var(--surface-2); }

.badge-admin {
  font-size: .72rem;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(255, 208, 96, .12);
  border: 1px solid rgba(255, 208, 96, .25);
  padding: .15rem .45rem;
  border-radius: 4px;
}
.badge-user {
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .15rem .45rem;
  border-radius: 4px;
}

.btn-sm { font-size: .75rem; padding: .25rem .6rem; border-radius: 4px; cursor: pointer; border: none; }
.btn-danger  { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border);   }
.btn-promote { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.btn-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: .78rem;
  padding: .3rem .85rem;
  transition: all .15s;
}
.btn-filter:hover { border-color: var(--accent); color: var(--accent); }
.btn-filter.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.btn-crawl {
  margin-left: auto;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 20px;
  color: var(--green);
  cursor: pointer;
  font-size: .78rem;
  padding: .3rem .85rem;
  transition: all .15s;
  font-weight: 500;
}
.btn-crawl:hover { background: var(--green); color: var(--bg); }
.btn-crawl:disabled { opacity: .6; cursor: wait; }

/* ── Crawl progress panel ──────────────────────────────────── */
.crawl-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.crawl-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
}
.crawl-step:last-child { border-bottom: none; }
.step-icon {
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: .9rem;
}
.step-ok    { color: var(--green); }
.step-error { color: var(--red); }
.step-warn  { color: var(--yellow); }
.step-skip  { color: var(--muted); }
.step-label {
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
}
.step-detail {
  color: var(--text-2);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Theme actions ────────────────────────────────────────── */
.theme-actions {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
  margin-left: auto;
}
.btn-status {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-status:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-favorite.active { color: var(--yellow); border-color: rgba(255,208,96,.4); background: rgba(255,208,96,.1); }
.btn-read.active    { color: var(--green);  border-color: var(--green-border); background: var(--green-bg); }
.btn-hide:hover     { color: var(--red);    border-color: var(--red-border);   background: var(--red-bg); }

/* ── Status badge ─────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .71rem;
  padding: .15rem .5rem;
  border-radius: 10px;
  margin-bottom: .6rem;
  font-weight: 500;
}
.status-read     { color: var(--green);  background: var(--green-bg); border: 1px solid var(--green-border); }
.status-favorite { color: var(--yellow); background: rgba(255,208,96,.1); border: 1px solid rgba(255,208,96,.3); }
.status-hidden   { color: var(--muted);  background: var(--surface-2); border: 1px solid var(--border); }

/* ── Hidden cards ─────────────────────────────────────────── */
.theme-card[data-status="hidden"] { opacity: .45; }
.theme-card.filter-hidden { display: none; }

/* ── Feed manager ─────────────────────────────────────────── */
.feed-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: default;
}
.feed-status--ok      { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.feed-status--error   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.feed-status--unknown { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.feed-row { gap: .6rem; }
.feed-type-badge {
  font-size: .68rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .1rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.feed-url {
  flex: 1;
  font-size: .73rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.btn-toggle-on  { border-color: var(--green-border); color: var(--green); background: var(--green-bg); }
.btn-toggle-off { border-color: var(--border); color: var(--muted); }
.add-feed-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.add-feed-row .form-group { margin-bottom: 0; }

/* ── Brand icons (SVG) ───────────────────────────────── */
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
}
.brand-icon svg {
  width: 100%;
  height: 100%;
}

/* ── Icon select (channel creation) ──────────────────── */
.icon-select {
  position: relative;
  width: 200px;
}
.icon-select-current {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-size: .9rem;
}
.icon-select-current:hover { border-color: var(--accent); }
.icon-select-arrow { margin-left: auto; color: var(--muted); font-size: .75rem; }
.icon-select-preview { font-size: 1.2rem; width: 1.5rem; text-align: center; flex-shrink: 0; }
.icon-select-label { flex: 1; }
.icon-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}
.icon-select.open .icon-select-dropdown { display: block; }
.icon-select-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .85rem;
  cursor: pointer;
  font-size: .87rem;
  color: var(--text);
}
.icon-select-item:hover { background: var(--accent-glow); }

/* ── Feed table (manage channel / feeds page) ─────────── */
.feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.feed-table th {
  text-align: left;
  padding: .45rem .75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.feed-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}
.feed-table tr:last-child td { border-bottom: none; }
.feed-table tr:hover td { background: var(--surface-2); }
.feed-row-disabled td { opacity: .45; }
.feed-type-icon { font-size: 1.05rem; text-align: center; }
.feed-url-td {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  color: var(--muted-2);
}
.edit-hint {
  font-size: .65rem;
  color: var(--muted-2);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Inline editing ───────────────────────────────────── */
.editable {
  cursor: text;
  border-radius: 4px;
  transition: background .15s;
}
.editable:hover { background: var(--surface-3); }
.editable.editing { padding: 0; background: none !important; }

.inline-input, .inline-select {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: .3rem .5rem;
  color: var(--text);
  font-size: .84rem;
  font-family: inherit;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.inline-select { cursor: pointer; }

/* ── Feed toggle switch ───────────────────────────────── */
.feed-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.feed-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.feed-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: background .2s, border-color .2s;
}
.feed-toggle-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.feed-toggle input:checked + .feed-toggle-slider {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.feed-toggle input:checked + .feed-toggle-slider::before {
  transform: translateX(16px);
  background: var(--green);
}

/* ── Channel manage header ────────────────────────────── */
.ch-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.ch-icon {
  font-size: 2.2rem;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
}
.ch-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 0;
  padding: .1rem .3rem;
  border-radius: 4px;
  line-height: 1.3;
}

/* ── Available feeds search ───────────────────────────── */
.feed-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .85rem;
  color: var(--text);
  font-size: .88rem;
  outline: none;
  margin-bottom: .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.feed-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.available-feed-row { transition: border-color .15s, box-shadow .15s; }

/* ── Refresh bar ────────────────────────────────────────── */
.refresh-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}
.refresh-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .4rem .6rem;
  font-size: .82rem;
  cursor: pointer;
  outline: none;
}
.refresh-select:focus {
  border-color: var(--accent);
}

/* ── Feed type colored icons ────────────────────────────── */
.feed-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
  border-radius: 4px;
  object-fit: contain;
}
.feed-type-badge-cell {
  white-space: nowrap;
}
.crawl-step[style*="flex-end"] {
  display: flex;
  justify-content: flex-end;
  padding: .5rem 0;
}
.feed-edit-row td {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.feed-actions {
  display: flex;
  gap: .25rem;
  align-items: center;
}

/* ── Icon picker (searchable grid) ──────────────────────── */
.icon-picker {
  position: relative;
  width: 220px;
}
.icon-picker-selected {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s;
}
.icon-picker-selected:hover {
  border-color: var(--accent);
}
.icon-picker-preview {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-picker-preview svg {
  width: 100%;
  height: 100%;
}
.icon-picker-label {
  flex: 1;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
}
.icon-picker-arrow {
  color: var(--muted);
  font-size: .75rem;
}
.icon-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 340px;
  max-height: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}
.icon-picker.open .icon-picker-dropdown {
  display: flex;
  flex-direction: column;
}
.icon-picker-search {
  width: 100%;
  padding: .6rem .85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: .88rem;
  outline: none;
}
.icon-picker-search::placeholder { color: var(--muted); }
.icon-picker-search:focus { background: var(--surface-3); }
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
  max-height: 300px;
}
.icon-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: .45rem .25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .1s;
}
.icon-picker-item:hover {
  background: var(--surface-3);
}
.icon-picker-item svg {
  width: 28px;
  height: 28px;
}
.icon-picker-item span {
  font-size: .65rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.1;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Last refreshed ─────────────────────────────────────── */
.last-refreshed {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Drag & drop channel reorder ──────────────────────────── */
.drag-handle {
  cursor: grab;
  color: var(--muted-2);
  font-size: 1.1rem;
  padding: .2rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}
.drag-handle:hover { color: var(--accent); background: var(--accent-glow); }
.drag-handle:active { cursor: grabbing; }
.topic-row[draggable="true"] { transition: opacity .15s, transform .15s; }
.topic-row.dragging { opacity: .4; }
.topic-row.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ── Feed cards (replaces table) ─────────────────────────── */
.feed-cards { display: flex; flex-direction: column; gap: .5rem; }
.feed-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.feed-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.feed-card.feed-card-disabled { opacity: .5; }
.feed-card-icon { font-size: 1.1rem; flex-shrink: 0; width: 28px; text-align: center; }
.feed-card-info { flex: 1; min-width: 0; }
.feed-card-name { font-size: .9rem; font-weight: 500; color: var(--text); }
.feed-card-url { font-size: .73rem; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-card-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

/* ── Feed type selector (wizard step 1) ──────────────────── */
.feed-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.feed-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .85rem .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  color: var(--text);
  font-size: .82rem;
  font-weight: 500;
}
.feed-type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  transform: translateY(-1px);
}
.feed-type-btn .feed-type-btn-icon { font-size: 1.4rem; }
.feed-type-btn svg { width: 24px; height: 24px; }

/* ── Wizard step 2 (type-specific form) ──────────────────── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  transition: color .15s;
}
.wizard-back:hover { color: var(--accent); }

/* ── Delete confirmation inline ──────────────────────────── */
.confirm-delete {
  display: none;
  align-items: center;
  gap: .4rem;
  padding: .4rem .6rem;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--red);
  white-space: nowrap;
}
.confirm-delete.show { display: inline-flex; }
.confirm-delete button {
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-weight: 600;
}
.confirm-delete .confirm-yes { background: var(--red); color: white; }
.confirm-delete .confirm-no { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* ── Toast notification ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: toast-in .25s ease-out;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toast-success { border-color: var(--green-border); color: var(--green); }
.toast-error { border-color: var(--red-border); color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cookie session status ───────────────────────────────── */
.cookie-status {
  padding: .6rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: .5rem;
}
.cookie-status-ok {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}
.cookie-status-warn {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.cookie-steps {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.6;
  padding: .5rem 0;
}
.cookie-steps ol { padding-left: 1.2rem; }
.cookie-steps li { margin-bottom: .3rem; }

/* ── Touch targets (mobile accessibility) ────────────────── */
@media (pointer: coarse) {
  .btn-icon { min-width: 44px; min-height: 44px; }
  .btn-status { min-width: 44px; min-height: 44px; }
  .btn-vote { min-width: 44px; min-height: 44px; }
  .feed-toggle { width: 44px; height: 24px; }
  .feed-toggle-slider::before { width: 18px; height: 18px; }
  .feed-toggle input:checked + .feed-toggle-slider::before { transform: translateX(20px); }
}

/* ── Prominent refresh CTA ───────────────────────────────── */
.refresh-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.5rem;
}

/* ── Guide page ──────────────────────────────────────────── */
.guide-steps { display: flex; flex-direction: column; gap: .75rem; }
.guide-step {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.guide-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.guide-step-content { flex: 1; font-size: .88rem; line-height: 1.6; color: var(--text); }
.guide-step-content strong { display: block; margin-bottom: .3rem; }
.guide-step-content p { color: var(--text-2); margin: 0; }
.guide-step-content ul { padding-left: 1.2rem; margin-top: .4rem; color: var(--text-2); font-size: .85rem; }
.guide-step-content li { margin-bottom: .2rem; }
.guide-step-content code {
  background: var(--surface-2);
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .82rem;
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════
   DIGEST v2 — hero intro, impact badges, punchline, quotable, in-brief
   ══════════════════════════════════════════════════════════════════ */

/* Hero — the first thing readers see per fetch */
.digest-hero {
  margin: .5rem 0 1.8rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: linear-gradient(to right, var(--accent-glow), transparent 60%);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.digest-intro {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -.005em;
  margin: 0;
}

/* Theme card v2 layout — punchline drives the scan */
.theme-card-v2 .theme-header {
  flex-wrap: wrap;
  gap: .5rem .8rem;
  align-items: center;
}
.theme-card-v2 .theme-header-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.theme-card-v2 .theme-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
}

/* Impact badge — the first visual signal */
.impact-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .22rem .55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.impact-high {
  color: var(--red, #dc2626);
  background: var(--red-bg, rgba(220,38,38,.08));
  border-color: var(--red-border, rgba(220,38,38,.3));
}
.impact-medium {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent);
}
.impact-low {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border);
}

/* Don't-miss pin — visual hook above the card */
.theme-card.is-dont-miss {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.dont-miss-ribbon {
  position: absolute;
  top: -10px;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.theme-card.is-dont-miss { position: relative; }

/* Punchline — the 1-sentence killer that delivers scan value */
.theme-punchline {
  font-size: 1.08rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  margin: .6rem 0 .5rem;
}

/* Why now — tertiary, the "why this theme, why now" */
.theme-why-now {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 .6rem;
}
.why-now-label {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-right: .4rem;
  padding: .1rem .4rem;
  background: var(--surface-2);
  border-radius: 3px;
}

/* Quotable stat — the pull-quote that rewards the 30s scan */
.theme-quotable {
  margin: .6rem 0 .8rem;
  padding: .55rem .85rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  font-size: .9rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
  font-style: normal;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.theme-quotable::before {
  content: "📊 ";
  opacity: .7;
  margin-right: .25rem;
}

/* Theme bullets — last level of depth, density for the plongeur */
.theme-bullets {
  list-style: none;
  padding: 0;
  margin: .5rem 0 .9rem;
}
.theme-bullets li {
  position: relative;
  padding: .3rem 0 .3rem 1.2rem;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--text-2);
}
.theme-bullets li::before {
  content: "•";
  position: absolute;
  left: .3rem;
  top: .3rem;
  color: var(--accent);
  font-weight: 700;
}
.theme-bullets li strong {
  color: var(--text);
  font-weight: 700;
  background: var(--accent-glow);
  padding: 0 .2rem;
  border-radius: 2px;
}

/* ── IN-BRIEF — residual items, 1 line each ─────────────────────── */
.in-brief {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.in-brief-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 .7rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.in-brief-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 0 .4rem;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 10px;
  font-size: .7rem;
  letter-spacing: 0;
}
.in-brief-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.in-brief-row {
  padding: .45rem 0;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.45;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}
.in-brief-row:first-child { border-top: none; }
.in-brief-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.in-brief-row a:hover { text-decoration: underline; }
.in-brief-source {
  margin-left: auto;
  font-size: .72rem;
  color: var(--muted);
  font-family: ui-monospace, Menlo, monospace;
}

/* ── WATCH NEXT WEEK — cliffhanger footer ───────────────────────── */
.watch-next-week {
  margin-top: 1.2rem;
  padding: .85rem 1.1rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.watch-label {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
}
.watch-next-week p {
  margin: 0;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

/* ── MOBILE — tighter spacing, stacked header ───────────────────── */
@media (max-width: 640px) {
  .digest-hero { padding: .8rem .9rem; }
  .digest-intro { font-size: .95rem; }
  .theme-card-v2 .theme-header { gap: .4rem; }
  .theme-card-v2 .theme-title { font-size: .98rem; flex-basis: 100%; order: 2; }
  .theme-card-v2 .theme-header-left { order: 1; }
  .theme-card-v2 .theme-actions { order: 3; margin-left: auto; }
  .theme-punchline { font-size: 1rem; }
  .theme-quotable { font-size: .85rem; padding: .45rem .7rem; }
  .in-brief-source { margin-left: 0; }
}
