/* ============================================================
   Marketing Dashboard — Main Stylesheet
   Design tokens, layout, components, animations, dark mode
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* ── Design Tokens (Light Mode) ───────────────────────────── */
:root {
  --color-primary:        #2563EB;
  --color-primary-hover:  #1D4ED8;
  --color-secondary:      #3B82F6;
  --color-accent:         #F97316;
  --color-accent-hover:   #EA6C0A;
  --color-bg:             #F8FAFC;
  --color-surface:        #FFFFFF;
  --color-text-primary:   #1E293B;
  --color-text-secondary: #64748B;
  --color-border:         #E2E8F0;
  --color-success:        #10B981;
  --color-error:          #EF4444;
  --color-error-bg:       #FEF2F2;
  --color-warning:        #F59E0B;

  /* Category badge colors */
  --badge-news:       #DBEAFE;
  --badge-news-text:  #1D4ED8;
  --badge-tech:       #EDE9FE;
  --badge-tech-text:  #6D28D9;
  --badge-marketing:  #FEF3C7;
  --badge-marketing-text: #92400E;
  --badge-design:     #FCE7F3;
  --badge-design-text: #9D174D;
  --badge-seo:        #DCFCE7;
  --badge-seo-text:   #166534;
  --badge-business:   #D1FAE5;
  --badge-business-text: #065F46;
  --badge-other:      #F1F5F9;
  --badge-other-text: #475569;

  /* Shadows */
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow-card-hover: 0 8px 25px -5px rgb(0 0 0 / 0.12), 0 4px 10px -6px rgb(0 0 0 / 0.08);

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --sidebar-width: 300px;
  --topbar-height: 68px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   350ms ease;

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-full: 9999px;
}

/* ── Dark Mode Tokens ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:             #0F172A;
    --color-surface:        #1E293B;
    --color-text-primary:   #F1F5F9;
    --color-text-secondary: #94A3B8;
    --color-border:         #334155;
    --color-primary:        #3B82F6;
    --color-primary-hover:  #2563EB;

    --badge-news:       #1E3A5F;
    --badge-news-text:  #93C5FD;
    --badge-tech:       #2E1B69;
    --badge-tech-text:  #C4B5FD;
    --badge-marketing:  #3D2B06;
    --badge-marketing-text: #FCD34D;
    --badge-design:     #4A1040;
    --badge-design-text: #F9A8D4;
    --badge-seo:        #14532D;
    --badge-seo-text:   #86EFAC;
    --badge-business:   #064E3B;
    --badge-business-text: #6EE7B7;
    --badge-other:      #1E293B;
    --badge-other-text: #94A3B8;

    --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-card-hover: 0 8px 25px -5px rgb(0 0 0 / 0.4), 0 4px 10px -6px rgb(0 0 0 / 0.3);
    --color-error-bg: #2D1B1B;
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.875rem;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ── Focus Visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar Styling ────────────────────────────────────── */
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-full);
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-secondary);
}

/* ── App Layout ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition-normal), min-width var(--transition-normal), transform var(--transition-normal);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
}

/* Add Feed Form */
.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color var(--transition-fast), color var(--transition-fast),
              box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-accent {
  background: var(--color-accent);
  color: white;
  width: 100%;
  margin-top: 4px;
  min-height: 40px;
  font-size: 0.875rem;
}

.btn-accent:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 4px 12px rgb(249 115 22 / 0.35);
}

.btn-accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 5px;
  border-radius: var(--radius-sm);
  min-height: 30px;
  min-width: 30px;
}

.btn-danger-ghost:hover {
  background: #FEE2E2;
  color: var(--color-error);
}

/* Feeds List */
.sidebar-feeds {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-feeds-header {
  padding: 8px 20px 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.feed-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  transition: background-color var(--transition-fast);
  cursor: default;
}

.feed-list-item:hover {
  background: var(--color-bg);
}

.drag-handle {
  display: flex;
  align-items: center;
  color: var(--color-text-secondary);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
  margin-left: -4px;
}

.feed-list-item:hover .drag-handle {
  opacity: 1;
}

.feed-list-item.dragging {
  opacity: 0.35;
}

.feed-list-item.drag-over {
  background: #EFF6FF;
  border-radius: var(--radius-sm);
  outline: 1px solid #BFDBFE;
}

.feed-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--color-border);
}

.feed-info {
  flex: 1;
  min-width: 0;
}

.feed-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.category-badge.news       { background: var(--badge-news);      color: var(--badge-news-text); }
.category-badge.tech       { background: var(--badge-tech);      color: var(--badge-tech-text); }
.category-badge.marketing  { background: var(--badge-marketing); color: var(--badge-marketing-text); }
.category-badge.design     { background: var(--badge-design);    color: var(--badge-design-text); }
.category-badge.business   { background: var(--badge-business);  color: var(--badge-business-text); }
.category-badge.seo        { background: var(--badge-seo);       color: var(--badge-seo-text); }
.category-badge.other      { background: var(--badge-other);     color: var(--badge-other-text); }

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.countdown-text {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.8;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

.filter-select {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.last-updated {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  min-height: 36px;
  white-space: nowrap;
}

.btn-refresh:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-refresh:active {
  transform: translateY(1px);
}

.btn-refresh.loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}

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

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: wrap;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.filter-group-topics {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.filter-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  padding-right: 2px;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.filter-chips-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  padding-right: 24px;
}

.filter-chips-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-family: var(--font-body);
  font-weight: 450;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.3;
}

.filter-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
}

.filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 500;
}

.filter-chip .chip-count {
  font-size: 0.5625rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 0 4px;
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.3);
}

.filter-status {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-status:empty {
  display: none;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Article category tags inside cards */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.article-tag {
  font-size: 0.5625rem;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  line-height: 1.4;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Content Area */
.content-area {
  padding: 16px;
  flex: 1;
}

/* ── Cards Grid (JS Masonry) ──────────────────────────────── */
.cards-grid {
  position: relative;
  width: 100%;
}

/* ── Website Card ─────────────────────────────────────────── */
.website-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  animation: card-fade-in 0.4s ease both;
}

.website-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for multiple cards */
.website-card:nth-child(1) { animation-delay: 0ms; }
.website-card:nth-child(2) { animation-delay: 60ms; }
.website-card:nth-child(3) { animation-delay: 120ms; }
.website-card:nth-child(4) { animation-delay: 180ms; }
.website-card:nth-child(5) { animation-delay: 240ms; }
.website-card:nth-child(6) { animation-delay: 300ms; }
.website-card:nth-child(n+7) { animation-delay: 360ms; }

.card-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--color-border);
}

.card-site-name {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-external-link {
  color: var(--color-text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  cursor: pointer;
}

.card-external-link:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

/* Article List */
.article-list {
  padding: 4px 0;
}

.article-item {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item:hover {
  background: var(--color-bg);
}

.article-item:hover .article-title {
  color: var(--color-primary);
}

.article-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-border);
}

.article-thumbnail-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-border) 0%, #CBD5E1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.article-thumbnail-placeholder svg {
  width: 14px;
  height: 14px;
}

.article-content {
  flex: 1;
  min-width: 0;
}

.article-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin-bottom: 2px;
  transition: color var(--transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-description {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.article-date {
  font-size: 0.625rem;
  color: var(--color-text-secondary);
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Card Footer */
.card-footer {
  padding: 6px 12px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-footer-text {
  font-size: 0.625rem;
  color: var(--color-text-secondary);
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--color-primary);
  color: white;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.btn-retry:hover {
  background: var(--color-primary-hover);
}

/* Card Error State */
.card-error {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--color-text-secondary);
}

.card-error-icon {
  color: var(--color-error);
  opacity: 0.7;
}

.card-error-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.card-error-message {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  max-width: 220px;
}

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border) 0%,
    #F1F5F9 50%,
    var(--color-border) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease-in-out infinite;
}

@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(
      90deg,
      #334155 0%,
      #475569 50%,
      #334155 100%
    );
    background-size: 200% 100%;
  }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.skeleton-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.skeleton-favicon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
}

.skeleton-title {
  height: 16px;
  flex: 1;
  max-width: 160px;
}

.skeleton-article {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}

.skeleton-article:last-child {
  border-bottom: none;
}

.skeleton-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.skeleton-line {
  height: 11px;
  border-radius: var(--radius-sm);
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-line-shorter {
  width: 40%;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 16px;
}

.empty-state-illustration {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.empty-state-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  max-width: 340px;
  line-height: 1.6;
}

.empty-state-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  margin-top: 8px;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: toast-slide-in 0.3s ease both;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.hiding {
  opacity: 0;
  transform: translateX(20px);
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error   .toast-icon { color: var(--color-error); }
.toast.info    .toast-icon { color: var(--color-primary); }
.toast.warning .toast-icon { color: var(--color-warning); }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.toast-close {
  color: var(--color-text-secondary);
  flex-shrink: 0;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  min-width: 22px;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg);
}

/* ── Mobile Overlay ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible {
  display: block;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── No Results State ─────────────────────────────────────── */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
  color: var(--color-text-secondary);
}

.no-results-icon {
  width: 56px;
  height: 56px;
  background: var(--color-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.no-results-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.no-results-text {
  font-size: 0.875rem;
  max-width: 260px;
}

/* ── Filter Settings Button ───────────────────────────────── */
.filter-settings-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-settings-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px 12px;
  position: relative;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.modal-body {
  padding: 12px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 24px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--color-border);
}

/* ── Modal size variant ───────────────────────────────────── */
.modal--sm {
  max-width: 420px;
}

/* ── Form label row (label + inline action button) ────────── */
.form-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.btn-tiny {
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  opacity: 0.6;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.btn-tiny:hover {
  opacity: 1;
  color: var(--color-text-primary);
}

/* ── Categories Editor ────────────────────────────────────── */
.category-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.category-item-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.category-item-delete:hover {
  color: var(--color-error);
  background: #FEE2E2;
}

.category-add-row {
  display: flex;
  gap: 8px;
}

.category-add-row .form-input {
  flex: 1;
}

/* ── Topic Groups Editor ──────────────────────────────────── */
.topic-groups-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.topic-group-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--color-bg);
  transition: border-color var(--transition-fast);
}

.topic-group-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.topic-group-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.topic-group-label-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
}

.topic-group-label-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.topic-group-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.topic-group-delete:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.topic-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 28px;
}

.topic-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: 0.6875rem;
  font-family: var(--font-body);
  white-space: nowrap;
  cursor: default;
}

.topic-group-chip-remove {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 10px;
  cursor: pointer;
  border: none;
  padding: 0;
  line-height: 1;
  transition: background var(--transition-fast);
}

.topic-group-chip-remove:hover {
  background: rgba(255, 255, 255, 0.45);
}

.topic-group-empty {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  font-style: italic;
  padding: 4px 0;
}

.btn-add-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px dashed var(--color-border);
  background: none;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.btn-add-group:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
}

/* Topic Pool */
.topic-pool-section {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

.topic-pool-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.topic-pool-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.topic-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.topic-pool-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.topic-pool-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.04);
}

.topic-pool-chip.assigned {
  opacity: 0.35;
  pointer-events: none;
  text-decoration: line-through;
}

.topic-pool-chip .pool-chip-count {
  font-size: 0.5625rem;
  opacity: 0.6;
}

/* Button variants */
.btn-secondary {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--color-bg);
}

/* ── Utility Classes ──────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-error {
  color: var(--color-error);
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1100px) {
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .cards-grid {
    /* JS masonry handles column count automatically */
  }

  .topbar {
    padding: 10px 16px;
  }

  .content-area {
    padding: 12px;
  }

  .filter-bar {
    padding: 6px 12px;
    gap: 8px;
  }

  .filter-group-topics {
    order: 3;
    flex-basis: 100%;
  }

  .last-updated {
    display: none;
  }

  .filter-select {
    display: none;
  }

  .topbar-right {
    gap: 8px;
  }

  .btn-refresh span {
    display: none;
  }

  .btn-refresh {
    padding: 8px 10px;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .search-wrapper {
    max-width: 100%;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

/* ── Feature 1: Read/Unread Tracking ─────────────────────── */

/* Read article items: dimmed + strikethrough title */
.article-item.read {
  opacity: 0.45;
  transition: opacity var(--transition-normal);
}

.article-item.read .article-title {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-secondary);
}

/* "Ongelezen" filter chip — reuses .filter-chip base, accent color when active */
.filter-chip[data-filter="unread"].active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.filter-chip[data-filter="unread"]:not(.active):hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(249, 115, 22, 0.06);
}

/* "Alerts" filter chip — accented when active */
.filter-chip[data-filter="alerts"].active {
  background: #7C3AED;
  border-color: #7C3AED;
  color: white;
}

.filter-chip[data-filter="alerts"]:not(.active):hover {
  border-color: #7C3AED;
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.06);
}

/* "Alles gelezen" button inside card header */
.btn-mark-all-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.6rem;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-mark-all-read:hover {
  background: var(--color-bg);
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

/* ── Feature 2: Feed URL Detection ───────────────────────── */

/* Input wrapper for the RSS URL field + Detect button */
.feed-url-wrapper {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.feed-url-wrapper .form-input {
  flex: 1;
  min-width: 0;
}

.btn-detect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-detect:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.05);
}

.btn-detect:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Spinner inside detect button */
.btn-detect .detect-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: detect-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Dropdown of detected feed results below the input */
.feed-detect-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: toast-slide-in 0.18s ease both;
}

.feed-detect-results:empty {
  display: none;
}

.feed-detect-result-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.feed-detect-result-item:last-child {
  border-bottom: none;
}

.feed-detect-result-item:hover {
  background: var(--color-bg);
}

.feed-detect-result-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-detect-result-url {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Feature 3: Keyword Alerts ────────────────────────────── */

/* Article with a keyword match gets a coloured left border */
.article-item.keyword-match {
  border-left: 3px solid var(--color-accent);
  padding-left: 9px; /* compensate for added border */
}

/* Keyword highlight inside the title */
mark.keyword-highlight {
  background: #FEF08A;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-style: inherit;
  font-weight: inherit;
}

@media (prefers-color-scheme: dark) {
  mark.keyword-highlight {
    background: #713F12;
    color: #FEF9C3;
  }
}

/* Small alert badge next to article title */
.keyword-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 4px;
}

.keyword-alert-badge svg {
  width: 8px;
  height: 8px;
}

/* Keyword alert badge in article-title wrapper */
.article-title-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* "Zoekwoorden" button in filter bar — reuses filter-settings-btn */
.btn-keywords-settings {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-keywords-settings:hover {
  background: var(--color-bg);
  color: #7C3AED;
}

.btn-keywords-settings.has-keywords {
  color: #7C3AED;
}

/* ── Keywords Modal ───────────────────────────────────────── */

.keyword-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.keyword-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.keyword-item-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.keyword-item-text::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.keyword-item-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.keyword-item-delete:hover {
  color: var(--color-error);
  background: #FEE2E2;
}

.keyword-empty-hint {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-style: italic;
  padding: 8px 0 4px;
  text-align: center;
}

.keyword-add-row {
  display: flex;
  gap: 8px;
}

.keyword-add-row .form-input {
  flex: 1;
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .pulse-dot {
    animation: none;
  }

  .skeleton {
    animation: none;
    background: var(--color-border);
  }
}

/* ── Sidebar User Section ─────────────────────────────────── */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.btn-logout {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.btn-logout:hover {
  color: var(--color-error);
  background: var(--color-error-bg);
  border-color: var(--color-error);
}
