/* ═══════════════════════════════════════════════════════
    HYPENET CSS — MOBILE-FIRST FIXED v2
   ═══════════════════════════════════════════════════════ */

:root {
  --primary: #E8334A;
  --primary-dark: #C82840;
  --secondary: #5A5FE0;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-alt: #E2E8F0;
  --text: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.1);
  --shadow-xl: 0 8px 32px rgba(0,0,0,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-primary: 'Outfit', -apple-system, system-ui, sans-serif;
  --font-secondary: 'Inter', -apple-system, system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 36px;
  --bottom-nav-h: 72px; /* ✅ Увеличено с 60px */

  /* ✅ ИЕРАРХИЯ Z-INDEX */
  --z-header: 490;
  --z-topbar: 500;
  --z-bottom-nav: 900;
  --z-modal: 1000;
  --z-settings: 1001;
  --z-reco-sheet: 9000;
  --z-reco-banner: 9500;
  --z-cookie: 10000;
  --z-toast: 20000;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-hover: #334155;
  --bg-alt: #475569;
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: #334155;
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.4);
  --shadow-xl: 0 8px 32px rgba(0,0,0,.5);
}

/* ─── RESET ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: var(--font-size-base, 15px);
  transition: background var(--transition), color var(--transition);
  overscroll-behavior-y: contain;
  max-width: 100vw;
  overflow-x: hidden;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--primary); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px;
}

code {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  word-break: break-all;
}

/* PROGRESS BAR */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 9999;
  transition: width 0.3s ease;
  width: 0%;
}

/* TOP BAR */
.top-bar {
  background: #0F172A;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  width: 100%;
}

[data-theme="dark"] .top-bar { background: #020617; }

.top-bar-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-clock {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  color: rgba(255,255,255,.9);
}

.ticker-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

.live-badge {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.ticker-container {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.ticker-text {
  display: inline-block;
  font-size: 11px;
  color: rgba(255,255,255,.75);
  animation: ticker-scroll 60s linear infinite;
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tb-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HEADER */
.header {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  position: sticky;
  top: var(--topbar-h);
  z-index: var(--z-header);
  width: 100%;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-primary);
  font-weight: 900;
  font-size: 20px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-primary);
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

/* SEARCH */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 14px;
  transition: border-color var(--transition);
  min-width: 0;
}

.search-box:focus-within { border-color: var(--secondary); }

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
  padding: 8px 0;
}

.search-input::placeholder { color: var(--text-muted); }

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-secondary);
}

.voice-btn:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.search-btn {
  flex-shrink: 0;
  background: var(--secondary);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.search-btn:hover { background: var(--primary); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}

.search-dropdown.show,
.search-dropdown.active { display: block; }

.search-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover { background: var(--bg-hover); }

.search-suggestion-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.search-suggestion-content {
  flex: 1;
  min-width: 0;
}

.search-suggestion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.search-suggestion-source {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

mark.search-highlight {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

/* HEADER ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.header-btn:hover {
  background: var(--bg-hover);
  border-color: var(--secondary);
}

.header-btn span {
  font-weight: 700;
  color: var(--primary);
}

/* NAVIGATION */
.main-nav {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-top: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* FILTER BAR */
.filter-bar {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  height: 44px; /* ✅ Фиксированная высота вместо padding */
  overflow: hidden;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.filter-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full); /* ✅ Скруглённые пилюли */
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  height: 30px;
  transition: border-color var(--transition);
}

.filter-select:focus {
  border-color: var(--secondary);
}

.filter-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11px; /* ✅ Компактнее */
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  height: 28px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.filter-chip.active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.view-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-muted);
}

.view-btn.active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* LAYOUT */
.layout {
  max-width: 1600px;
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* SIDEBAR & WIDGETS */
.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.widget:last-child { margin-bottom: 0; }

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.widget-title {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.widget-time {
  font-size: 11px;
  color: var(--text-muted);
}

.widget-body { padding: 14px 18px; }

/* CURRENCY */
.currency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  transition: background var(--transition);
}

.currency-row:last-child { border-bottom: none; }

.currency-row:hover {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding-left: 6px;
  padding-right: 6px;
  margin: 0 -6px;
}

.currency-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap; /* ✅ Не переносим */
  font-size: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.currency-value {
  font-family: var(--font-secondary); /* ✅ Inter — нейтральнее */
  font-weight: 600; /* ✅ Между тонким и жирным */
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.currency-change {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.currency-change.up  { color: var(--success); }
.currency-change.down { color: var(--danger); }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* STATS */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-row strong {
  color: var(--text);
  font-family: var(--font-primary);
  font-size: 15px;
}

/* SOURCES */
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 8px;
}

.source-item:last-child { border-bottom: none; }
.source-item:hover { color: var(--primary); }

.source-count {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* TAGS */
#hotTopics,
#tagsCloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-tag {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.topic-tag:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
}

/* POPULAR ITEMS */
.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.popular-item:last-child { border-bottom: none; }
.popular-item:hover .popular-title { color: var(--primary); }

.popular-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 11px;
}

.popular-item > div:not(.popular-num) {
  flex: 1;
  min-width: 0;
}

.popular-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* HERO */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.hero-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
  position: relative;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 30px 30px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff;
}

.hero-category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-primary);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  opacity: .85;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}

/* SECTION */
.section { margin-bottom: 30px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.section-header h2 {
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.grid-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* NEWS GRID */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* NEWS CARD */
.news-card {
  border-left: none;
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: card-fade-in 0.4s ease both;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cat-color, var(--primary));
  z-index: 1;
}

@keyframes card-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.news-card.read { opacity: 0.65; }

.news-card-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.news-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
  background: var(--bg-hover);
}

.news-card:hover .news-card-image {
  transform: scale(1.07);
}

.card-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #E8334A;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s infinite;
  z-index: 2;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.news-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.news-card-category {
  display: inline-block;
  align-self: flex-start;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.news-card-title {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.news-card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  flex-wrap: wrap;
}

.news-card-source {
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.card-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: var(--bg-hover);
}

.card-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* LIST/COMPACT VIEWS */
[data-view="list"] .news-grid {
  grid-template-columns: 1fr !important;
}

[data-view="list"] .news-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: auto;
  min-height: 140px;
}

[data-view="list"] .news-grid > .news-card:first-child,
[data-view="list"] .news-grid > .news-card:nth-child(7n+1) {
  grid-column: span 1 !important;
  grid-template-columns: 280px 1fr;
}

[data-view="list"] .news-card-image-wrap {
  height: 100%;
  min-height: 140px;
  max-height: 180px;
}

[data-view="list"] .news-card-image {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  object-fit: cover;
}

[data-view="compact"] .news-grid {
  grid-template-columns: 1fr !important;
  gap: 8px;
}

[data-view="compact"] .news-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  height: auto;
}

[data-view="compact"] .news-grid > .news-card:first-child,
[data-view="compact"] .news-grid > .news-card:nth-child(7n+1) {
  grid-column: span 1 !important;
  grid-template-columns: 100px 1fr;
}

[data-view="compact"] .news-card-image-wrap { height: 80px; }

[data-view="compact"] .news-card-image {
  height: 80px;
  aspect-ratio: unset;
}

[data-view="compact"] .news-card-body {
  padding: 10px 14px;
  gap: 4px;
}

[data-view="compact"] .news-card-description,
[data-view="compact"] .news-card-actions { display: none; }

[data-view="compact"] .news-card-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
}

/* LOAD MORE */
.load-more-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 24px auto 0;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.load-more-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

/* LOADING */
.loading-wrap {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* FOOTER */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-top {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 20px 30px;
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 30px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.footer-logo .logo-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.footer-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-socials { display: flex; gap: 8px; }

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.social-link:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.footer-col h4 {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.footer-col a:hover { color: var(--primary); }

.footer-subscribe { display: flex; gap: 6px; }

.subscribe-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  outline: none;
}

.subscribe-btn {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.subscribe-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.subscribe-note a { color: var(--secondary); }

.footer-sources {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.footer-sources-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.sources-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 6px;
}

.footer-bottom { background: var(--bg); }

.footer-bottom-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: var(--text-muted);
  font-size: 12px;
}

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show,
.modal.active { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.3s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
}

.modal-close:hover {
  background: var(--danger);
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: var(--z-toast);
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show,
.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* SCROLL TOP */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 800;
  opacity: 0;
  visibility: hidden;
}

.scroll-top.show,
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover { background: var(--primary); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 240px 1fr;
    gap: 20px;
  }
  .sidebar-right { display: none; }
  .footer-top { grid-template-columns: 1.5fr repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px auto;
  }
  .sidebar-left { order: 3; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 22px; }
  .hero-image { height: 320px; }
}

@media (max-width: 768px) {
  .top-bar { display: none; }
  .header { top: 0; }

  .header-inner {
    padding: 10px 12px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
  }

  .logo { grid-column: 1; grid-row: 1; gap: 8px; }
  .logo-icon { width: 36px; height: 36px; font-size: 18px; }
  .logo-name { font-size: 18px; }
  .logo-tagline { display: none; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .header-btn { padding: 6px 10px; font-size: 12px; }
  .search-box { grid-column: 1 / -1; grid-row: 2; padding: 4px 4px 4px 12px; }
  .search-input { font-size: 14px; padding: 6px 0; }
  .search-btn { padding: 6px 14px; font-size: 12px; }
  .voice-btn { width: 30px; height: 30px; font-size: 14px; }
  .main-nav { padding: 0 12px; }
  .nav-btn { padding: 10px 12px; font-size: 12px; }

  .filter-bar {
    padding: 6px 12px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow: hidden;
  }

  .filter-left {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    padding-bottom: 0;
  }

  .filter-left::-webkit-scrollbar { display: none; }
  .filter-right { flex-shrink: 0; display: flex; gap: 4px; align-items: center; }

  .filter-select {
    padding: 5px 8px;
    font-size: 11px;
    max-width: 120px;
    flex-shrink: 0;
  }

  .view-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .filter-chip {
    padding: 4px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .layout {
    padding: 0 12px;
    margin: 12px auto;
    /* ✅ Учитываем safe-area для нижней навигации */
    padding-bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  }

  .hero-actions { display: none; }
  .hero-image { height: 220px; }
  .hero-overlay { padding: 16px; }

  .hero-title {
    font-size: 16px;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
  }

  .hero-meta { margin-bottom: 0; font-size: 12px; }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .news-card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .card-btn {
    flex: 1;
    min-width: 0;
    width: auto;
    font-size: 11px;
    padding: 7px 6px;
  }

  [data-view="list"] .news-card,
  [data-view="compact"] .news-card { grid-template-columns: 1fr; }

  [data-view="compact"] .news-card-image-wrap { height: 140px; }
  [data-view="compact"] .news-card-image { height: 140px; aspect-ratio: unset; }

  .section-header h2 { font-size: 16px; }

  .footer-top {
    grid-template-columns: 1fr;
    padding: 24px 14px;
    gap: 20px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    padding: 12px 14px;
  }

  .footer-legal { justify-content: center; }
  /* ✅ Учитываем safe-area для футера */
  .footer { padding-bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }

  .modal-box { max-height: 90vh; border-radius: var(--radius); }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }

  .scroll-top {
    display: none !important;
  }

  .toast { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 380px) {
  .header-btn { padding: 6px 8px; font-size: 11px; }
  .nav-btn { padding: 8px 10px; font-size: 11px; }
  .news-card-title { font-size: 15px; }
  .layout { padding: 0 10px; }
}

@media (hover: none) {
  .bn-item:hover {
    background: none;
    color: var(--text-muted);
  }
  .bn-item.active {
    color: var(--primary);
    background: none;
  }
}

/* ═══════════════════════════════════════════════════════
   ✅ COOKIE BANNER
   ═══════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  bottom: -300px;
  left: 0;
  right: 0;
  z-index: var(--z-cookie);
  background: var(--bg-card);
  border-top: 3px solid var(--accent);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 16px 24px;
}

.cookie-banner.show { bottom: 0; }

.cookie-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.cookie-text span {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}

.cookie-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.cookie-btn-accept:hover { opacity: 0.85; }

.cookie-btn-decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn-decline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ✅ Cookie на мобильном — компактный, с safe-area */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 12px 14px;
    /* Учитываем safe-area внизу (iPhone notch и пр.) */
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cookie-text {
    gap: 10px;
    align-items: flex-start;
  }

  .cookie-text span {
    font-size: 1.4rem;
  }

  .cookie-text p {
    font-size: 12px;
    line-height: 1.4;
  }

  .cookie-actions {
    width: 100%;
    gap: 8px;
  }

  .cookie-btn-accept,
  .cookie-btn-decline {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
  }
}

/* ✅ Когда показан cookie — прячем все остальные баннеры */
body:has(.cookie-banner.show) .reco-banner,
body:has(.cookie-banner.show) .reco-sheet {
  display: none !important;
}

/* ═══ POLICY CONTENT ═══ */
.policy-content h2 {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.policy-content h2:first-child { margin-top: 0; }

.policy-content h3 {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 6px;
}

.policy-content p {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.policy-content ul {
  padding-left: 18px;
  margin-bottom: 10px;
}

.policy-content li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.policy-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 12px;
}

.policy-content th {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--border);
}

.policy-content td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.policy-content tr:nth-child(even) td { background: var(--bg); }
.policy-content a { color: var(--secondary); text-decoration: underline; }

.policy-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.policy-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   READING MODAL
   ═══════════════════════════════════════════════════════ */

.reading-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.reading-modal.show {
  opacity: 1;
  pointer-events: all;
}

.reading-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.reading-modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 700px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  z-index: 1;
  margin: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.reading-modal.show .reading-modal__content {
  transform: scale(1) translateY(0);
}

.reading-modal__content::-webkit-scrollbar { width: 4px; }
.reading-modal__content::-webkit-scrollbar-track { background: transparent; }
.reading-modal__content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.reading-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.reading-modal__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reading-modal__source {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
}

.reading-modal__category-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reading-modal__close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.reading-modal__close:hover {
  background: var(--danger);
  color: #fff;
  transform: rotate(90deg);
}

.reading-modal__image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.reading-modal__body { padding: 24px; }

.reading-modal__title {
  font-family: var(--font-primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 14px;
}

.reading-modal__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.reading-modal__divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.reading-modal__desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.reading-modal__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 4px;
  align-items: stretch;
  padding: 0 4px 8px 4px;
}

.reading-modal__link-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--transition);
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-modal__link-btn:hover {
  opacity: 0.85;
  color: #fff;
}

.reading-modal__fav-btn,
.reading-modal__share-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.reading-modal__fav-btn:hover,
.reading-modal__share-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: var(--bg-hover);
}

.reading-modal__fav-btn.active {
  background: #FFF8E1;
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .reading-modal__fav-btn.active {
  background: rgba(245, 158, 11, 0.15);
}

.reading-modal__fulltext { margin: 8px 0; }

.reading-modal__text-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 15px;
}

.reading-modal__text-content p:last-child { margin-bottom: 0; }

.reading-modal__text-note {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

@media (max-width: 768px) {
  .reading-modal {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }

  .reading-modal__content {
    max-width: 100%;
    width: 100%;
    height: calc(100dvh - 48px);
    max-height: calc(100dvh - 48px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .reading-modal.show .reading-modal__content {
    transform: translateY(0);
  }

  .reading-modal__header { flex-shrink: 0; }
  .reading-modal__image { height: 200px; flex-shrink: 0; }

  .reading-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .reading-modal__title { font-size: 18px; }

  .reading-modal__actions {
    flex-shrink: 0;
    flex-direction: column;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    gap: 8px;
    margin-top: 0;
  }

  .reading-modal__link-btn,
  .reading-modal__fav-btn,
  .reading-modal__share-btn {
    width: 100%;
    flex: unset;
    padding: 14px 16px;
  }

  .reading-modal__body > .reading-modal__divider:last-child {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════════════ */

@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton-wrapper { animation: card-fade-in 0.3s ease both; }

.skeleton-wrapper.skeleton-fade-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.skeleton-card {
  pointer-events: none;
  cursor: default !important;
}

.skeleton-card:hover {
  transform: none !important;
  box-shadow: var(--shadow) !important;
}

.skeleton-image,
.skeleton-badge,
.skeleton-line,
.skeleton-btn {
  background: linear-gradient(
    90deg,
    var(--bg-hover) 25%,
    var(--bg-alt)   50%,
    var(--bg-hover) 75%
  );
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .skeleton-image,
[data-theme="dark"] .skeleton-badge,
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .skeleton-btn {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
}

.skeleton-image { width: 100%; height: 200px; border-radius: 0; }
.skeleton-badge { width: 80px; height: 20px; border-radius: var(--radius-full); }
.skeleton-line  { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-line--title       { height: 18px; width: 100%; }
.skeleton-line--title.short { width: 70%; }
.skeleton-line--text        { height: 13px; width: 100%; }
.skeleton-line--text.short  { width: 55%; }
.skeleton-line--meta        { height: 11px; width: 80px; }

.skeleton-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.skeleton-actions { display: flex; gap: 6px; margin-top: 8px; }
.skeleton-btn { flex: 1; height: 34px; border-radius: var(--radius-sm); }

[data-view="list"] .skeleton-image    { height: 100%; min-height: 160px; }
[data-view="compact"] .skeleton-image { height: 80px; }
[data-view="compact"] .skeleton-actions { display: none; }

/* ═══════════════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════════════ */

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-settings);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.settings-panel.open { right: 0; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

.settings-header h3 {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.settings-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.settings-close:hover {
  background: var(--danger);
  color: #fff;
  transform: rotate(90deg);
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.settings-body::-webkit-scrollbar { width: 4px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.settings-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child { border-bottom: none; margin-bottom: 0; }

.settings-section-title {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
}

.settings-row:last-child { margin-bottom: 0; }

.settings-lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.lang-btn {
  padding: 10px 14px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
}

.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.settings-theme-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }

.theme-btn {
  padding: 10px 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
}

.theme-btn:hover  { border-color: var(--primary); color: var(--primary); }
.theme-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.settings-colors { display: flex; flex-wrap: wrap; gap: 10px; }

.accent-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.accent-btn:hover { transform: scale(1.15); }
.accent-btn.active { border-color: var(--text); transform: scale(1.1); }

.accent-btn.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.settings-font-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.font-btn {
  padding: 10px 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
}

.font-btn:hover  { border-color: var(--primary); color: var(--primary); }
.font-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.settings-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  min-width: 100px;
}

.settings-select:focus { border-color: var(--primary); }

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.settings-toggle input { opacity: 0; width: 0; height: 0; }

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-alt);
  border-radius: 26px;
  cursor: pointer;
  transition: all 0.3s;
}

.settings-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 4px;
  bottom: 4px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.settings-toggle input:checked + .settings-toggle-slider { background: var(--primary); }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(20px); }

.settings-reset-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition);
}

.settings-reset-btn:hover { background: var(--danger); color: #fff; }

@media (max-width: 768px) {
  .settings-panel {
    width: 100%;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    top: auto;
    bottom: -100%;
    height: 90vh;
    transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                visibility 0.35s;
    z-index: var(--z-settings);
    visibility: hidden;
  }

  .settings-panel.open {
    bottom: 0;
    visibility: visible;
  }
}

/* ═══════════════════════════════════════════════════════
   FONT SIZE SCALING
   ═══════════════════════════════════════════════════════ */

[data-font-size="small"] { --font-size-base: 13px; }
[data-font-size="small"] .news-card-title       { font-size: 14px; }
[data-font-size="small"] .news-card-description { font-size: 12px; }
[data-font-size="small"] .news-card-meta        { font-size: 10px; }
[data-font-size="small"] .card-btn              { font-size: 10px; }
[data-font-size="small"] .widget-title          { font-size: 13px; }
[data-font-size="small"] .popular-title         { font-size: 11px; }
[data-font-size="small"] .hero-title            { font-size: 24px; }
[data-font-size="small"] .section-header h2     { font-size: 17px; }
[data-font-size="small"] .nav-btn               { font-size: 12px; }
[data-font-size="small"] .currency-row          { font-size: 12px; }
[data-font-size="small"] .source-item           { font-size: 11px; }
[data-font-size="small"] .topic-tag             { font-size: 10.5px; }
[data-font-size="small"] .footer-desc           { font-size: 11px; }
[data-font-size="small"] .reading-modal__title  { font-size: 18px; }
[data-font-size="small"] .reading-modal__desc   { font-size: 13px; }

[data-font-size="large"] { --font-size-base: 17px; }
[data-font-size="large"] .news-card-title       { font-size: 19px; }
[data-font-size="large"] .news-card-description { font-size: 15px; }
[data-font-size="large"] .news-card-meta        { font-size: 12px; }
[data-font-size="large"] .card-btn              { font-size: 13px; }
[data-font-size="large"] .widget-title          { font-size: 16px; }
[data-font-size="large"] .popular-title         { font-size: 14px; }
[data-font-size="large"] .hero-title            { font-size: 34px; }
[data-font-size="large"] .section-header h2     { font-size: 23px; }
[data-font-size="large"] .nav-btn               { font-size: 15px; }
[data-font-size="large"] .currency-row          { font-size: 15px; }
[data-font-size="large"] .source-item           { font-size: 14px; }
[data-font-size="large"] .topic-tag             { font-size: 13.5px; }
[data-font-size="large"] .footer-desc           { font-size: 14px; }
[data-font-size="large"] .reading-modal__title  { font-size: 26px; }
[data-font-size="large"] .reading-modal__desc   { font-size: 17px; }

/* ═══════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════════════ */

.bottom-nav { display: none; }

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
    position: fixed;
    /* ✅ Учитываем safe-area iPhone */
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-bottom-nav);
    width: calc(100% - 32px);
    max-width: 420px;
  }

  .bottom-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-card);
    border-radius: 999px;
    padding: 8px 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    gap: 4px;
  }

  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-muted);
    -webkit-tap-highlight-color: transparent;
  }

  .bn-icon {
    width: 22px;
    height: 22px;
    transition: all 0.25s ease;
  }

  .bn-label {
    font-size: 10px;
    font-weight: 500;
    transition: all 0.25s ease;
  }

  .bn-item.active {
    background: var(--primary);
    box-shadow: 0 4px 16px rgba(232, 51, 74, 0.4);
    color: #fff;
    padding: 8px 16px;
  }

  .bn-item.active .bn-label { font-weight: 700; }

  .bn-item:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text);
  }
}

/* ═══════════════════════════════════════════════════════
   PULL-TO-REFRESH
   ═══════════════════════════════════════════════════════ */

.pull-indicator { display: none; }

@media (max-width: 768px) {
  .pull-indicator {
    display: flex;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    z-index: 9997;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 10px 20px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: none;
    pointer-events: none;
    min-width: 160px;
  }
}

.ptr-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.ptr-icon.spinning { animation: ptr-spin 0.8s linear infinite; }

@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.pull-indicator.ready .ptr-icon            { transform: rotate(180deg); }
.pull-indicator.ready.refreshing .ptr-icon { transform: none; }

.ptr-text {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ptr-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-primary);
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   RECOMMENDATIONS WIDGET
   ═══════════════════════════════════════════════════════ */

.widget-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.recommend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.recommend-item:last-child { border-bottom: none; }

.recommend-item:hover {
  background: var(--bg-hover);
  border-radius: 8px;
  padding-left: 4px;
}

.recommend-score {
  flex-shrink: 0;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(232, 51, 74, 0.35);
  align-self: flex-start;
}

.recommend-body { flex: 1; min-width: 0; }

.recommend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #8B5CF6;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  padding: 2px 8px;
  line-height: 1.4;
  vertical-align: middle;
}

[data-theme="dark"] .recommend-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .recommend-badge      { background: rgba(139, 92, 246, 0.15); }

/* ═══════════════════════════════════════════════════════
   LEGAL CONTENT
   ═══════════════════════════════════════════════════════ */

.legal-text h4 {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.legal-text h4:first-child { margin-top: 0; }
.legal-text p { margin-bottom: 12px; }

.settings-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
}

/* SEARCH CLEAR BUTTON */
.search-clear-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--bg-alt);
  border: none;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.search-clear-btn:hover {
  background: var(--danger);
  color: #fff;
  transform: scale(1.1);
}

/* ═══ SEARCH COUNTER ═══ */
.search-counter {
  display: none;
  text-align: center;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 20px;
  margin: 6px auto;
  width: fit-content;
  letter-spacing: 0.3px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.search-counter.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.search-counter.empty {
  background: var(--danger);
}

@media (max-width: 768px) {
  .search-counter {
    padding: 4px 12px;
    font-size: 0.75rem;
  }
}

.dropdown-counter {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
}

.editors-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
}

.editors-item:last-child { border-bottom: none; }
.editors-item:hover { opacity: 0.7; }

.editors-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
}

.editors-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.editors-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ═══════════════════════════════════════════════════════
   ✅ RECO BANNER — FIXED для мобильных
   ═══════════════════════════════════════════════════════ */

.reco-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  z-index: var(--z-reco-banner);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  transform: translateY(calc(100% + 60px));
  transition: transform 0.3s ease;
  will-change: transform;
}

.reco-banner.show { transform: translateY(0); }

.reco-banner__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  color: var(--text);
}

.reco-banner__title {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.reco-banner__text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reco-banner__text a {
  color: var(--primary);
  text-decoration: none;
}

.reco-banner__btn {
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  float: right;
  transition: opacity 0.2s;
}

.reco-banner__btn:hover { opacity: 0.85; }

@media (max-width: 768px) {
  .sidebar { display: none !important; }

  .bn-icon-circle {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(232, 51, 74, 0.3);
    border: 4px solid var(--bg-card);
  }

  .bn-item#bnWidgets .bn-label { margin-top: 18px; }

  .widgets-sheet {
    position: fixed;
    inset: 0;
    z-index: 20000;
    visibility: hidden;
    pointer-events: none;
  }

  .widgets-sheet.active {
    visibility: visible;
    pointer-events: auto;
  }

  .widgets-sheet__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .25s ease;
  }

  .widgets-sheet.active .widgets-sheet__overlay {
    opacity: 1;
  }

  .widgets-sheet__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 22px 22px 0 0;
    padding: 14px;
    max-height: 80vh;
    overflow: auto;
    transform: translateY(110%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
  }

  .widgets-sheet.active .widgets-sheet__content {
    transform: translateY(0);
  }

  .widgets-sheet__handle {
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    margin: 6px auto 14px;
  }
}

/* ═══ RECO BANNER SMALL ═══ */
@media (min-width: 769px) {
  .reco-banner--small {
    left: 20px;
    bottom: 20px;
    max-width: 320px;
    transform: translateY(calc(100% + 60px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .reco-banner--small.show {
    transform: translateY(0);
  }
}

/* ✅ FIXED — Reco-banner на мобильных */
@media (max-width: 768px) {
  .reco-banner--small {
    position: fixed;
    left: 16px;
    right: 16px;
    max-width: none;
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;

    /* ✅ Поднимаем баннер выше нижней навигации + safe-area iPhone */
    bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));

    transform: translateY(calc(100% + 80px));
    transition: transform 0.3s ease;
    will-change: transform;
  }

  .reco-banner--small.show {
    transform: translateY(0);
  }

  /* Компактнее текст */
  .reco-banner--small .reco-banner__title {
    font-size: 0.82rem;
    line-height: 1.3;
    margin-bottom: 2px;
  }

  .reco-banner--small .reco-banner__text {
    font-size: 0.72rem;
    line-height: 1.35;
  }
}

.reco-banner__more {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.reco-banner--small .reco-banner__btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}

@media (max-width: 768px) {
  .reco-banner--small .reco-banner__btn {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
}

/* ═══ RECO SHEET ═══ */
.reco-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-reco-sheet);
  visibility: hidden;
  pointer-events: none;
}

.reco-sheet.active {
  visibility: visible;
  pointer-events: auto;
}

.reco-sheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reco-sheet.active .reco-sheet__overlay {
  opacity: 1;
}

.reco-sheet__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  overflow: visible;
}

.reco-sheet.active .reco-sheet__content {
  transform: translateY(0);
}

.reco-sheet__handle {
  width: 44px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px auto 8px;
}

.reco-sheet__body {
  padding: 8px 20px 20px;
  overflow: visible;
}

.reco-sheet__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.reco-sheet__item:last-of-type {
  border-bottom: none;
}

.reco-sheet__icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 0;
  overflow: visible !important;
  position: relative;
}

.reco-sheet__icon svg {
  width: 22px;
  height: 22px;
  overflow: visible !important;
  position: relative;
  z-index: 1;
}

.reco-sheet__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.reco-sheet__text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.reco-sheet__text a {
  color: var(--secondary);
  text-decoration: underline;
}

.reco-sheet__btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.reco-sheet__btn:active {
  opacity: 0.7;
}

@media (min-width: 769px) {
  .reco-sheet__content {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -40%) scale(0.95);
    border-radius: 16px;
    width: 480px;
    max-width: 90vw;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .reco-sheet.active .reco-sheet__content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .reco-sheet__handle {
    display: none;
  }
}

@media (max-width: 768px) {
  .reco-sheet__content {
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }

  .reco-sheet.active .reco-sheet__content {
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .reco-banner--small,
  .reco-banner {
    bottom: calc(var(--bottom-nav-h) + 190px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════
   ✅ ФИНАЛЬНЫЙ ФИКС RECO-BANNER (стабильный на Android)
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Сбрасываем все предыдущие правила */
  .reco-banner,
  .reco-banner--small {
    position: fixed !important;
    
    /* ✅ Привязываемся к ВЕРХУ, а не к низу — стабильнее */
    top: auto !important;
    bottom: auto !important;
    
    /* Будем позиционировать через transform */
    left: 12px !important;
    right: 12px !important;
    
    /* Фиксируем позицию через top + translate */
    top: calc(100dvh - var(--bottom-nav-h) - 105px) !important;
    
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18) !important;
    
    z-index: var(--z-reco-banner) !important;
    
    /* Скрыт по умолчанию */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    
    /* ✅ Гарантируем клики */
    pointer-events: none;
  }

  /* Когда баннер показан */
  .reco-banner.show,
  .reco-banner--small.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  /* Кнопка ВНУТРИ — кликабельная всегда */
  .reco-banner__btn,
  .reco-banner--small .reco-banner__btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.3);
    cursor: pointer;
    /* Увеличиваем зону тапа */
    min-height: 36px;
    padding: 8px 16px !important;
  }

  /* Ссылки тоже кликабельны */
  .reco-banner a,
  .reco-banner--small a {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
    touch-action: manipulation;
  }
  
  /* ✅ ВАЖНО: убираем правило, которое прятало reco при cookie */
  /* (это правило вызывало "мерцание" и проскакивание кликов) */
  body:has(.cookie-banner.show) .reco-banner,
  body:has(.cookie-banner.show) .reco-banner--small {
    display: flex !important;
  }
}

/* ═══════════════════════════════════════════════════════
   FALLBACK ГРАДИЕНТЫ (когда нет картинки)
   ═══════════════════════════════════════════════════════ */

.news-card[style*="--cat-color:#5A5FE0"] .news-card-image[data-errored="1"] {
  background: linear-gradient(135deg, #1a1040 0%, #2d1b69 50%, #5A5FE0 100%) !important;
  object-fit: contain !important;
  padding: 30px;
}

.news-card[style*="--cat-color:#E8334A"] .news-card-image[data-errored="1"] {
  background: linear-gradient(135deg, #2d0a0a 0%, #5c1a1a 50%, #E8334A 100%) !important;
  object-fit: contain !important;
  padding: 30px;
}

.news-card[style*="--cat-color:#10B981"] .news-card-image[data-errored="1"] {
  background: linear-gradient(135deg, #052e16 0%, #065f46 50%, #10B981 100%) !important;
  object-fit: contain !important;
  padding: 30px;
}

.news-card[style*="--cat-color:#F59E0B"] .news-card-image[data-errored="1"] {
  background: linear-gradient(135deg, #451a03 0%, #78350f 50%, #F59E0B 100%) !important;
  object-fit: contain !important;
  padding: 30px;
}

/* Дефолтный fallback — если категория не определена */
.news-card .news-card-image[data-errored="1"] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  object-fit: contain !important;
  padding: 30px;
}

/* Hero fallback */
.hero-image[data-errored="1"] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%) !important;
  object-fit: cover !important;
  padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════
   FEATURED CARD — первая и каждая 7-я карточка крупнее
   ═══════════════════════════════════════════════════════ */

@media (min-width: 769px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-flow: dense; /* ✅ Заполняем дыры */
  }

  .news-grid > .news-card:first-child {
    grid-column: span 2;
  }

  .news-grid > .news-card:first-child .news-card-image {
    aspect-ratio: 16/9;
  }

  .news-grid > .news-card:first-child .news-card-title {
    font-size: 20px;
    -webkit-line-clamp: 3;
  }
}

@media (min-width: 960px) {
  .news-grid > .news-card:nth-child(7n+1):not(:first-child) {
    grid-column: span 2;
  }

  .news-grid > .news-card:nth-child(7n+1):not(:first-child) .news-card-image {
    aspect-ratio: 16/9;
  }
}

/* ✅ Компактный и list view — сбрасываем featured */
[data-view="list"] .news-grid,
[data-view="compact"] .news-grid {
  grid-template-columns: 1fr !important;
  grid-auto-flow: row; /* ✅ Возвращаем обычный flow */
}

[data-view="list"] .news-grid > .news-card,
[data-view="compact"] .news-grid > .news-card {
  grid-column: span 1 !important;
}

/* ═══════════════════════════════════════════════════════
   КОМПАКТНАЯ НАВИГАЦИЯ — убираем двойную линию
   ═══════════════════════════════════════════════════════ */

/* Навигация и фильтры визуально объединены */
.main-nav {
  border-bottom: none; /* ✅ Убираем нижнюю линию у nav */
}

.filter-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

/* ✅ Мобильный фильтр — оставляем как есть */
@media (max-width: 768px) {
  .filter-bar {
    height: auto;
    padding: 6px 12px;
    overflow: visible;
  }
}

/* ═══════════════════════════════════════════════════════
   SPARKLINES — мини-графики для курсов валют
   ═══════════════════════════════════════════════════════ */

.currency-sparkline {
  flex-shrink: 0;
  line-height: 0;
  opacity: 0.85;
  margin-left: 4px; /* ✅ Отступ от названия */
  margin-right: 2px;
}

.currency-sparkline svg {
  display: block;
}

.currency-row:last-child { border-bottom: none; }

/* Левая часть — название */
.currency-name {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  font-size: 12px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px; /* ✅ Ограничиваем ширину */
}

/* Правая часть — график + цена + процент */
.currency-row > div {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0; /* ✅ Не сжимается */
}

.currency-change {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 44px; /* ✅ Гарантируем место для процента */
  text-align: right;
}

.currency-change.up   { color: var(--success); }
.currency-change.down { color: var(--danger);  }

/* ═══════════════════════════════════════════════════════
   AI WIDGET — анимированная градиентная рамка
   ═══════════════════════════════════════════════════════ */

/* ✅ CSS Custom Property для анимации угла */
@property --ai-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-ai-border {
  to { --ai-angle: 360deg; }
}

#recommendWidgetContainer.widget {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    conic-gradient(
      from var(--ai-angle),
      var(--primary),
      #8B5CF6,
      #06B6D4,
      #8B5CF6,
      var(--primary)
    ) border-box;
  animation: rotate-ai-border 4s linear infinite;
  position: relative;
}

/* Мягкое свечение за виджетом */
#recommendWidgetContainer.widget::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--ai-angle),
    var(--primary),
    #8B5CF6,
    #06B6D4,
    #8B5CF6,
    var(--primary)
  );
  z-index: -1;
  filter: blur(10px);
  opacity: 0.12;
  animation: rotate-ai-border 4s linear infinite;
}

/* Заголовок виджета */
#recommendWidgetContainer .widget-header {
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* ✅ Фолбэк для браузеров без @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  #recommendWidgetContainer.widget {
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: var(--bg-card);
    animation: none;
  }
}

/* Пульсирующая иконка AI в заголовке виджета */
.widget-badge {
  animation: ai-badge-pulse 3s ease-in-out infinite;
}

@keyframes ai-badge-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
  }
  50% { 
    box-shadow: 0 0 8px 2px rgba(139, 92, 246, 0.3);
  }
}

/* Hover на рекомендациях */
.recommend-item {
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.recommend-item:hover {
  background: var(--bg-hover);
  padding-left: 6px;
  margin: 0 -6px;
  padding-right: 6px;
}

/* Скор рекомендации */
.recommend-score {
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  transition: transform var(--transition);
}

.recommend-item:hover .recommend-score {
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════
   CTRL+K — подсказка быстрого поиска
   ═══════════════════════════════════════════════════════ */

.search-box {
  position: relative; /* уже есть, убедитесь что есть */
}

/* Подсказка Ctrl+K */
.search-kbd {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.search-kbd kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-secondary);
  color: var(--text-muted);
  line-height: 1.6;
  white-space: nowrap;
}

/* Скрываем подсказку когда поиск в фокусе */
.search-box:focus-within .search-kbd {
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* На мобильных не показываем */
@media (max-width: 768px) {
  .search-kbd { display: none; }
}

/* ═══════════════════════════════════════════════════════
   SEARCH BOX — улучшенный фокус
   ═══════════════════════════════════════════════════════ */

.search-box:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(90, 95, 224, 0.12);
}

/* Затемнение фона при поиске */
.search-box:focus-within ~ * {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* Анимация появления дропдауна */
.search-dropdown.show {
  display: block;
  animation: dropdown-in 0.2s ease;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Улучшенные подсказки поиска */
.search-suggestion {
  transition: background var(--transition);
}

.search-suggestion:hover {
  background: var(--bg-hover);
}

.search-suggestion-icon {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: transform var(--transition);
}

.search-suggestion:hover .search-suggestion-icon {
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════
   LIVE BADGE — пульсирующая точка
   ═══════════════════════════════════════════════════════ */

.live-badge {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  letter-spacing: 0.5px;
  animation: none;
  padding-left: 4px; /* ✅ Даём место точке слева */
  overflow: visible; /* ✅ Не обрезаем точку */
  position: relative;
}

.live-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  min-width: 7px; /* ✅ Не сжимается */
  border-radius: 50%;
  background: #EF4444;
  flex-shrink: 0;
  animation: live-dot-pulse 1.8s ease-in-out infinite;
  position: relative; /* ✅ Не вылезает за границы */
}

@keyframes live-dot-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    transform: scale(1.1);
  }
}

/* ✅ Разрешаем overflow родителям */
.ticker-wrap {
  overflow: visible;
}

/* ═══════════════════════════════════════════════════════
   CARD BADGE NEW — таймер вместо статичного NEW
   ═══════════════════════════════════════════════════════ */

.card-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(232, 51, 74, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(232, 51, 74, 0.4);
  white-space: nowrap;
  animation: none;
}

/* Бейдж на Featured Card — чуть крупнее */
.news-grid > .news-card:first-child .card-badge-new {
  font-size: 11px;
  padding: 5px 12px;
}

/* Hover — бейдж не перекрывает картинку */
.news-card:hover .card-badge-new {
  opacity: 0.85;
}