/* ═══════════════════════════════════════════════════════
    HYPENET CSS — MOBILE-FIRST FIXED
   ═══════════════════════════════════════════════════════ */

: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;
}

[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, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
}

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: 500;
  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-badge 2s infinite;
}

@keyframes pulse-badge {
  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: 490;
  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;
}

/* 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: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.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-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.filter-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.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: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 8px;
}

.currency-row:last-child {
  border-bottom: none;
}

.currency-name {
  font-weight: 600;
  color: var(--text);
}

.currency-value {
  font-weight: 700;
  color: var(--text);
}

.currency-change {
  font-size: 11px;
  font-weight: 700;
}

.currency-change.up {
  color: var(--success);
}

.currency-change.down {
  color: var(--danger);
}

.currency-skeleton {
  height: 36px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  animation: skeleton-pulse 1.5s infinite;
}

@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;
  display: block;
}

.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 {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: card-fade-in 0.4s ease both;
  min-width: 0;
}

@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 {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--bg-hover);
}

.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);
}

.news-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-btn {
  flex: 1;
  min-width: 80px;
  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;
}

[data-view="list"] .news-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: auto;
}

[data-view="list"] .news-card-image {
  height: 100%;
  min-height: 160px;
}

[data-view="compact"] .news-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

[data-view="compact"] .news-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  height: auto;
}

[data-view="compact"] .news-card-image {
  height: 80px;
}

[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: 1000;
  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);
}

.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;
}

/* 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: 2000;
  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 */
  .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;
  }

  /* Nav */
  .main-nav {
    padding: 0 12px;
  }

  .nav-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* ✅ ФИКС: Filter bar — одна строка на мобильном */
  .filter-bar {
    padding: 8px 12px;
    flex-direction: row;        /* ← было column */
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .filter-left {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .filter-left::-webkit-scrollbar {
    display: none;
  }

  .filter-right {
    flex-shrink: 0;
    justify-content: flex-end;
  }

  /* Layout */
  .layout {
    padding: 0 12px;
    margin: 12px auto;
  }

  /* ✅ ФИКС: Герой — скрываем кнопки на мобильном */
  .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 */
  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .news-card-image {
    height: 200px;
  }

  .news-card-actions {
    flex-direction: column;
  }

  .card-btn {
    width: 100%;
  }

  [data-view="list"] .news-card,
  [data-view="compact"] .news-card {
    grid-template-columns: 1fr;
  }

  [data-view="compact"] .news-card-image {
    height: 140px;
  }

  .section-header h2 {
    font-size: 16px;
  }

  /* Footer */
  .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;
  }

  .modal-box {
    max-height: 90vh;
    border-radius: var(--radius);
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .scroll-top {
    bottom: 70px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Очень маленький экран */
@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;
  }
}