/* Dashboard styles — mobile-responsive layout */

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

:root {
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --accent:      #2563eb;

  /* Category colours */
  --cat-tech:        #3b82f6;
  --cat-ai:          #8b5cf6;
  --cat-geopolitics: #f59e0b;
  --cat-default:     #6b7280;

  --header-bg:   #0f172a;
  --header-text: #f8fafc;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.12);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--header-text);
}

.item-count {
  font-size: .8rem;
  background: rgba(255,255,255,.12);
  color: var(--header-text);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 8px; }

.refresh-status {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}

.btn-refresh {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--header-text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.btn-refresh:hover { background: rgba(255,255,255,.2); }
.btn-refresh.spinning { animation: spin .6s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navigation bar ────────────────────────────────────────── */
.page-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 95;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 0;
}

.nav-link {
  padding: 10px 18px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Filter bar ────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 96px;   /* header (52px) + nav (44px) */
  z-index: 90;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-wrap { flex: 1 1 220px; }

.search-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.chip:hover { background: var(--bg); color: var(--text); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip[data-cat="tech"].active   { background: var(--cat-tech);        border-color: var(--cat-tech); }
.chip[data-cat="ai"].active     { background: var(--cat-ai);          border-color: var(--cat-ai); }
.chip[data-cat="geopolitics"].active { background: var(--cat-geopolitics); border-color: var(--cat-geopolitics); }

.source-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.source-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.unread-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.unread-toggle input { cursor: pointer; }

/* ── Main content ──────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Items grid ────────────────────────────────────────────── */
.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .items-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .items-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Item card ─────────────────────────────────────────────── */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .12s;
}
.item-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.item-card.is-read { opacity: .65; }

/* Card top row: badges */
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Source badge — neutral */
.badge-source {
  background: #e2e8f0;
  color: #475569;
}

/* Category badge — colour per category */
.badge-cat { color: #fff; }
.badge-cat[data-cat="tech"]        { background: var(--cat-tech); }
.badge-cat[data-cat="ai"]          { background: var(--cat-ai); }
.badge-cat[data-cat="geopolitics"] { background: var(--cat-geopolitics); }
.badge-cat                         { background: var(--cat-default); } /* fallback */

/* Title */
.card-title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
}
.card-title a {
  color: var(--text);
  text-decoration: none;
}
.card-title a:hover { color: var(--accent); text-decoration: underline; }

/* Summary */
.card-summary {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Keyword tags */
.card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kw-tag {
  background: #dcfce7;
  color: #166534;
  font-size: .68rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
}

/* Card footer: timestamp + actions */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.card-time {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 5px;
  font-size: .85rem;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  line-height: 1;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.starred { color: #f59e0b; }
.btn-icon.read    { color: var(--accent); }
.btn-icon.btn-delete:hover { background: #fee2e2; color: #dc2626; }

/* ── Loading / empty states ────────────────────────────────── */
.loading-state {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 56px 16px;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ── Settings button (header) ──────────────────────────────── */
.btn-settings {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--header-text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .3s;
  flex-shrink: 0;
}
.btn-settings:hover { background: rgba(255,255,255,.2); }
.btn-settings.open { transform: rotate(60deg); }

/* ── Settings overlay ──────────────────────────────────────── */
.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  opacity: 0;
  transition: opacity .25s;
}
.settings-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Settings panel ────────────────────────────────────────── */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.settings-panel.open {
  transform: translateX(0);
}

/* Panel header */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--header-bg);
  color: var(--header-text);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.settings-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.btn-close-settings {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.btn-close-settings:hover {
  color: var(--header-text);
  background: rgba(255,255,255,.1);
}

/* Tabs */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.tab-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab content area (scrollable) */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Section labels inside tabs */
.settings-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-top: 8px;
}
.settings-section-label:first-child { margin-top: 0; }

/* Feed list */
.feed-list, .keyword-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-loading {
  font-size: .85rem;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Individual feed row */
.feed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .12s;
}
.feed-row:hover { border-color: #cbd5e1; }
.feed-row.disabled { opacity: .5; }

.feed-info {
  flex: 1;
  min-width: 0;
}
.feed-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.feed-cat {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #e2e8f0;
  color: #475569;
  padding: 1px 6px;
  border-radius: 999px;
}
.feed-url-text {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(14px); }

/* Edit / Delete buttons in feed rows */
.btn-edit-row,
.btn-delete-row {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: .9rem;
  padding: 3px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color .12s, background .12s;
}
.btn-edit-row:hover   { color: var(--accent); background: #eff6ff; }
.btn-delete-row:hover { color: #ef4444;       background: #fee2e2; }

/* Inline edit form inside a feed row */
.feed-edit-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.feed-edit-actions {
  display: flex;
  gap: 6px;
}

.btn-save-edit,
.btn-cancel-edit {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-save-edit {
  background: var(--accent);
  color: #fff;
}
.btn-save-edit:hover    { background: #1d4ed8; }
.btn-save-edit:disabled { opacity: .6; cursor: not-allowed; }
.btn-cancel-edit {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-cancel-edit:hover { background: var(--border); }

/* Keyword row */
.keyword-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.keyword-text {
  font-size: .85rem;
  color: var(--text);
}

/* Add form */
.add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.settings-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.btn-add {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-add:hover { background: #1d4ed8; }

.form-error {
  font-size: .8rem;
  color: #dc2626;
  padding: 4px 0;
}

/* ── Logout button (header) ────────────────────────────────── */
.btn-logout {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  transform: rotate(90deg);
}
.btn-logout:hover {
  background: rgba(255,255,255,.2);
  color: var(--header-text);
}

/* ── Login page ────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.login-error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: .85rem;
  margin-bottom: 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: -4px;
}

.login-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.login-btn {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.login-btn:hover { background: #1d4ed8; }

/* ── Tinder stack view (mobile feed only) ──────────────────── */

/* Hidden everywhere by default; JS adds .stack-mode to body on mobile feed */
.stack-view { display: none; }

@media (max-width: 639px) {
  body.stack-mode .stack-view  { display: block; }
  body.stack-mode .items-grid  { display: none !important; }
  body.stack-mode .filter-bar  { display: none; }
  /* Adjust sticky offsets now that filter bar is gone */
  body.stack-mode .page-nav    { top: 52px; }
}

.stack-counter {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  padding: 10px 0 6px;
  letter-spacing: .01em;
}

/* Fixed-height area that holds ghost cards + active card */
.stack-area {
  position: relative;
  height: min(480px, 65vh);
  margin: 0 16px;
}

/* Ghost cards layered behind the active card */
.stack-ghost {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stack-ghost-2 { transform: translateY(8px) scale(0.94); z-index: 1; }
.stack-ghost-1 { transform: translateY(4px) scale(0.97); z-index: 2; }

/* Wrapper for the draggable top card */
.stack-card-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none; /* we handle all touch ourselves */
  user-select: none;
  -webkit-user-select: none;
}
/* Smooth snap-back / exit animation, toggled by JS */
.stack-card-wrap.snapping {
  transition: transform .32s cubic-bezier(.25, .8, .25, 1),
              opacity  .28s ease;
}

/* The card itself — extends .item-card */
.stack-card {
  height: 100%;
  overflow-y: auto;
  position: relative; /* contains the overlay */
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  /* cursor stays default so title links feel natural */
  cursor: default;
}

/* Coloured overlay that appears while dragging */
.stack-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .03em;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.stack-overlay.right { background: rgba(22,163,74,.82);  color: #fff; }
.stack-overlay.left  { background: rgba(220,38,38,.82);  color: #fff; }
.stack-overlay.up    { background: rgba(217,119,6,.82);  color: #fff; }

/* Hint row beneath the stack */
.stack-hints {
  display: flex;
  justify-content: space-between;
  padding: 10px 28px 4px;
}
.stack-hint {
  font-size: .72rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.hint-icon {
  font-size: 1rem;
}

/* All-caught-up empty state inside the stack */
.stack-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: .9rem;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

/* ── Settings full page layout ─────────────────────────────── */
.settings-page-wrap {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

.settings-page-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.settings-page-tabs .tab-btn {
  flex: 1;
}

.settings-page-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Briefs dashboard ───────────────────────────────────────── */
.brief-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brief-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .15s;
}
.brief-card.expanded {
  box-shadow: var(--shadow-hover);
}

/* Clickable header row */
.brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
  transition: background .12s;
}
.brief-header:hover { background: var(--bg); }
.brief-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.brief-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brief-time {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.brief-stats {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.brief-chevron {
  font-size: 1.3rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s;
  line-height: 1;
}
.brief-card.expanded .brief-chevron {
  transform: rotate(90deg);
}

/* Expanded bullet area */
.brief-body {
  border-top: 1px solid var(--border);
  padding: 8px 0 4px;
}

.brief-body-loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* Smaller spinner variant for inline loading */
.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* Bullet list */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bullet-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.bullet-item:last-child { border-bottom: none; }

.bullet-headline {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
}

.bullet-description {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.bullet-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bullet-sources a {
  font-size: .73rem;
  color: var(--accent);
  text-decoration: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 999px;
  transition: background .12s;
}
.bullet-sources a:hover { background: #dbeafe; }

.bullet-error,
.bullet-empty {
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text-muted);
}
.bullet-error { color: #dc2626; }

/* Empty state secondary line */
.empty-sub {
  margin-top: 6px;
  font-size: .8rem;
  color: #94a3b8;
}

/* ── Today page: date / scan status header ─────────────────── */
.today-page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0 6px;
}

.today-page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.today-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.today-date {
  font-size: .85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.today-scan-status {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3px 16px 6px;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Highlight cards ────────────────────────────────────────── */
.highlight-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
  position: relative;
}
.highlight-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Subtle left border accent on recently-updated cards */
.highlight-card.highlight-recent {
  border-left: 3px solid var(--accent);
}

/* "Updated" badge for recently refreshed cards */
.highlight-card.highlight-recent::after {
  content: 'Updated';
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 999px;
}

.highlight-other-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.highlight-headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
}

.highlight-description {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.highlight-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  color: var(--text-muted);
}

.highlight-source-count {
  white-space: nowrap;
}

.highlight-updated {
  white-space: nowrap;
}

.highlight-updated::before {
  content: '·';
  margin-right: 8px;
}

.highlight-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  width: 100%;
}

.highlight-source-link {
  font-size: .73rem;
  color: var(--accent);
  text-decoration: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 999px;
  transition: background .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.highlight-source-link:hover { background: #dbeafe; }

/* ── Refreshed chip ─────────────────────────────────────────── */
.refresh-chip {
  position: fixed;
  bottom: 20px;
  right: 16px;
  background: rgba(30, 41, 59, .85);
  color: #f8fafc;
  font-size: .75rem;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 500;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.refresh-chip.refresh-chip-show {
  opacity: 1;
}

/* ── Undo toast ─────────────────────────────────────────────── */
.undo-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #f8fafc;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .84rem;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.28);
  z-index: 600;
  opacity: 0;
  transition: transform .28s cubic-bezier(.25, .8, .25, 1), opacity .25s ease;
  white-space: nowrap;
  pointer-events: none;
}
.undo-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.undo-toast-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.4);
  color: #f8fafc;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.undo-toast-btn:hover { background: rgba(255,255,255,.15); }
