/* ============================================
   LIXORA – NewsAnalyse
   Warm editorial dark theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@900&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --bg:        #1a1210;
  --surface:   #231815;
  --surface-2: #2d201c;
  --surface-3: #382820;
  --border:    #402e28;
  --border-2:  #503a32;

  --text:      #f2ece3;
  --text-2:    #a89080;
  --text-3:    #6e5848;

  --green:        oklch(0.68 0.11 155);
  --green-glow:   oklch(0.68 0.11 155 / 0.18);
  --green-dim:    oklch(0.68 0.11 155 / 0.12);
  --green-dark:   oklch(0.35 0.09 155);

  --cyan:      var(--green);
  --cyan-glow: var(--green-glow);
  --cyan-dim:  var(--green-dim);

  --amber:      oklch(0.76 0.14 68);
  --amber-glow: oklch(0.76 0.14 68 / 0.18);
  --amber-dim:  oklch(0.76 0.14 68 / 0.12);

  --red:   #d9536a;
  --blue:  #5b8fe8;

  --bias-far-left:  #c23040;
  --bias-left:      #d86070;
  --bias-cleft:     #c08090;
  --bias-center:    #706860;
  --bias-cright:    #8090b8;
  --bias-right:     #5878c8;
  --bias-far-right: #3858b0;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  --nav-h:  62px;
  --max-w:  1280px;
  --pad:    clamp(16px, 3vw, 36px);

  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-font="b"] {
  --font-display: 'DM Serif Display', serif;
  --font-body:    'DM Sans', sans-serif;
}

[data-font="c"] {
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;
}

[data-theme="light"] {
  --bg:        #f0e7d5;
  --surface:   #f8f2e4;
  --surface-2: #ede4d0;
  --surface-3: #e4d8c0;
  --border:    #d4c8b0;
  --border-2:  #c0b09a;
  --text:      #1a1210;
  --text-2:    #5a4840;
  --text-3:    #9a8070;
  --green-glow: oklch(0.68 0.11 155 / 0.08);
  --green-dim:  oklch(0.68 0.11 155 / 0.07);
  --shadow-sm: 0 1px 4px rgba(60,40,30,0.08);
  --shadow-md: 0 4px 20px rgba(60,40,30,0.14);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background 0.35s, color 0.35s;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  gap: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

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

.nav-logo-stack {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0px;
  transition: color 0.2s;
}

.nav-logo:hover .nav-logo-stack { color: var(--green); }

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: var(--text-2); }

.nav-btn-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s;
}

.nav-btn-icon:hover { color: var(--text); background: var(--surface-2); }

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
}

.nav-avatar:hover { border-color: var(--green); }

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

/* ============================================
   TOPIC FILTER BAR
   ============================================ */

.filter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 50px;
  flex-shrink: 0;
}

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

#filter-chips { display: contents; }

.filter-chip {
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.filter-chip:hover { color: var(--text-2); background: var(--surface-2); }

.filter-chip.active {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-dim);
}

.filter-bar-spacer { flex: 1; min-width: 16px; }

.refresh-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--amber);
  border: 1px solid var(--amber);
  background: var(--amber-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.refresh-btn:not(:disabled) { animation: pulse-soft 2.5s ease infinite; }
.refresh-btn:hover:not(:disabled) { background: oklch(0.76 0.14 68 / 0.22); }
.refresh-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.refresh-badge {
  background: var(--bg);
  color: var(--amber);
  border-radius: 8px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
}

.spinning .refresh-icon,
.spinning {
  animation: spin 0.65s linear infinite !important;
  display: inline-block;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.feed-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--pad) 60px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
}

@media (max-width: 1024px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-sidebar { display: none; }
}

/* ============================================
   FEED GREETING
   ============================================ */

.feed-greeting {
  margin-bottom: 20px;
}

.feed-greeting-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.feed-greeting-sub {
  font-size: 0.88rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============================================
   DYNAMIC FEED CARDS
   ============================================ */

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.article-card:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16/9;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.article-card:hover .card-image img { transform: scale(1.03); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--surface-3);
  color: var(--text-3);
}

.card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-topic {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.article-card .card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card:hover .card-title { color: var(--green); transition: color 0.2s; }

.card-teaser {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-3);
}

.source-count-badge {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.68rem;
  color: var(--text-2);
}

.card-meta {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Hero card ─────────────────────────────── */
.article-card--hero {
  position: relative;
  min-height: 340px;
}

.article-card--hero .card-image {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  height: 100%;
}

.article-card--hero .card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 55%, transparent 100%);
}

.article-card--hero .card-body {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  z-index: 1;
  background: none;
  padding: 0 22px;
}

.article-card--hero .card-title {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.article-card--hero:hover .card-title { color: #fff; }
.article-card--hero .card-topic { color: var(--green); }
.article-card--hero .card-teaser { color: rgba(255,255,255,0.78); }

.article-card--hero .card-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 1;
  border-top: none;
  background: rgba(0,0,0,0.42);
  color: rgba(255,255,255,0.7);
  padding: 8px 18px;
}

/* ── Lead card ─────────────────────────────── */
.article-card--lead .card-image { aspect-ratio: 4/3; }
.article-card--lead .card-title { font-size: 1.2rem; font-weight: 700; -webkit-line-clamp: 4; line-clamp: 4; }
.article-card--lead .card-teaser { -webkit-line-clamp: 3; line-clamp: 3; }

/* ── Compact card ──────────────────────────── */
.article-card--compact { flex-direction: row; min-height: 80px; }
.article-card--compact .card-image { width: 100px; flex-shrink: 0; aspect-ratio: 1; }
.article-card--compact .card-body { padding: 12px 14px; gap: 4px; }
.article-card--compact .card-title { font-size: 0.875rem; -webkit-line-clamp: 2; line-clamp: 2; }

/* ── Split card ────────────────────────────── */
.article-card--split { flex-direction: row; min-height: 180px; }
.article-card--split .card-image { width: 44%; flex-shrink: 0; aspect-ratio: unset; }
.article-card--split .card-body { padding: 20px; gap: 10px; }
.article-card--split .card-title { font-size: 1.2rem; font-weight: 700; -webkit-line-clamp: 4; line-clamp: 4; }
.article-card--split .card-teaser { -webkit-line-clamp: 4; line-clamp: 4; }

/* ── Text card ─────────────────────────────── */
.article-card--text { background: var(--surface-2); }
.article-card--text .card-body { padding: 24px 22px; }
.article-card--text .card-title { font-size: 1.4rem; font-weight: 800; -webkit-line-clamp: 5; line-clamp: 5; }

/* ============================================
   FEED SECTIONS
   ============================================ */

.news-grid { display: flex; flex-direction: column; gap: 24px; }

.feed-section--featured {
  display: grid;
  grid-template-areas: "lead stack";
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.feed-section--featured > .article-card--lead { grid-area: lead; }
.feed-section--featured > .feed-stack         { grid-area: stack; }

.feed-stack { display: flex; flex-direction: column; gap: 12px; }
.feed-stack .article-card { flex: 1; }

.feed-section--compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feed-section--compact .article-card--compact:last-child:nth-child(odd) { grid-column: 1 / -1; }

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feed-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 4px 0;
}

.feed-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.load-more-container { text-align: center; margin-top: 32px; }

.btn-load-more {
  height: 38px;
  padding: 0 28px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-load-more:hover { background: var(--surface-2); color: var(--text); }

/* ============================================
   BADGES / CHIPS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-topic {
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

.badge-topic.politik     { color: #b49af0; border-color: #b49af040; background: #b49af012; }
.badge-topic.wirtschaft  { color: var(--amber); border-color: oklch(0.76 0.14 68 / 0.3); background: var(--amber-dim); }
.badge-topic.technologie { color: var(--green); border-color: oklch(0.68 0.11 155 / 0.3); background: var(--green-dim); }
.badge-topic.wissenschaft{ color: #5dcfa8; border-color: #5dcfa840; background: #5dcfa810; }
.badge-topic.sport       { color: #f08050; border-color: #f0805040; background: #f0805012; }

.badge-ai {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid oklch(0.68 0.11 155 / 0.3);
}

.source-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.source-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid;
}

.source-chip.left   { color: #d86070; border-color: #d8607040; background: #d8607010; }
.source-chip.center { color: var(--text-3); border-color: var(--border-2); background: var(--surface-3); }
.source-chip.right  { color: #7898d8; border-color: #7898d840; background: #7898d810; }
.source-chip.cleft  { color: #c08090; border-color: #c0809040; background: #c0809010; }
.source-chip.cright { color: #90a8d8; border-color: #90a8d840; background: #90a8d810; }

/* ============================================
   BIAS BAR
   ============================================ */

.bias-bar-wrap { display: flex; flex-direction: column; gap: 5px; }

.bias-bar-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.bias-bar {
  height: 5px;
  background: linear-gradient(90deg,
    var(--bias-far-left)  0%,
    var(--bias-left)      20%,
    var(--bias-cleft)     35%,
    var(--bias-center)    50%,
    var(--bias-cright)    65%,
    var(--bias-right)     80%,
    var(--bias-far-right) 100%
  );
  border-radius: 3px;
  position: relative;
}

.bias-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  background: var(--text);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1.5px var(--text-2);
  transition: left 0.3s var(--ease);
  font-size: 7px;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bias-bar-unknown { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Inline context: dot used as standalone colour indicator, not on a bar */
.source-picker-item .bias-dot,
.source-selected-chip .bias-dot,
.story-source-card .bias-dot {
  position: static;
  transform: none;
  flex-shrink: 0;
  transition: none;
  left: unset;
  top: unset;
}

/* ============================================
   FEED SIDEBAR
   ============================================ */

.feed-sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

.sidebar-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

.trending-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--green);
  width: 16px;
  flex-shrink: 0;
  padding-top: 3px;
}

.trending-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.45;
  transition: color 0.2s;
}

.trending-item:hover .trending-title { color: var(--text); }

/* ============================================
   STATE CONTAINERS
   ============================================ */

.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  text-align: center;
}

.state-icon { font-size: 2.5rem; }

.state-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.state-desc {
  font-size: 0.88rem;
  color: var(--text-3);
  line-height: 1.6;
}

.state-desc a { color: var(--green); }

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ============================================
   ARTICLE PAGE
   ============================================ */

.article-state {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.article-layout {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px var(--pad) 60px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 32px;
  transition: color 0.2s;
}

.article-back:hover { color: var(--green); }

.article-header { margin-bottom: 28px; }

.article-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 16px;
  text-wrap: pretty;
}

.article-topic-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid oklch(0.68 0.11 155 / 0.3);
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-3);
  flex-wrap: wrap;
}

.article-meta .text-accent { color: var(--green); font-weight: 500; }

/* ── AI Tabs Section ────────────────────────── */

.ai-section {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ai-section-header {
  padding: 16px 22px 0;
  border-bottom: 1px solid var(--border);
}

.ai-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-section-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Tab buttons — used by both new .ai-tab CSS and article.js .tab-btn hook */
.ai-tabs, .tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }

.tab-btn, .ai-tab {
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover, .ai-tab:hover { color: var(--text-2); }
.tab-btn.active, .ai-tab.active { color: var(--green); border-bottom-color: var(--green); }

.ai-tab-num {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  opacity: 0.5;
}

.ai-tab.active .ai-tab-num { opacity: 0.7; color: var(--green); }

.ai-content { padding: 26px 22px; }

/* Tab panels */
.ai-content-panel, .tab-panel { display: none; }
.ai-content-panel.active, .tab-panel.active { display: block; }

/* View content (AI-generated) */
.view-content p, .ai-content p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 14px;
  text-wrap: pretty;
}

.view-content p:last-child, .ai-content p:last-child { margin-bottom: 0; }

.view-content h4, .ai-content h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
}

.view-content ul, .ai-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.view-content ul li, .ai-content ul li {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-2);
  padding-left: 18px;
  position: relative;
  text-wrap: pretty;
}

.view-content ul li::before, .ai-content ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--green);
}

.view-content ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.view-content ol li { font-size: 0.92rem; line-height: 1.7; color: var(--text-2); }
.view-content strong { color: var(--text); }

.view-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  font-size: 0.88rem;
  color: var(--text-3);
}

.view-error {
  padding: 20px 0;
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* Five Ws */
.five-ws { display: flex; flex-direction: column; gap: 14px; }

.five-w-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 2px solid var(--green);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.five-w-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.five-w-text { font-size: 0.9rem; color: var(--text-2); line-height: 1.65; }

/* Infobox */
.infobox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.infobox-item {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
}

.infobox-label { font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.infobox-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* Counter positions */
.counter-positions { display: flex; flex-direction: column; gap: 12px; }

.counter-item {
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.counter-item-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

.counter-item p { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; margin: 0; text-wrap: pretty; }

/* Sources section */
.sources-section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.sources-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sources-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.source-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  cursor: pointer;
}

.source-row:last-child { border-bottom: none; }
.source-row:hover { background: var(--surface-2); }

.source-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.source-desc { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; font-style: italic; }

.source-bias-label {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.bias-far-left  { background: #c0392b18; color: #d87080; border: 1px solid #c0392b30; }
.bias-left      { background: #d8607018; color: #d87080; border: 1px solid #d8607030; }
.bias-cleft     { background: #c0809018; color: #c898a8; border: 1px solid #c0809030; }
.bias-center    { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border-2); }
.bias-cright    { background: #90a8d818; color: #90a8d8; border: 1px solid #90a8d830; }
.bias-right     { background: #7898d818; color: #7898d8; border: 1px solid #7898d830; }
.bias-far-right { background: #3858b018; color: #6878c0; border: 1px solid #3858b030; }

.source-link-icon { color: var(--text-3); transition: color 0.2s; }
.source-row:hover .source-link-icon { color: var(--green); }

/* Story source cards (article.js rendered) */
.story-sources-list { padding: 6px 0; }

.story-source-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.story-source-card:last-child { border-bottom: none; }
.story-source-card:hover { background: var(--surface-2); }

.story-source-meta { flex: 1; min-width: 0; }
.story-source-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.story-source-domain { font-size: 0.72rem; color: var(--text-3); }

.story-source-bias-label {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.story-source-arrow { font-size: 0.9rem; color: var(--text-3); }
.story-source-card:hover .story-source-arrow { color: var(--green); }

/* Sidebar sections on article page */
.article-sidebar-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.article-sidebar-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.image-tiles { padding: 12px; }
.image-tile img { width: 100%; border-radius: var(--r-sm); object-fit: cover; max-height: 200px; }

.bias-spectrum-detail { padding: 14px 18px; }

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

.auth-visual {
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-2) 0px,
    var(--surface-2) 1px,
    transparent 1px,
    transparent 24px
  );
  opacity: 0.4;
}

.auth-visual-accent {
  position: absolute;
  top: -80px; right: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 60%);
  pointer-events: none;
}

.auth-visual-bottom { position: relative; z-index: 1; }

.auth-visual-headline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

.auth-visual-headline em { color: var(--green); font-style: italic; }

.auth-visual-sub { font-size: 0.95rem; color: var(--text-2); line-height: 1.65; }

.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--bg);
}

@media (max-width: 480px) { .auth-form-side { padding: 32px 20px; } }

.auth-logo .nav-logo-stack {
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.auth-logo { margin-bottom: 52px; }

.auth-form-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  font-style: italic;
}

.auth-form-sub { font-size: 0.9rem; color: var(--text-2); margin-bottom: 28px; }

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

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input::placeholder { color: var(--text-3); }

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.form-select {
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
  cursor: pointer;
  width: 100%;
  appearance: none;
}

.form-select:focus { border-color: var(--green); }

.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--green);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 8px;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  height: 44px;
  padding: 0 20px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary:hover { color: var(--text); background: var(--surface-2); }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 0.75rem;
  color: var(--text-3);
}

.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-switch { text-align: center; margin-top: 24px; font-size: 0.875rem; color: var(--text-2); }
.auth-switch a { color: var(--green); }
.auth-switch a:hover { text-decoration: underline; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--text-2); }
.auth-footer a { color: var(--green); }

/* ============================================
   ALERTS
   ============================================ */

.alert {
  font-size: 0.875rem;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  display: none;
  border: 1px solid;
  line-height: 1.5;
}

.alert.visible { display: block; }

.alert-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: oklch(0.68 0.11 155 / 0.3);
}

.alert-error {
  background: rgba(217, 83, 106, 0.12);
  color: var(--red);
  border-color: rgba(217, 83, 106, 0.3);
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--pad) 60px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
}

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
}

.profile-sidebar { display: flex; flex-direction: column; gap: 14px; }

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.profile-email { font-size: 0.8rem; color: var(--text-3); }

.profile-nav { display: flex; flex-direction: column; gap: 2px; }

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.profile-nav-item:hover { background: var(--surface-2); color: var(--text); }
.profile-nav-item.active { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.profile-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.profile-main { display: flex; flex-direction: column; gap: 20px; }

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.profile-section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.profile-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.profile-section-body { padding: 4px 20px 20px; }

/* Setting rows */
.pref-row, .setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.pref-row:last-child, .setting-row:last-child { border-bottom: none; }

.pref-label, .setting-label { font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.pref-sub { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

/* Toggle — checkbox version */
.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border-2);
}

.toggle input:checked + .toggle-track { background: var(--green); border-color: var(--green); }

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
}

.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* Toggle — button version (profile.js uses .active class on a button) */
.theme-toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
  background: var(--surface-3);
  border-radius: 11px;
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
}

.theme-toggle.active { background: var(--green); border-color: var(--green); }
.theme-toggle.active::after { transform: translateX(18px); }

/* Interests checkboxes */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item { display: none; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.checkbox-label:hover { color: var(--text-2); background: var(--surface-3); }
.checkbox-item:checked + .checkbox-label { color: var(--green); border-color: var(--green); background: var(--green-dim); }

/* Language selector */
.lang-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-3);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.lang-btn:hover { color: var(--text-2); background: var(--surface-3); }
.lang-btn.active { color: var(--green); border-color: var(--green); background: var(--green-dim); }

/* Source picker */
.source-picker-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.source-search-input {
  flex: 1;
  min-width: 150px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.source-search-input::placeholder { color: var(--text-3); }
.source-search-input:focus { border-color: var(--green); }

.source-filter-select {
  height: 36px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.source-picker-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

.source-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.875rem;
}

.source-picker-item:last-child { border-bottom: none; }
.source-picker-item:hover { background: var(--surface-2); }
.source-picker-item.selected { background: var(--green-dim); }

.source-picker-checkbox { width: 14px; height: 14px; accent-color: var(--green); flex-shrink: 0; }
.source-picker-name { font-weight: 600; color: var(--text); flex: 1; }
.source-picker-domain { color: var(--text-3); font-size: 0.75rem; }
.source-picker-country { color: var(--text-3); font-size: 0.72rem; }
.source-picker-bias {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border-2);
  white-space: nowrap;
}

.source-selected-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.source-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  background: var(--green-dim);
  border: 1px solid oklch(0.68 0.11 155 / 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--green);
}

.source-chip-remove { background: none; border: none; color: var(--green); cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0; opacity: 0.7; }
.source-chip-remove:hover { opacity: 1; }
.source-no-results { font-size: 0.85rem; color: var(--text-3); padding: 16px; text-align: center; }

/* Version */
.version-header { display: flex; align-items: center; gap: 10px; }

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid oklch(0.68 0.11 155 / 0.3);
  padding: 2px 10px;
  border-radius: 10px;
}

.version-date { font-size: 0.8rem; color: var(--text-3); }

/* Saved story rows */
.saved-story-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.saved-story-row:last-child { border-bottom: none; }
.saved-story-row:hover .saved-story-title { color: var(--green); }

.saved-story-title { font-weight: 500; font-size: 0.9rem; line-height: 1.45; color: var(--text-2); transition: color 0.2s; }
.saved-story-meta { font-size: 0.7rem; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.save-remove-btn { color: var(--text-3); transition: color 0.2s; flex-shrink: 0; padding: 2px; background: none; border: none; cursor: pointer; }
.save-remove-btn:hover { color: var(--red); }

/* ============================================
   UTILITY
   ============================================ */

.hidden { display: none !important; }
.text-accent { color: var(--green); }
.text-muted { color: var(--text-3); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.new-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  background: var(--amber);
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* ============================================
   HERO CARD (new feed design)
   ============================================ */

.hero-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 6px;
}

.hero-card:hover { background: var(--surface-2); border-color: var(--border-2); box-shadow: var(--shadow-md); }

.hero-card-inner {
  display: grid;
  grid-template-columns: 1fr 200px;
  min-height: 210px;
}

.hero-content {
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.hero-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card:hover .hero-title { color: var(--green); transition: color 0.2s; }

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-image-placeholder {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-align: center;
  min-height: 160px;
}

/* ============================================
   STORY CARDS GRID (new feed design)
   ============================================ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.story-card:hover { background: var(--surface-2); border-color: var(--border-2); box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.story-card .card-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card:hover .card-title { color: var(--green); transition: color 0.2s; }

.card-ai-badge {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border: 1px solid oklch(0.68 0.11 155 / 0.3);
  border-radius: var(--r-xs);
  color: var(--green);
}

.story-card .card-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.card-meta-dot {
  width: 3px; height: 3px;
  background: var(--text-3);
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================
   ARTICLE HEADER EXTRAS
   ============================================ */

.article-subline {
  font-size: 1.02rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 18px;
  text-wrap: pretty;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.article-meta-item strong { color: var(--text-2); font-weight: 600; }
.article-meta-item svg { opacity: 0.55; flex-shrink: 0; }

/* Full bias spectrum bar (article sources section) */
.bias-spectrum-full {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}

.bias-spectrum-full .bias-bar { height: 6px; }

.bias-spectrum-full .bias-bar-labels {
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.58rem;
}

/* AI language toggle inside ai-section */
.lang-selector-ai {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 3px;
}

.lang-selector-ai .lang-btn {
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 0.68rem;
}

/* English badge-topic aliases */
.badge-topic.politics   { color: #b49af0; border-color: #b49af040; background: #b49af012; }
.badge-topic.economy    { color: var(--amber); border-color: oklch(0.76 0.14 68 / 0.3); background: var(--amber-dim); }
.badge-topic.tech       { color: var(--green); border-color: oklch(0.68 0.11 155 / 0.3); background: var(--green-dim); }
.badge-topic.science    { color: #5dcfa8; border-color: #5dcfa840; background: #5dcfa810; }
.badge-topic.sports     { color: #f08050; border-color: #f0805040; background: #f0805012; }

/* ============================================
   SAVE BUTTON
   ============================================ */

.save-story-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  margin-top: 4px;
}
.save-story-btn:hover { color: var(--amber); border-color: var(--amber); background: var(--amber-dim, oklch(0.32 0.07 80 / 0.25)); }
.save-story-btn.saved { color: var(--amber); border-color: var(--amber); background: var(--amber-dim, oklch(0.32 0.07 80 / 0.25)); }

/* ============================================
   IMAGE SLIDESHOW
   ============================================ */

.article-images-section {
  margin-bottom: 6px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.slideshow {
  position: relative;
  background: var(--surface-2);
  max-height: 420px;
  overflow: hidden;
}

.slideshow-track { display: flex; }

.slideshow-slide {
  flex: 0 0 100%;
  display: none;
}
.slideshow-slide.active { display: block; }

.slideshow-slide img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.slideshow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: oklch(0.1 0 0 / 0.55);
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: var(--r-sm);
  color: #fff;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 2;
}
.slideshow-btn:hover { background: oklch(0.1 0 0 / 0.8); }
.slideshow-prev { left: 10px; }
.slideshow-next { right: 10px; }

.slideshow-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}

.slideshow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.35);
  border: none;
  cursor: pointer;
  transition: background 0.18s;
  padding: 0;
}
.slideshow-dot.active { background: #fff; }

/* ============================================
   FEED CARD IMAGES
   ============================================ */

.hero-image {
  overflow: hidden;
  border-left: 1px solid var(--border);
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.hero-card:hover .hero-image img { transform: scale(1.03); }

.card-image {
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  overflow: hidden;
  margin: -18px -18px 0;
  height: 140px;
  flex-shrink: 0;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.story-card:hover .card-image img { transform: scale(1.03); }

.card-image-empty {
  background: var(--surface-2);
  background-image: radial-gradient(circle at 30% 40%, oklch(0.28 0.04 var(--empty-hue, 250) / 0.5) 0%, transparent 60%),
                    radial-gradient(circle at 70% 65%, oklch(0.22 0.03 var(--empty-hue, 250) / 0.3) 0%, transparent 50%);
}
.card-image-empty[data-topic="politics"]  { --empty-hue: 270; }
.card-image-empty[data-topic="tech"]      { --empty-hue: 200; }
.card-image-empty[data-topic="economy"]   { --empty-hue: 80;  }
.card-image-empty[data-topic="sports"]    { --empty-hue: 30;  }
.card-image-empty[data-topic="science"]   { --empty-hue: 155; }

/* ============================================
   SAVED STORIES LIST (profile)
   ============================================ */

.saved-story-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s;
}
.saved-story-row:last-child { border-bottom: none; }
.saved-story-row:hover { color: var(--green); }
.saved-story-row svg { flex-shrink: 0; color: var(--text-3); }

.saved-story-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  background: var(--surface-2);
}

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

.saved-story-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 5px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.saved-story-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

/* ── Tablet (≤ 1023px) ───────────────────── */
@media (max-width: 1023px) {
  .feed-grid { grid-template-columns: repeat(2, 1fr); }
  .feed-section--featured { grid-template-columns: 1.3fr 1fr; }
  .article-card--split .card-image { width: 38%; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card-inner { grid-template-columns: 1fr 160px; }
}

/* ── Mobile (≤ 640px) ────────────────────── */
@media (max-width: 640px) {
  :root { --pad: 14px; }

  /* --- NAV -------------------------------- */
  .nav { gap: 10px; height: 52px; }
  .nav-logo-stack { font-size: 12px; }
  .nav-btn { padding: 0 8px; height: 36px; }
  .lang-label { display: none; }          /* globe icon only — saves space */
  .nav-btn-icon { width: 36px; height: 36px; }
  .nav-avatar { width: 34px; height: 34px; }
  .nav-divider { display: none; }         /* cleaner without dividers on small screens */

  /* --- FILTER BAR ------------------------- */
  .filter-bar { padding: 0 var(--pad); height: 46px; gap: 6px; }
  .filter-chip { height: 28px; padding: 0 12px; font-size: 0.76rem; }
  .refresh-btn { height: 28px; padding: 0 10px; font-size: 0.72rem; }

  /* --- FEED LAYOUT ------------------------ */
  .feed-layout { gap: 0; }
  .feed-greeting { margin-bottom: 12px; }
  .feed-greeting-title { font-size: 1.2rem; }
  .feed-greeting-sub { font-size: 0.82rem; }

  /* --- HERO CARD -------------------------- */
  .hero-card-inner { grid-template-columns: 1fr; }
  .hero-image, .hero-image-placeholder { display: none; }  /* full-width text on mobile */
  .hero-content { padding: 18px 16px; }
  .hero-title { font-size: clamp(1.05rem, 4.5vw, 1.4rem); }
  .hero-meta { gap: 8px; }

  /* --- CARDS GRID ------------------------- */
  .feed-section--compact { grid-template-columns: 1fr; }
  .feed-grid { grid-template-columns: 1fr; }
  .article-card--split { flex-direction: column; }
  .article-card--split .card-image { width: 100%; aspect-ratio: 16/9; }
  .article-card--hero { min-height: 260px; }
  .cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .card-image { height: 170px; }          /* taller on single-column */
  .story-card { padding: 14px; }

  /* --- ARTICLE PAGE ----------------------- */
  .article-layout { padding: 16px var(--pad) 48px; }
  .article-back { margin-bottom: 10px; font-size: 0.8rem; }
  .article-title { font-size: clamp(1.2rem, 5.5vw, 1.8rem); }
  .article-meta-bar { gap: 12px; padding: 10px 0; }
  .article-meta-item { font-size: 0.65rem; }

  /* AI section — compact header on mobile */
  .ai-section { margin-top: 20px; }
  .ai-section-header { padding: 12px 14px 0; }
  .ai-section-label { font-size: 0.65rem; margin-bottom: 10px; }
  .lang-selector-ai { gap: 3px; }
  .lang-btn { padding: 4px 10px; font-size: 0.7rem; }

  /* AI tabs — horizontal scroll, tighter */
  .ai-tabs, .tabs { padding-bottom: 0; gap: 0; }
  .tab-btn, .ai-tab { padding: 9px 13px; font-size: 0.74rem; gap: 4px; }
  .ai-tab-num { display: none; }         /* hide 01/02/03 numbers — save space */

  .ai-content { padding: 18px 14px; }

  /* Slideshow — shorter on mobile */
  .slideshow { max-height: 220px; }
  .slideshow-slide img { max-height: 220px; }
  .slideshow-btn { width: 36px; height: 36px; }

  /* Save button — bigger touch target */
  .save-story-btn { width: 40px; height: 40px; }

  /* Sources section */
  .sources-header { flex-wrap: wrap; gap: 4px; }
  .source-row { padding: 10px 0; gap: 8px; flex-wrap: wrap; }
  .source-name { font-size: 0.82rem; }
  .source-desc { font-size: 0.7rem; }

  /* Bias spectrum — compress labels */
  .bias-bar-labels { font-size: 0.5rem; letter-spacing: 0; }
  .bias-spectrum-full { padding: 10px 14px; }

  /* --- PROFILE PAGE ----------------------- */
  .profile-layout { padding: 16px var(--pad) 40px; gap: 14px; }

  /* Sidebar: horizontal scrollable nav tabs instead of vertical sidebar */
  .profile-card {
    flex-direction: row;
    padding: 14px 16px;
    gap: 14px;
    text-align: left;
    align-items: center;
  }
  .profile-avatar { width: 48px; height: 48px; font-size: 1.2rem; flex-shrink: 0; }

  .profile-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 8px;
  }
  .profile-nav::-webkit-scrollbar { display: none; }

  .profile-nav-item {
    flex-direction: column;
    flex-shrink: 0;
    gap: 3px;
    padding: 8px 12px;
    font-size: 0.65rem;
    text-align: center;
    white-space: nowrap;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
  }
  .profile-nav-item svg { width: 16px; height: 16px; }
  .profile-nav-item.active { border-color: var(--border-2); }

  /* Inputs & selects */
  .form-input, .form-select { font-size: 16px; } /* prevents iOS zoom on focus */
  .source-search-input { font-size: 16px; }
  .source-filter-select { font-size: 16px; }

  /* Source picker — tighter on mobile */
  .source-picker-filters { flex-direction: column; gap: 8px; }
  .source-picker-item { padding: 10px 12px; }

  /* Saved stories */
  .saved-story-thumb { width: 52px; height: 52px; }
  .saved-story-title { font-size: 0.86rem; }

  /* Version badge */
  .version-header { flex-direction: column; gap: 6px; }

  /* Pref rows */
  .pref-row { gap: 12px; }

  /* --- AUTH PAGES ------------------------- */
  .auth-form-side { padding: 28px var(--pad); }
  .auth-logo { margin-bottom: 32px; }
  .auth-logo .nav-logo-stack { font-size: 36px; }
  .auth-form-title { font-size: 1.6rem; }

  /* --- LOAD MORE -------------------------- */
  .btn-load-more { width: 100%; }
}
