/* Brief Nine - Editorial Minimalism
   A refined, clean aesthetic optimized for readability */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500&display=swap');

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

:root {
  /* Paper & Ink - Light Mode */
  --bg-paper: #faf9f7;
  --bg-card: #ffffff;
  --bg-subtle: #f5f4f2;
  --bg-hover: #f0efed;

  /* Typography */
  --ink: #1a1a1a;
  --ink-secondary: #4a4a4a;
  --ink-muted: #8a8a8a;
  --ink-faint: #b5b5b5;

  /* Accent - Warm Terracotta */
  --accent: #c54b3c;
  --accent-hover: #b03d2f;
  --accent-soft: rgba(197, 75, 60, 0.08);
  --accent-border: rgba(197, 75, 60, 0.2);

  /* Semantic */
  --success: #2d8a5f;
  --warning: #c4851c;
  --danger: #c54b3c;

  /* Structure */
  --border: #e8e7e5;
  --border-strong: #d5d4d2;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lifted: 0 4px 12px rgba(0, 0, 0, 0.06);

  /* Spacing */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Fonts */
  --font-logo: 'Source Serif 4', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Story Font Sizes - Default is medium */
  --story-topic-size: 0.625rem;
  --story-title-size: 0.9375rem;
  --story-title-weight: 500;
  --story-padding: 1rem 0;

  /* Bias Colors */
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-paper: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-subtle: #252525;
  --bg-hover: #2d2d2d;

  --ink: #f5f5f5;
  --ink-secondary: #c5c5c5;
  --ink-muted: #888888;
  --ink-faint: #555555;

  --accent: #e07060;
  --accent-hover: #d55d4c;
  --accent-soft: rgba(224, 112, 96, 0.12);
  --accent-border: rgba(224, 112, 96, 0.25);

  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;

  --border: #2d2d2d;
  --border-strong: #404040;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lifted: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* System preference for dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-paper: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-subtle: #252525;
    --bg-hover: #2d2d2d;

    --ink: #f5f5f5;
    --ink-secondary: #c5c5c5;
    --ink-muted: #888888;
    --ink-faint: #555555;

    --accent: #e07060;
    --accent-hover: #d55d4c;
    --accent-soft: rgba(224, 112, 96, 0.12);
    --accent-border: rgba(224, 112, 96, 0.25);

    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;

    --border: #2d2d2d;
    --border-strong: #404040;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lifted: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

/* Font Size Presets */
[data-font-size="small"] {
  --story-topic-size: 0.5rem;
  --story-title-size: 0.8125rem;
  --story-padding: 0.75rem 0;
}

[data-font-size="large"] {
  --story-topic-size: 0.75rem;
  --story-title-size: 1.125rem;
  --story-padding: 1.25rem 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ============================================
   HEADER
   ============================================ */

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  gap: 0.5rem;
}

.header-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.logo h1 {
  font-family: var(--font-logo);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  display: block;
}

.logo-icon svg path[fill="#0071e3"] {
  fill: var(--accent);
}

.logo-text {
  font-family: var(--font-logo);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.tagline {  font-size: 0.625rem;  font-weight: 500;  letter-spacing: 0.04em;  text-transform: none;  color: var(--ink-muted);  cursor: pointer;  transition: all 0.2s ease;  white-space: nowrap;  background: rgba(200, 80, 70, 0.08);  border: 1px solid rgba(200, 80, 70, 0.2);  padding: 0.25rem 0.5rem;  border-radius: 3px;}.tagline:hover {  color: var(--accent);  background: rgba(200, 80, 70, 0.12);  border-color: rgba(200, 80, 70, 0.3);}

/* ============================================
   CATEGORY TABS
   ============================================ */

.category-tabs {
  display: flex;
  gap: 0.125rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: center;
}

.category-tabs::-webkit-scrollbar {

}

.category-tab {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 0.5rem 0.875rem;
  font-size: inherit;
  font-weight: 450;
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  position: relative;
}

.category-icon {
  font-size: 0.875rem;
  line-height: 1;
}

.category-tab:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.category-tab.active {
  color: var(--ink);
  font-weight: 500;
}

.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Add Category Button */
.category-tab.add-category-btn {
  color: var(--accent);
  border: 1px dashed var(--accent-border);
  background: transparent;
  padding: 0.375rem 0.625rem;
}

.category-tab.add-category-btn:hover {
  background: var(--accent-soft);
  border-style: solid;
}

.category-tab.add-category-btn::after {

}

/* ============================================
   HEADER ACTIONS
   ============================================ */

.header-actions {
  position: absolute;
  right: 1.5rem;
  top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

/* Google Sign-in Button */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink-secondary);
  font-size: inherit;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-google:hover {
  background: var(--bg-subtle);
  border-color: var(--ink-muted);
  color: var(--ink);
}

.btn-google svg {
  flex-shrink: 0;
}

.btn-google-large {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  background: var(--bg-subtle);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-profile:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: inherit;
  font-weight: 450;
  color: var(--ink);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.stories-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* List Layout */
.stories-container.layout-list {
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 680px;
  margin: 0 auto;
}

.stories-container.layout-list .story-card {
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.stories-container.layout-list .story-card:hover {
  background: var(--bg-subtle);
  box-shadow: none;
  margin: 0 -0.75rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border-bottom-color: transparent;
}

.stories-container.layout-list .story-card:last-child {
  border-bottom: none;
}

.stories-container.layout-list .story-main {
  flex-direction: row;
  align-items: center;
}

/* List view expanded: use grid to keep actions on right of title row */
.stories-container.layout-list .story-card.expanded {
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
}

.stories-container.layout-list .story-card.expanded .story-main {
  display: contents !important;
}

.stories-container.layout-list .story-card.expanded .story-header {
  grid-column: 1;
  grid-row: 1;
}

.stories-container.layout-list .story-card.expanded .story-actions-sidebar {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.stories-container.layout-list .story-card.expanded .story-body {
  grid-column: 1 / -1;
  grid-row: 2;
}

.stories-container.layout-list .story-header {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: var(--story-padding);
}

.stories-container.layout-list .story-header-top {

}

.stories-container.layout-list .story-headline {
  flex: 1;
  gap: 0.25rem;
}

.stories-container.layout-list .story-topic {
  margin-bottom: 0.125rem;
  font-size: var(--story-topic-size);
}

.stories-container.layout-list .story-title {
  font-size: var(--story-title-size);
  font-weight: 500;
  line-height: 1.4;
}

/* Show badges in list view */
.stories-container.layout-list .story-badges {
  display: flex !important;
  /* display: none; */

}

.stories-container.layout-list .story-meta-bottom {
  margin-top: 0.125rem;
}

.stories-container.layout-list .story-actions-sidebar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  padding: 0 0 0 0.5rem;
}

.stories-container.layout-list .action-btn-side {
  width: 28px;
  height: 28px;
}

.stories-container.layout-list .story-card {
  animation: none;
  opacity: 1;
  flex-direction: row;
}

/* List view expanded state */
.stories-container.layout-list .story-card.expanded {
  background: var(--bg-subtle);
  margin: 0 -0.75rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border-bottom-color: transparent;
}

.stories-container.layout-list .story-card.expanded .story-body {
  padding: 0 0 1rem;
  border-top: none;
}

.stories-container.layout-list .story-card.expanded .story-summary {
  padding-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ============================================
   STORY CARD
   ============================================ */

.story-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: row;
  cursor: pointer;
}

.story-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-subtle);
}

.story-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.story-header {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.story-number {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Story Actions Sidebar */
.story-actions-sidebar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  align-content: center;
}

.action-btn-side {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn-side:hover {
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

.action-btn-side.like:hover {
  background: rgba(45, 138, 95, 0.1);
  color: var(--success);
}

.action-btn-side.dislike:hover {
  background: rgba(196, 133, 28, 0.1);
  color: var(--warning);
}

.action-btn-side.block:hover {
  background: rgba(197, 75, 60, 0.1);
  color: var(--danger);
}

.action-btn-side.share:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.action-btn-side.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Story Content */
.story-topic {
  display: inline-block;
  font-size: var(--story-topic-size, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.story-headline {
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.story-title {
  font-family: var(--font-sans);
  font-size: var(--story-title-size, 1rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.story-meta-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-separator {
  color: var(--ink-faint);
  font-size: 0.75rem;
}

.meta-read-time {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.meta-paywall {
  font-size: 0.75rem;
}

.story-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-trending {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-why {

  background: var(--bg-subtle);

  color: var(--ink-muted);

}

.badge-updated {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}


.story-meta-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 450;
}

.expand-icon {
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: transform 0.2s ease;
}

.story-card.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Story Expanded Content */
.story-body {
  display: none;

  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.story-card.expanded .story-body {
  display: block;
}

.story-summary {
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  padding-top: 1.25rem;
}

.story-sources {
  margin-bottom: 1.25rem;
}

.story-sources h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.625rem;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  color: var(--ink-secondary);
  font-size: inherit;
  font-weight: 450;
  text-decoration: none;
  transition: all 0.15s ease;
}

.source-link:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.source-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.source-paywall-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--warning);
  background: rgba(196, 133, 28, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  margin-left: 0.25rem;
}

/* Story Actions (in expanded body) */
.story-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1.25rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-secondary);
  font-size: inherit;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.action-btn.like:hover {
  background: rgba(45, 138, 95, 0.1);
  border-color: rgba(45, 138, 95, 0.2);
  color: var(--success);
}

.action-btn.dislike:hover {
  background: rgba(196, 133, 28, 0.1);
  border-color: rgba(196, 133, 28, 0.2);
  color: var(--warning);
}

.action-btn.block:hover {
  background: rgba(197, 75, 60, 0.1);
  border-color: rgba(197, 75, 60, 0.2);
  color: var(--danger);
}

.action-btn.active {
  background: var(--accent);
  color: white;
}

/* Inline Actions */
.story-actions-inline {
  display: flex;
  gap: 0.25rem;
}

.action-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn-inline:hover {
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

.action-btn-inline.like:hover {
  background: rgba(45, 138, 95, 0.1);
  color: var(--success);
}

.action-btn-inline.dislike:hover {
  background: rgba(196, 133, 28, 0.1);
  color: var(--warning);
}

.action-btn-inline.block:hover {
  background: rgba(197, 75, 60, 0.1);
  color: var(--danger);
}

.action-btn-inline.active {
  background: var(--accent);
  color: white;
}

/* ============================================
   FOOTER MESSAGE
   ============================================ */

.footer-message {
  font-family: var(--font-sans);
  text-align: center;
  padding: 1.5rem 1rem 0.75rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 400;
  font-style: normal;
}

/* Bottom Controls Container */
.bottom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Layout Toggle Button */
.layout-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: inherit;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.layout-toggle svg {
  flex-shrink: 0;
}

/* Show grid icon when in list mode, list icon when in grid mode */
.layout-toggle .layout-icon-list {

}

.layout-toggle .layout-icon-grid {
  display: block;
}

.layout-toggle.show-list .layout-icon-list {
  display: block;
}

.layout-toggle.show-list .layout-icon-grid {

}

/* Font Size Selector */
.font-size-selector {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.font-size-label {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-right: 0.125rem;
}

.font-size-btn {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.font-size-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.font-size-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Site Footer */
.site-footer {
  margin-top: 1rem;
  padding: 1.5rem 0 2rem;
  text-align: center;
}

.footer-links {
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-divider {
  margin: 0 0.625rem;
  opacity: 0.4;
}

.footer-copyright {
  opacity: 0.6;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lifted);
}

.modal.modal-lg {
  max-width: 480px;
}

.modal.modal-sm {
  max-width: 360px;
}

/* Welcome Modal */
.modal.modal-welcome {
  max-width: 400px;
  max-height: calc(100vh - 2rem);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  margin: 1rem;
}

.welcome-content {
  padding: 1.5rem 1.5rem;
  text-align: center;
}

.welcome-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.welcome-logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.welcome-description {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.welcome-description strong {
  color: var(--ink);
  font-weight: 600;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
  background: var(--bg-subtle);
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
}

.welcome-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--ink);
}

.welcome-feature .feature-icon {
  font-size: 1rem;
  width: 1.5rem;
  text-align: center;
}

.welcome-features-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin: 0 0 0.25rem 0;
}

.feature-icon-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.welcome-features-note {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0.5rem 0 0 0;
  font-style: italic;
  line-height: 1.4;
}

.welcome-skip {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: inherit;
  cursor: pointer;
  padding: 0.75rem;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}

.welcome-skip:hover {
  color: var(--ink);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   BLOCK OPTIONS
   ============================================ */

.block-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.block-option {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.block-option:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.block-option.selected {
  border-color: var(--danger);
  background: rgba(197, 75, 60, 0.05);
}

.block-option input {

}

.block-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-muted);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.block-option.selected .block-radio {
  border-color: var(--danger);
}

.block-option.selected .block-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.block-label {
  flex: 1;
}

.block-label-type {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.block-label-value {
  display: block;
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 450;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--ink-secondary);
}

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

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

.btn-danger:hover {
  background: var(--accent-hover);
}

/* Coming Soon Button */
.btn-coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-coming-soon:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================
   SETTINGS
   ============================================ */

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

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.settings-hint {
  font-size: inherit;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.settings-explanation {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  line-height: 1.7;
}

.settings-explanation strong {
  color: var(--ink);
}

/* Layout Options */
.layout-options {
  display: flex;
  gap: 0.75rem;
}

.layout-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-option:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.layout-option input:checked ~ .layout-preview {
  color: var(--accent);
}

.layout-option input {

}

.layout-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-muted);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.layout-option input:checked + .layout-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.layout-option input:checked + .layout-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.layout-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.layout-name {
  font-size: inherit;
  font-weight: 450;
  color: var(--ink-secondary);
}

.layout-option input:checked ~ .layout-preview .layout-name {
  color: var(--ink);
  font-weight: 500;
}

/* Preference Options */
.preference-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preference-option {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preference-option:hover {
  background: var(--bg-hover);
}

.preference-option input {

}

.preference-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-muted);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
  margin-top: 0.0625rem;
}

.preference-option input:checked + .preference-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.preference-option input:checked + .preference-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.preference-label {
  flex: 1;
}

.preference-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.preference-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Schedule Options */
.schedule-options {
  display: flex;
  gap: 0.75rem;
}

.schedule-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.schedule-option:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.schedule-option input {

}

.schedule-option input:checked ~ .schedule-label {
  color: var(--accent);
}

.schedule-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-muted);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.schedule-option input:checked + .schedule-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.schedule-option input:checked + .schedule-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.schedule-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.schedule-time {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--ink);
}

.schedule-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.coming-soon-note {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.coming-soon-note p {
  font-size: inherit;
  color: var(--ink-secondary);
  margin: 0;
}

/* Delivery Options */
.delivery-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.delivery-option {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.delivery-option:hover:not(.disabled) {
  background: var(--bg-hover);
}

.delivery-option.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.delivery-option input {

}

.delivery-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-muted);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.delivery-option input:checked + .delivery-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.delivery-option input:checked + .delivery-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.delivery-label {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delivery-name {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--ink);
}

.delivery-status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.delivery-status.active {
  background: rgba(45, 138, 95, 0.1);
  color: var(--success);
}

.delivery-status.locked {
  background: var(--bg-hover);
  color: var(--ink-muted);
}

/* Interest/Coming Soon Options */
.coming-soon-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin: 1.25rem 0 0.25rem;
}

.interest-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.interest-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-secondary);
  font-size: inherit;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.15s ease;
}

.interest-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-border);
}

.interest-btn .interest-check {

  color: var(--success);
  font-weight: 600;
}

.interest-btn.interested {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.interest-btn.interested .interest-check {
  display: inline;
}

.interest-icon {
  font-size: 1rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: var(--bg-subtle);
  padding: 1.125rem;
  border-radius: var(--radius);
  text-align: center;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Blocked Items */
.blocked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blocked-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem 0.375rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  font-size: inherit;
}

.blocked-item-type {
  color: var(--ink-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.blocked-item-value {
  color: var(--ink);
  font-weight: 450;
}

.blocked-item-remove {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.blocked-item-remove:hover {
  color: var(--danger);
}

.empty-state {
  color: var(--ink-muted);
  font-size: inherit;
  font-style: italic;
}

/* Top Topics */
.top-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: inherit;
  color: var(--accent);
  font-weight: 450;
}

.topic-weight {
  background: var(--accent);
  color: white;
  padding: 0.125rem 0.4375rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Category Picker Modal */
.picker-intro {
  color: var(--ink-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.picker-section {
  margin-bottom: 1.5rem;
}

.picker-section:last-child {
  margin-bottom: 0;
}

.picker-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.picker-item-added {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.picker-item-added:hover {
  border-color: var(--danger);
}

.picker-item-added:hover .picker-action {
  color: var(--danger);
}

.picker-icon {
  font-size: 1rem;
}

.picker-name {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--ink);
}

.picker-action {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}


/* Suggest Topic Form */
.suggest-section {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.suggest-form {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem;
}

.suggest-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--bg-card);
  color: var(--ink);
}

.suggest-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.suggest-form button {
  padding: 0.5rem 1rem;
  font-size: inherit;
}

.suggest-hint {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin: 0;
}
/* ============================================
   LOADING STATE
   ============================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.625rem;
}

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

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 450;
  box-shadow: var(--shadow-lifted);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 300;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--ink);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .stories-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .header-content {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-inner {
    display: contents;
  }

  /* Row 1: Logo + Actions */
  .logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    order: 1;
  }

  .header-actions {
    position: static;
    order: 2;
  }

  /* Put actions visually in same row as logo using absolute positioning */
  .header-content {
    position: relative;
  }

  .header-actions {
    position: absolute;
    right: 1rem;
    top: 0.5rem;
  }

  /* Row 2: Categories */
  .category-tabs {
    width: 100%;
    order: 3;
    justify-content: flex-start;
    padding: 0.25rem 0;
    margin-top: 0;
  }

  .tagline {
    display: none !important;
  }

  .btn-google {
    padding: 0.375rem 0.5rem;
    font-size: 0;
    gap: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    justify-content: center;
  }

  .btn-google svg {
    font-size: initial;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    padding: 0.375rem;
  }

  .category-tab {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }

  .category-tab.add-category-btn {
    padding: 0.375rem;
    min-width: 28px;
    border-radius: 50%;
  }

  .category-tab.add-category-btn img {
    margin: 0;
  }

  .logo-text {
    font-size: 1rem;
  }

  .main-content {
    padding: 1.25rem 1rem;
  }

  .stories-container {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  .story-header {
    padding: 1rem;
  }

  .story-body {
    padding: 0 1rem 1rem;
  }

  .story-title {
    font-size: 0.875rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }

  .user-name {
  
  }

  .user-profile {
    padding: 0.25rem;
  }

  .schedule-options {
    flex-direction: column;
  }

  .layout-options {
    flex-direction: column;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.story-card {
  animation: fadeIn 0.3s ease forwards;
}

.story-card:nth-child(1) { animation-delay: 0.02s; }
.story-card:nth-child(2) { animation-delay: 0.04s; }
.story-card:nth-child(3) { animation-delay: 0.06s; }
.story-card:nth-child(4) { animation-delay: 0.08s; }
.story-card:nth-child(5) { animation-delay: 0.10s; }
.story-card:nth-child(6) { animation-delay: 0.12s; }
.story-card:nth-child(7) { animation-delay: 0.14s; }
.story-card:nth-child(8) { animation-delay: 0.16s; }
.story-card:nth-child(9) { animation-delay: 0.18s; }

.update-time {
  font-style: normal;
  color: var(--ink-muted);
  font-size: inherit;
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  background: var(--bg-hover);
}

.theme-options {
  display: flex;
  gap: 0.5rem;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-option:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.theme-option.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-option svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   STORY INDICATORS
   ============================================ */

/* Story Age */
.meta-age {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 450;
}

/* Source Count Badge */
.badge-sources {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-size: 0.75rem;
  padding: 0.1875rem 0.4375rem;
  border-radius: var(--radius-sm);
}

/* Bias Indicator */

  color: var(--ink-muted);
}

  background: rgba(239, 68, 68, 0.25);
}

/* Dark mode specific overrides */
[data-theme="dark"] .modal.modal-welcome {
  background: var(--bg-card);
}

[data-theme="dark"] .feature-icon-symbol {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] img {
  opacity: 0.95;
}

/* Reading History Section */
.section-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-header-with-action h3 {
  margin: 0;
}

.text-btn {
  background: none;
  border: none;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.text-btn-danger {
  color: var(--accent);
}

.text-btn-danger:hover {
  background: rgba(197, 75, 60, 0.1);
}

.reading-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  transition: background 0.15s ease;
}

.history-item:hover {
  background: var(--bg-tertiary);
}

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

.history-item-headline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.history-item-category {
  text-transform: capitalize;
}

.history-item-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s ease;
}

.history-item:hover .history-item-remove {
  opacity: 1;
}

.history-item-remove:hover {
  color: var(--accent);
  background: rgba(197, 75, 60, 0.1);
}

.history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.history-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.history-item {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.history-see-more {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-see-more:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* Settings Modal Typography - Standardized */
.modal-body {
  font-size: 0.875rem;
  line-height: 1.5;
}

.settings-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.settings-hint {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.settings-explanation {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-header-with-action h3 {
  margin: 0;
  font-size: 0.9375rem;
}

/* Consistent button/option text */
.theme-option,
.layout-option,
.schedule-option,
.interest-btn,
.preference-option {
  font-size: 0.8125rem;
}

.stat-card .stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
/* Email preferences styles */
.freq-btn, .sched-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.freq-btn:hover, .sched-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.freq-btn.active, .sched-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.cat-checkbox {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-checkbox:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.cat-checkbox input {

}
.test-email-btn:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-strong) !important;
}
.test-email-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.test-email-btn {
  padding: 0.3rem 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  cursor: pointer;
  font-size: 0.75rem;
}
#email-preferences label,
#email-preferences p {
  color: var(--ink-secondary) !important;
}
