/* SciThek Homepage Relaunch – Sidebar + 2×2 Ticker Grid */

/* ── Home Layout: Sidebar + Grid ── */
.home-layout {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1rem;
  gap: 1rem;
  height: calc(100vh - 70px);
  min-height: 600px;
}

/* ── Topic Sidebar ── */
.topic-sidebar {
  width: 180px;
  max-width: 180px;
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: 180px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 8px);
  background: var(--color-surface);
  overflow: hidden;
  contain: inline-size;
}
.topic-sidebar-header {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.topic-sidebar-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}
/* ── Sidebar Stats ── */
.sidebar-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.stat-item { font-weight: 600; }
.stat-sep { opacity: 0.4; }

.topic-nav {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  padding: 0.3rem 0;
}
.topic-nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
  border-left: 3px solid transparent;
}
.topic-nav-item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.topic-nav-item.active {
  background: var(--color-bg);
  color: var(--color-accent);
  font-weight: 600;
}
.topic-nav-item.has-selected {
  color: var(--color-accent);
}
.feeds-topic-dot {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.55rem;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  margin-left: 0.3rem;
  font-weight: 700;
  border-left-color: var(--color-accent);
}
.topic-nav-item .topic-count {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

/* L2 subtopics inline below active L1 */
.topic-l2-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem 0.3rem 1.2rem;
}
.topic-l2-inline .filter-pill {
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
}

/* Subtopic list inside sidebar */
.subtopic-list {
  border-top: 1px solid var(--color-border);
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.subtopic-list .filter-pill {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
}

/* ── 2×2 Grid ── */
.ticker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  transition: grid-template-columns 0.35s ease, grid-template-rows 0.35s ease, gap 0.35s ease;
}
/* Expand states: active Q gets full space, others collapse to 0 */
.ticker-grid[class*="expand-"] { gap: 0; }
.ticker-grid.expand-q1 { grid-template-columns: minmax(0, 1fr) 0px; grid-template-rows: minmax(0, 1fr) 0px; }
.ticker-grid.expand-q2 { grid-template-columns: 0px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 0px; }
.ticker-grid.expand-q3 { grid-template-columns: minmax(0, 1fr) 0px; grid-template-rows: 0px minmax(0, 1fr); }
.ticker-grid.expand-q4 { grid-template-columns: 0px minmax(0, 1fr); grid-template-rows: 0px minmax(0, 1fr); }

/* ── Quadrant ── */
.ticker-quadrant {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 8px);
  background: var(--color-surface);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  transition: opacity 0.3s ease;
}
/* Collapsed quadrants: hide border + content when at 0fr */
.ticker-grid[class*="expand-"] .ticker-quadrant:not(.expanded) {
  border-color: transparent;
  opacity: 0;
}

/* ── Expand Button ── */
.quadrant-expand-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.quadrant-expand-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
#tickerLive .quadrant-expand-btn,
#tickerNews .quadrant-expand-btn {
  border-color: #333;
  color: #94a3b8;
}
#tickerLive .quadrant-expand-btn:hover,
#tickerNews .quadrant-expand-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ── Quadrant Header ── */
.ticker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}
.ticker-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Feed Dropdown in Q headers ── */
.q-feed-select {
  font-size: 0.8rem;
  font-weight: 700;
  background: #1e1e2e;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 3px 8px;
  cursor: pointer;
  max-width: 160px;
  text-overflow: ellipsis;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}
.q-feed-select:hover, .q-feed-select:focus {
  border-color: var(--color-accent);
  background: #252538;
}
.q-feed-select option {
  background: #1e1e2e;
  color: #e2e8f0;
  padding: 4px 8px;
}

/* Live dot */
.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.ticker-dot.live-dot {
  background: #e53e3e;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.6); }
  50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(229, 62, 62, 0); }
}

/* ── Badge Filter Button (3-state: mixed/green/gray) ── */
.badge-filter-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.badge-filter-btn[data-state="mixed"] {
  background: linear-gradient(135deg, #22c55e 50%, #94a3b8 50%);
}
.badge-filter-btn[data-state="green"] {
  background: #22c55e;
}
.badge-filter-btn[data-state="gray"] {
  background: #94a3b8;
}

/* ── Apex Slider (in header) ── */
.ticker-header .apex-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ticker-header .apex-slider {
  width: 80px;
  cursor: pointer;
  accent-color: var(--color-accent);
}
.ticker-header .apex-slider-val {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  min-width: 28px;
}

/* ── Ticker Sort Filter ── */
.ticker-sort-filter {
  display: flex;
  gap: 0.25rem;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.ticker-sort-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.ticker-sort-pill.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.ticker-sort-pill:hover:not(.active) {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ── News Source Filter ── */
.news-source-filter {
  display: flex;
  gap: 0.3rem;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.news-source-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.news-source-pill.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.onair-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  vertical-align: 0px;
  margin-right: 1px;
  animation: onair-pulse 1.5s ease-in-out infinite;
}
@keyframes onair-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.news-source-pill .yt-icon {
  width: 14px;
  height: 10px;
  vertical-align: -1px;
  margin-right: 1px;
}
.news-source-pill .pill-icon {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 1px;
}
.news-source-pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


/* ── Ticker Track (vertical scroll) ── */
.ticker-track {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.75rem;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}
.ticker-track::-webkit-scrollbar {
  width: 4px;
}
.ticker-track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.ticker-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ── Ticker Card (thumb left, text right) ── */
.ticker-card {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.ticker-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

/* Thumbnail side – 16:9 aspect ratio */
.ticker-card-thumb {
  position: relative;
  width: 40%;
  flex-shrink: 0;
  background: #111;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.ticker-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ticker-card-thumb .duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}
.ticker-card-thumb .ticker-card-time {
  position: absolute;
  top: 4px;
  left: 6px;
  background: rgba(15,23,42,0.85);
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

/* Text side */
.ticker-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4rem 0.5rem 0.4rem 0;
  gap: 0.2rem;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.ticker-card-topic {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-card-title {
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
}
/* Marquee animation for overflowing titles */
.ticker-card-title.marquee > span {
  display: inline-block;
  animation: ticker-card-scroll var(--marquee-duration, 10s) linear infinite;
  padding-right: 3rem;
}
@keyframes ticker-card-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.ticker-card-channel {
  font-size: 0.68rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-card-meta {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
.ticker-card-meta .topic-pill {
  font-size: 0.6rem;
  padding: 0 0.35rem;
}
.ticker-card-meta .quality-badge,
.ticker-card-meta .quality-badge-news,
.ticker-card-meta .quality-badge-indexed,
.ticker-card-meta .quality-badge-neutral {
  font-size: 0.6rem;
  padding: 0 0.3rem;
}

/* ── Q2 board/paper rows: 3-col grid, topic as heading ── */
.fb-row-q2 {
  grid-template-columns: 3.5rem 1fr auto;
  min-height: 2.8rem;
  padding: 0.5rem 0.6rem;
}
/* Papers can grow freely */
.fb-row-q2.fb-paper {
  min-height: auto;
}
.fb-topic-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Q2 (Arrivals) news rows ── */
.fb-news-thumb {
  width: 4.5rem;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  background: #111;
}
.fb-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Live Ticker Card ── */
.ticker-card-live {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  text-decoration: none;
  color: #fff;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}
.ticker-card-live:hover {
  border-color: #e53e3e;
  transform: translateY(-1px);
}
.ticker-card-live-thumb {
  width: 40%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.ticker-card-live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ticker-card-live-body {
  padding: 0.4rem 0.5rem 0.4rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.ticker-card-live-title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}
.ticker-card-live-title.marquee > span {
  display: inline-block;
  animation: ticker-card-scroll var(--marquee-duration, 10s) linear infinite;
  padding-right: 3rem;
}
.ticker-card-live-channel {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-card-live .live-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}
.ticker-card-live .country-flag {
  position: absolute;
  top: 4px;
  right: 4px;
}

/* ── Arrivals board rows mixed into News quadrant ── */
.ticker-arrivals-board {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
}
.ticker-arrivals-board .fb-row {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
}
.fb-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 4px;
  vertical-align: middle;
  animation: fb-live-pulse 1.2s ease-in-out infinite;
}
.fb-live-yt, .fb-yt-icon {
  margin-right: 4px;
  vertical-align: middle;
}
.fb-live-yt {
  animation: fb-live-pulse 1.2s ease-in-out infinite;
}
@keyframes fb-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ticker-arrivals-board .fb-table-header {
  font-size: 0.65rem;
}
.ticker-arrivals-board .fb-badge {
  font-size: 0.6rem;
  padding: 0 0.3rem;
}

/* ── Empty state ── */
.ticker-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-style: italic;
}

/* ── "More" link card ── */
.ticker-card-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  padding: 0 1rem;
  white-space: nowrap;
  transition: background 0.15s;
}
.ticker-card-more:hover {
  background: var(--color-bg);
}

/* ── Departures & Arrivals: dark background ── */
#tickerLive,
#tickerNews {
  background: #0a0a0a;
  border-color: #222;
  color: #e2e8f0;
}
#tickerLive .ticker-header,
#tickerNews .ticker-header {
  background: #111;
  border-color: #222;
  color: #e2e8f0;
}
#tickerLive .fb-row,
#tickerNews .fb-row {
  border-color: #1e293b;
}
#tickerNews .fb-print-src img {
  background: #fff;
  border-radius: 3px;
  padding: 1px;
}
#tickerLive .fb-topic-head,
#tickerNews .fb-topic-head {
  color: var(--color-accent);
}
#tickerLive .fb-channel,
#tickerNews .fb-channel,
#tickerLive .fb-title,
#tickerNews .fb-title {
  color: #cbd5e1;
}
#tickerLive .fb-time,
#tickerNews .fb-time {
  color: #94a3b8;
}
#tickerLive .fb-th,
#tickerNews .fb-th {
  color: #64748b;
}
#tickerLive .fb-empty,
#tickerNews .fb-empty,
#tickerLive .ticker-empty,
#tickerNews .ticker-empty {
  color: #64748b;
}
#tickerLive .ticker-board-wrap::-webkit-scrollbar-thumb,
#tickerNews .ticker-track::-webkit-scrollbar-thumb {
  background: #334155;
}

/* ── Flight Board in Quadrant ── */
.ticker-quadrant-board .ticker-header {
  gap: 0.5rem;
}
.fb-home-count {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.fb-home-filters {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.fb-home-filters .fb-country-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.fb-home-filters .fb-country-item {
  color: var(--color-text);
}
.fb-home-filters .fb-country-item:hover {
  background: var(--color-bg);
}
.fb-home-filters .fb-country-item input {
  accent-color: var(--color-accent);
}
.fb-home-filters .fb-country-cnt {
  color: var(--color-text-secondary);
}
.ticker-board-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
}
.ticker-board-wrap::-webkit-scrollbar {
  width: 4px;
}
.ticker-board-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
/* Compact board rows for homepage */
.ticker-board-wrap .fb-row {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
}
.ticker-board-wrap .fb-rows {
  overflow-y: visible;
  flex: none;
}
.ticker-board-wrap .fb-table-header {
  font-size: 0.65rem;
}
.ticker-board-wrap .fb-badge {
  font-size: 0.6rem;
  padding: 0 0.3rem;
}
.ticker-board-wrap .flight-board {
  display: flex;
  flex-direction: column;
}
.ticker-board-wrap .flight-board-col {
  width: 100%;
}
/* Only show departures, hide arrivals */
.ticker-board-wrap .flight-board-col:nth-child(2) {
  display: none;
}
.ticker-board-wrap .flight-board-header {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .home-layout {
    flex-direction: column;
    height: auto;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .topic-sidebar {
    width: 100%;
    flex-direction: column;
    max-height: none;
    overflow: hidden;
  }
  .topic-sidebar-header {
    display: none;
  }
  .topic-nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.3rem 0.5rem;
    gap: 0.2rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topic-nav::-webkit-scrollbar { display: none; }
  .topic-nav-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .topic-nav-item.active {
    border-bottom-color: var(--color-accent);
    border-left-color: transparent;
  }
  /* L2 subtopics: full-width row below L1, horizontally scrollable */
  .topic-l2-inline {
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.15rem;
  }
  .topic-l2-inline::-webkit-scrollbar { display: none; }
  .topic-l2-inline .filter-pill {
    flex-shrink: 0;
  }
  .subtopic-list {
    border-top: none;
    border-left: 1px solid var(--color-border);
    max-height: none;
    padding: 0.3rem 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* ── Paper Rows (flight-board style) ── */
.fb-paper {
  display: grid;
}
#tickerNews .fb-paper {
  min-height: auto;
}
.fb-paper-headline {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}
.fb-paper-headline .fb-source-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.fb-paper-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-source-icon {
  vertical-align: -2px;
  margin-right: 3px;
  border-radius: 2px;
  object-fit: contain;
}
.fb-oa-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  vertical-align: 1px;
}
.fb-oa-closed {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(148,163,184,0.15);
  color: #94a3b8;
  vertical-align: 1px;
}
.fb-badge.print {
  background: rgba(139,92,246,0.15);
  color: rgba(139,92,246,0.9);
}
.fb-badge.course {
  background: rgba(163,31,52,0.15);
  color: rgba(163,31,52,0.9);
}
.fb-badge.news {
  background: rgba(59,130,246,0.15);
  color: rgba(59,130,246,0.9);
}
/* ── Top 3 der Woche (inside Mixed Feed) ── */
.ticker-top3 {
  background: linear-gradient(135deg, rgba(251,191,36,0.10) 0%, rgba(245,158,11,0.04) 100%);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius, 8px);
  padding: 0.5rem 0.6rem 0.4rem;
  margin-bottom: 0.5rem;
}
.ticker-top3-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ticker-top3-title::before {
  content: '\1F3C6';
  font-size: 0.85rem;
}
.ticker-top3 .ticker-card {
  border-color: rgba(251,191,36,0.2);
}
.ticker-top3 .ticker-card:hover {
  border-color: rgba(251,191,36,0.45);
}




@media (max-width: 768px) {
  .home-layout {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .ticker-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .ticker-quadrant {
    min-height: 220px;
    max-height: 350px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .ticker-header {
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
  }
  .ticker-header h2 {
    font-size: 0.8rem;
  }
  .ticker-sort-filter {
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: none;
  }
  .ticker-sort-filter::-webkit-scrollbar { display: none; }
  .news-source-filter {
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: none;
  }
  .news-source-filter::-webkit-scrollbar { display: none; }
  .apex-slider-wrap {
    flex-shrink: 1;
    min-width: 0;
  }
  .ticker-header .apex-slider {
    width: 60px;
  }
  .fb-home-filters {
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: none;
  }
  .fb-home-filters::-webkit-scrollbar { display: none; }
}

/* ── User Auth ── */
.user-auth {
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
  min-height: 34px;
}
.user-auth:empty { display: none; }
.user-auth-login {
  background: #4285f4;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.user-auth-login:hover { opacity: 0.85; }
.user-auth-login:hover { opacity: 0.85; }
.user-auth-login svg { width: 16px; height: 16px; }
.user-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  background-size: cover;
  background-position: center;
  padding: 0;
}
.user-avatar-btn:hover { border-color: var(--color-accent, #4285f4); }
.user-menu {
  position: absolute;
  top: 42px;
  right: 0;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 1000;
  display: none;
}
.user-menu.open { display: block; }
.user-menu-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}
.user-menu-header .user-name { font-weight: 600; }
.user-menu-header .user-email { color: var(--color-muted); font-size: 0.75rem; }
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text);
}
.user-menu-item:hover { background: var(--color-hover, #f5f5f5); }
.user-menu-sep { border-top: 1px solid var(--color-border); margin: 0.25rem 0; }

/* ── Playlist Add Button on Cards ── */
.playlist-add-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.15s;
}
.playlist-add-btn:hover { background: #4285f4; }
.ticker-card:hover .playlist-add-btn { display: flex; }

/* ── Q3 Playlist Dropdown ── */
.q3-source-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  max-width: 160px;
}
.q3-source-select option { font-size: 0.85rem; }
