/* ═══════════════════════════════════════════════════════════
   RSSFlow — Design System & Layout
   Dark-mode first, premium aesthetics
═══════════════════════════════════════════════════════════ */

:root {
  /* Colors */
  color-scheme: dark;
  --bg-base:       #0d1117;
  --bg-surface:    #161b22;
  --bg-elevated:   #1c2128;
  --bg-overlay:    #21262d;
  --border:        #30363d;
  --border-subtle: #21262d;
  --shadow-soft:   rgba(0,0,0,0.45);
  --shadow-strong: rgba(0,0,0,0.6);
  --grid-line:     rgba(124,58,237,0.06);
  --danger-soft:   rgba(248,81,73,0.12);
  --danger-border: rgba(248,81,73,0.3);
  --purple-soft:   rgba(124,58,237,0.15);
  --purple-faint:  rgba(124,58,237,0.1);
  --blue-soft:     rgba(37,99,235,0.12);
  --blue-faint:    rgba(37,99,235,0.1);
  --green-soft:    rgba(63,185,80,0.1);
  --green-border:  rgba(63,185,80,0.22);
  --yellow-soft:   rgba(210,153,34,0.1);
  --yellow-border: rgba(210,153,34,0.35);
  --red-soft:      rgba(248,81,73,0.1);
  --red-border:    rgba(248,81,73,0.22);
  --code-accent:   #c084fc;
  --link:          #60a5fa;
  --link-hover:    #93c5fd;

  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --accent-start: #7c3aed;
  --accent-end:   #2563eb;
  --accent-glow:  rgba(124, 58, 237, 0.25);

  --green:  #3fb950;
  --red:    #f85149;
  --yellow: #d29922;

  /* Sizes */
  --sidebar-w:     260px;
  --list-w:        360px;
  --radius:        10px;
  --radius-sm:     6px;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-med:  0.25s ease;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-base:       #f4f7fb;
  --bg-surface:    #ffffff;
  --bg-elevated:   #eef3f8;
  --bg-overlay:    #e2e8f0;
  --border:        #cbd5e1;
  --border-subtle: #e2e8f0;
  --shadow-soft:   rgba(15,23,42,0.12);
  --shadow-strong: rgba(15,23,42,0.18);
  --grid-line:     rgba(37,99,235,0.08);
  --danger-soft:   rgba(220,38,38,0.08);
  --danger-border: rgba(220,38,38,0.22);
  --purple-soft:   rgba(37,99,235,0.11);
  --purple-faint:  rgba(37,99,235,0.08);
  --blue-soft:     rgba(37,99,235,0.1);
  --blue-faint:    rgba(37,99,235,0.08);
  --green-soft:    rgba(22,163,74,0.08);
  --green-border:  rgba(22,163,74,0.22);
  --yellow-soft:   rgba(217,119,6,0.09);
  --yellow-border: rgba(217,119,6,0.24);
  --red-soft:      rgba(220,38,38,0.08);
  --red-border:    rgba(220,38,38,0.2);
  --code-accent:   #7c3aed;
  --link:          #2563eb;
  --link-hover:    #1d4ed8;

  --text-primary:   #172033;
  --text-secondary: #475569;
  --text-muted:     #8a97aa;

  --accent-start: #2563eb;
  --accent-end:   #0891b2;
  --accent-glow:  rgba(37,99,235,0.2);

  --green:  #15803d;
  --red:    #dc2626;
  --yellow: #a16207;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-med), color var(--t-med);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
img { max-width: 100%; }

/* ── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════════════════════ */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  z-index: 200;
}

.auth-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 0 0 1px var(--accent-glow), 0 24px 48px var(--shadow-soft);
  animation: auth-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px;
}
.auth-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  font-size: 18px; color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.logo-text { background: linear-gradient(90deg, var(--accent-start), var(--accent-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.auth-tagline { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-base); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: all var(--t-fast);
}
.auth-tab.active {
  background: var(--bg-elevated); color: var(--text-primary);
  box-shadow: 0 1px 3px var(--shadow-soft);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text-primary); font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-error {
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--red); font-size: 13px; margin-bottom: 14px;
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: white; font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 18px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--list-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.sidebar-logo .logo-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.sidebar-actions { display: flex; align-items: center; gap: 4px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { background: var(--bg-overlay); color: var(--text-primary); }
.btn-icon svg { width: 16px; height: 16px; }
.theme-toggle .theme-icon {
  display: none;
  width: 16px;
  height: 16px;
}
.theme-toggle .theme-icon svg {
  width: 16px;
  height: 16px;
}
:root[data-theme="dark"] .theme-toggle .theme-icon-sun,
:root:not([data-theme]) .theme-toggle .theme-icon-sun,
:root[data-theme="light"] .theme-toggle .theme-icon-moon {
  display: inline-flex;
}

.sidebar-nav { padding: 10px 8px; border-bottom: 1px solid var(--border-subtle); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all var(--t-fast);
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item .badge {
  margin-left: auto;
  background: var(--accent-start); color: white;
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
.nav-item .badge:empty, .nav-item .badge[data-count="0"] { display: none; }

.sidebar-section { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section::-webkit-scrollbar { width: 4px; }
.sidebar-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.btn-tiny {
  font-size: 11px; color: var(--text-muted); padding: 2px 6px;
  border-radius: 4px; transition: all var(--t-fast);
}
.btn-tiny:hover { background: var(--bg-overlay); color: var(--text-secondary); }

.feeds-list { display: flex; flex-direction: column; gap: 1px; }
.feeds-placeholder { padding: 12px 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.feed-tree-header {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
  text-align: left;
  transition: all var(--t-fast);
}
.feed-tree-header:hover,
.feed-tree-header.feed-tree-has-active {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.feed-tree-header.feed-tree-depth-1 { padding-left: 22px; }
.feed-tree-header.feed-tree-depth-2 { padding-left: 34px; }
.feed-tree-header.feed-tree-depth-3 { padding-left: 46px; }
.feed-tree-caret-button {
  width: 14px;
  height: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.feed-tree-caret-button span {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  opacity: 0.75;
  transform: translateX(2px);
  transition: transform var(--t-fast);
}
.feed-tree-header[aria-expanded="true"] .feed-tree-caret-button span {
  transform: translateX(1px) rotate(90deg);
}
.feed-tree-label {
  min-width: 0;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-tree-parent-site .feed-tree-label:hover {
  color: var(--text-primary);
}
.feed-tree-count {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--bg-overlay);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.feed-tree-count-unread {
  color: var(--accent-start);
  background: var(--purple-soft);
}
.feed-tree-item {
  min-width: 0;
}
.feed-tree-item.feed-tree-depth-1 { padding-left: 20px; }
.feed-tree-item.feed-tree-depth-2 { padding-left: 30px; }
.feed-tree-item.feed-tree-depth-3 { padding-left: 40px; }

.feed-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--t-fast);
  position: relative;
}
.feed-item:hover { background: var(--bg-elevated); }
.feed-item.active { background: var(--bg-overlay); }
.feed-item .feed-icon {
  width: 18px; height: 18px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-overlay);
}
.feed-item .feed-name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-item.active .feed-name { color: var(--text-primary); }
.feed-item .feed-badge {
  font-size: 11px; font-weight: 600; color: var(--accent-start);
  background: var(--purple-soft); padding: 1px 5px; border-radius: 999px;
}
.feed-status-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--yellow); white-space: nowrap;
}
.feed-status-tag.error {
  background: var(--red-soft); color: var(--red);
}
.full-content-loading {
  color: var(--text-muted); font-style: italic; font-size: 13px; margin-top: 12px;
}
.feed-actions {
  position: relative;
  flex-shrink: 0;
}
.feed-actions-toggle {
  opacity: 0;
  width: 24px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.feed-item:hover .feed-actions-toggle,
.feed-actions.open .feed-actions-toggle,
.feed-actions-toggle:focus-visible {
  opacity: 1;
}
.feed-actions-toggle:hover,
.feed-actions.open .feed-actions-toggle {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.feed-actions-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: 0 12px 32px var(--shadow-soft);
}
.feed-actions-menu button {
  width: 100%;
  padding: 7px 9px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.feed-actions-menu button:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.feed-actions-menu button[data-feed-menu-action="delete"]:hover {
  background: var(--danger-soft);
  color: var(--red);
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
}
.btn-icon-text {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted);
  transition: all var(--t-fast);
}
.btn-icon-text svg { width: 15px; height: 15px; }
.btn-icon-text:hover { background: var(--bg-elevated); color: var(--red); }

/* ── Article List Pane ──────────────────────────────────── */
.article-list-pane {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

.pane-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.pane-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pane-title-row h1 { font-size: 16px; font-weight: 600; }
.pane-actions { display: flex; align-items: center; gap: 8px; }
.pane-pagination-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 0;
}
.pane-pagination-row:has(.btn-ghost:not(.hidden)) {
  margin-bottom: 10px;
}
.btn-site-next, .btn-site-backfill {
  white-space: nowrap;
}
.toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.toggle-label input[type="checkbox"] { accent-color: var(--accent-start); width: 14px; height: 14px; cursor: pointer; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  transition: border-color var(--t-fast);
}
.search-bar:focus-within { border-color: var(--accent-start); }
.search-bar svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px;
}
.search-bar input::placeholder { color: var(--text-muted); }

.article-label-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.article-label-filter {
  max-width: 140px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.article-label-filter:hover {
  border-color: var(--accent-start);
  color: var(--text-secondary);
}
.article-label-filter.active {
  border-color: var(--label-color, var(--accent-start));
  background: var(--blue-soft);
  color: var(--text-primary);
}

.site-backfill-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 9px 12px;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.site-backfill-main {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.site-backfill-summary {
  color: var(--text-primary); font-size: 12px; font-weight: 600;
}
.site-backfill-meta {
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-secondary); font-size: 11px;
}
.site-backfill-cancel {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 12px;
}

.fetch-policy-panel {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  background: var(--bg-base); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.fetch-policy-main {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 12px; color: var(--text-secondary);
}
.fetch-policy-label { color: var(--text-muted); flex-shrink: 0; }
.fetch-policy-status {
  color: var(--text-primary); font-weight: 600;
  background: var(--bg-overlay); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap; flex-shrink: 0;
}
.fetch-policy-meta {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted); font-size: 11px;
}
.fetch-policy-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fetch-policy-actions .btn-ghost { padding: 5px 12px; white-space: nowrap; font-size: 12px; }

.articles-container { flex: 1; overflow-y: auto; }
.articles-container::-webkit-scrollbar { width: 4px; }
.articles-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; color: var(--text-muted); gap: 10px;
}
.empty-icon { font-size: 40px; }

.article-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background var(--t-fast);
  position: relative;
}
.article-card:hover { background: var(--bg-surface); }
.article-card.active { background: var(--bg-elevated); border-left: 2px solid var(--accent-start); }
.article-card.read .article-title { color: var(--text-muted); }
.article-card.read .article-source { opacity: 0.6; }

.article-card-top {
  display: flex; align-items: center; gap: 6px;
}
.article-source-icon {
  width: 14px; height: 14px; border-radius: 3px;
  object-fit: cover; background: var(--bg-overlay);
}
.article-source { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.article-meta-chip {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent-start);
  background: var(--purple-faint); padding: 1px 6px; border-radius: 4px;
}
.article-label-chip {
  color: var(--link);
  background: var(--blue-faint);
}
.content-status-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}
.content-status-full,
.content-status-fetched {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-border);
}
.content-status-summary,
.content-status-pending {
  color: var(--link);
  background: var(--blue-faint);
  border-color: var(--blue-soft);
}
.content-status-failed {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-border);
}
.content-status-na {
  color: var(--text-muted);
}
.article-date { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.article-report-button {
  position: absolute;
  top: 36px;
  right: 14px;
  max-width: 72px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.article-report-button:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent-start);
}

.article-title {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  line-height: 1.4; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding-right: 84px;
}
.article-excerpt {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding-right: 84px;
}
.article-unread-dot {
  position: absolute; top: 14px; right: 14px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-start);
  box-shadow: 0 0 6px var(--accent-glow);
}
.article-card.read .article-unread-dot { display: none; }

.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.btn-ghost {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost.danger { color: var(--red); }
#page-info { font-size: 12px; color: var(--text-muted); }

/* ── Admin Panel ───────────────────────────────────────── */
.admin-panel {
  grid-column: 2 / -1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.admin-header h1 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 24px 0;
  background: var(--bg-surface);
}
.admin-tab {
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.admin-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-start);
}
.admin-content {
  flex: 1;
  overflow: auto;
  padding: 18px 24px 28px;
}
.admin-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.admin-inline-form.provider-form {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}
.admin-inline-form input,
.admin-inline-form select {
  min-width: 0;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
}
.admin-inline-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}
.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.admin-table-wrap.compact {
  max-height: 360px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.admin-table th,
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
}
.admin-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  z-index: 1;
}
.admin-table td {
  color: var(--text-primary);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.admin-loading,
.admin-error {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.admin-error {
  color: var(--red);
  border-color: var(--danger-border);
}
.admin-geo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-geo-block {
  min-width: 0;
}
.admin-geo-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-geo-block h2 {
  font-size: 13px;
  color: var(--text-secondary);
}
.admin-filter-input {
  width: min(180px, 55%);
  min-width: 120px;
  height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}
.admin-filter-input:focus {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.admin-geo-group-form {
  grid-template-columns: repeat(4, minmax(88px, 1fr)) auto;
  margin-bottom: 10px;
}
.admin-table-summary {
  padding: 6px 2px 0;
  color: var(--text-muted);
  font-size: 11px;
}
.source-health-page {
  gap: 16px;
}
.source-health-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.source-health-form label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.source-health-form input {
  width: 160px;
  min-width: 120px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
}
.source-health-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.source-health-list-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-health-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
}
.source-health-list-header h2 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}
.source-health-source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.source-health-source-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-align: left;
}
.source-health-source-button:hover,
.source-health-source-button.active {
  border-color: var(--accent-start);
  background: var(--bg-elevated);
}
.source-health-source-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.source-health-source-main strong,
.source-health-source-main span,
.source-health-source-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-health-source-main strong {
  font-size: 12px;
  font-weight: 600;
}
.source-health-source-main span,
.source-health-source-meta {
  color: var(--text-secondary);
  font-size: 11px;
}
.source-health-source-meta {
  grid-column: 2;
}
.health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.health-badge.healthy {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-border);
}
.health-badge.degraded {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: var(--yellow-border);
}
.health-badge.stale {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-border);
}
.source-health-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.source-health-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.source-health-title-row h2 {
  font-size: 18px;
  line-height: 1.25;
}
.source-health-title-row p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  word-break: break-word;
}
.source-health-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
}
.source-health-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.source-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.source-health-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-health-block h3 {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.source-health-table-wrap {
  max-width: 100%;
}
.source-health-kv-table {
  min-width: 420px;
}
.source-health-kv-table th {
  position: static;
  width: 190px;
}
.source-health-json {
  min-height: 80px;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.source-health-empty {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
}
.admin-feedback-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.admin-feedback-toolbar label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.admin-feedback-toolbar select {
  min-width: 130px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
}
.admin-feedback-table {
  min-width: 1180px;
}
.admin-link-button {
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.admin-link-button:hover {
  color: var(--link-hover);
}
.admin-muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Reader Pane ────────────────────────────────────────── */
.reader-pane {
  background: var(--bg-base);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.reader-pane::-webkit-scrollbar { width: 6px; }
.reader-pane::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.reader-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); gap: 10px;
}
.reader-placeholder-icon { font-size: 36px; }

.reader-content { padding: 40px 48px; max-width: 780px; margin: 0 auto; width: 100%; }

.reader-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.reader-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  flex-wrap: wrap;
}
.reader-feed-icon { width: 18px; height: 18px; border-radius: 4px; }
.reader-dot { color: var(--text-muted); }
.reader-actions { display: flex; gap: 4px; }

.reader-title {
  font-size: 24px; font-weight: 700; line-height: 1.35;
  color: var(--text-primary); margin-bottom: 24px;
}
#btn-reader-star.starred svg { fill: var(--yellow); stroke: var(--yellow); }

/* ── Prose styles for article body ─────────────────────── */
.prose {
  font-size: 15px; line-height: 1.75; color: var(--text-secondary);
}
.prose p { margin-bottom: 1.2em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text-primary); font-weight: 600;
  margin: 1.4em 0 0.6em; line-height: 1.3;
}
.prose h2 { font-size: 1.25em; }
.prose h3 { font-size: 1.1em; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--link-hover); }
.prose code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
  color: var(--code-accent);
}
.prose pre {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; overflow-x: auto;
  margin: 1.2em 0;
}
.prose pre code { background: none; border: none; padding: 0; color: var(--text-primary); }
.prose blockquote {
  border-left: 3px solid var(--accent-start); padding-left: 16px;
  margin: 1.2em 0; color: var(--text-muted); font-style: italic;
}
.prose img { border-radius: var(--radius-sm); margin: 1em 0; max-width: 100%; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.52); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fade-in var(--t-fast);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; width: 520px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px var(--shadow-strong);
  animation: modal-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 16px; padding: 0 20px;
}
.modal-tab {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  padding: 10px 14px; border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
}
.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-start); }

.modal-tab-pane { display: none; padding: 20px; }
.modal-tab-pane.active { display: block; }

.modal-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.modal-hint a { color: var(--link); }
.modal-hint code {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 4px; font-size: 11px; color: var(--code-accent);
}
.article-report-modal {
  width: 440px;
}
.article-report-form {
  padding: 20px;
}
.article-report-title {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-report-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.article-report-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.article-report-reason input {
  flex-shrink: 0;
}
.article-report-reason span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.article-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.url-fields,
.social-fields {
  margin-bottom: 0;
}
.social-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.social-fields .field { margin-bottom: 0; }
.onchain-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.onchain-fields .field { margin-bottom: 0; }
.onchain-endpoint-field,
.crawler-config-field {
  grid-column: 1 / -1;
}
.geo-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.geo-fields .field { margin-bottom: 0; }
.source-kind-mode-hint {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
}
.labels-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.label-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.label-chip:hover {
  border-color: var(--accent-start);
  color: var(--text-primary);
}
.label-chip input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent-start);
  flex-shrink: 0;
}
.label-chip:has(input:checked) {
  border-color: var(--accent-start);
  background: var(--blue-soft);
  color: var(--text-primary);
}
.labels-empty {
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
}

.route-results { margin-top: 12px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.route-results::-webkit-scrollbar { width: 4px; }
.route-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.route-hint { font-size: 12px; color: var(--text-muted); text-align: center; padding: 24px; }

.route-result-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); cursor: pointer;
  transition: all var(--t-fast);
}
.route-result-item:hover { background: var(--bg-elevated); border-color: var(--accent-start); }
.route-path { font-size: 12px; font-weight: 600; color: var(--code-accent); font-family: monospace; }
.route-summary { font-size: 13px; color: var(--text-primary); }
.route-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); background: var(--bg-overlay);
  padding: 1px 6px; border-radius: 4px;
}

.batch-import-input {
  min-height: 132px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.batch-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.batch-import-summary {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
}
.batch-import-results {
  margin-top: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.batch-import-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-import-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.batch-import-row.created {
  border-color: var(--green-border);
  background: var(--green-soft);
}
.batch-import-check {
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.batch-import-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-start);
}
.batch-import-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.batch-import-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.batch-import-title-input,
.batch-parent-site-fields input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
}
.batch-import-title-input:disabled,
.batch-parent-site-fields input:disabled {
  color: var(--text-muted);
  background: var(--bg-overlay);
}
.batch-import-url,
.batch-import-message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
}
.batch-parent-site-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.batch-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}
.batch-status-chip.status-ready {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-soft);
}
.batch-status-chip.status-needs_review,
.batch-status-chip.status-duplicate {
  border-color: var(--yellow-border);
  color: var(--yellow);
  background: var(--yellow-soft);
}
.batch-status-chip.status-needs_manual_capture,
.batch-status-chip.status-failed {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-soft);
}

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; color: var(--text-primary);
  box-shadow: 0 8px 24px var(--shadow-soft);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 260px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success::before { content: "✓"; color: var(--green); font-weight: 700; }
.toast.error::before   { content: "✕"; color: var(--red);   font-weight: 700; }
.toast.info::before    { content: "ℹ"; color: var(--link);   font-weight: 700; }

/* ── Spinner ────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent-start);
  animation: spin 0.6s linear infinite; flex-shrink: 0;
}
#btn-refresh.loading svg { animation: spin 0.8s linear infinite; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .reader-pane { display: none; }
  .app { grid-template-columns: var(--sidebar-w) 1fr; }
  .admin-panel { grid-column: 2 / -1; }
  .admin-geo-grid { grid-template-columns: 1fr; }
  .source-health-layout { grid-template-columns: 1fr; }
  .source-health-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .app { grid-template-columns: 1fr; }
  .admin-panel { grid-column: 1 / -1; }
  .admin-inline-form,
  .admin-inline-form.provider-form { grid-template-columns: 1fr; }
  .source-health-title-row { flex-direction: column; }
  .reader-content { padding: 24px 20px; }
}
