/* ============================================================
   SMART AUDIT 2035 — дизайн-система «Редакция»
   Современный профессиональный новостной портал.
   Editorial journal: бумага/чернила, золото и зелёный сигнал,
   типографика новостной редакции (Inter Tight / Inter / JetBrains Mono).
   Темы: dark («ночной выпуск», по умолчанию) и light («бумажный выпуск»).
   ============================================================ */

:root {
  --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 9px;
  --r-lg: 16px;
  --r-pill: 999px;
  --trans: .18s cubic-bezier(.4, 0, .2, 1);
  --maxw: 1160px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .12);
}

/* ============ Тема dark — «ночной выпуск» ============ */
[data-theme="dark"] {
  --bg: #0D1317;
  --bg-2: #101820;
  --surface: #141E24;
  --surface-2: #1A252C;
  --surface-3: #223039;
  --border: rgba(222, 235, 228, .09);
  --border-strong: rgba(222, 235, 228, .2);
  --text: #EDF2EC;
  --text-2: #A9B7BD;
  --text-3: #75878E;
  --gold: #D3A262;
  --green: #58B99C;
  --red: #DA7773;
  --blue: #7FA8C9;
  --violet: #A78BFA;
  --cyan: #67C6E0;
  --amber: #E8A35E;
  --gold-soft: rgba(211, 162, 98, .13);
  --green-soft: rgba(88, 185, 156, .13);
  --red-soft: rgba(218, 119, 115, .13);
  --blue-soft: rgba(127, 168, 201, .13);
  --violet-soft: rgba(167, 139, 250, .14);
  --cyan-soft: rgba(103, 198, 224, .14);
  --amber-soft: rgba(232, 163, 94, .14);
  --gray-soft: rgba(169, 183, 189, .13);
  --ink-panel: #0A0F13;
  --ink-panel-text: #E2F0E9;
  --ink-panel-muted: #8FA6A0;
  --hero-glow: radial-gradient(520px 300px at 18% -8%, rgba(88, 185, 156, .13), transparent 62%),
               radial-gradient(600px 340px at 88% 12%, rgba(211, 162, 98, .1), transparent 60%);
  --hero-art-grad: linear-gradient(135deg, #1B3036, #152129);
  --header-bg: rgba(13, 19, 23, .82);
  color-scheme: dark;
}

/* ============ Тема light — «бумажный выпуск» ============ */
[data-theme="light"] {
  --bg: #F5F2E9;
  --bg-2: #EFEAE0;
  --surface: #FBF9F2;
  --surface-2: #F2EEE3;
  --surface-3: #E8E2D4;
  --border: rgba(6, 47, 51, .13);
  --border-strong: rgba(6, 47, 51, .26);
  --text: #062F33;
  --text-2: #527174;
  --text-3: #617074;
  --gold: #8E6430;
  --green: #157A62;
  --red: #A34B48;
  --blue: #3E6E8E;
  --violet: #6D5BD0;
  --cyan: #2E7A94;
  --amber: #B0762F;
  --gold-soft: rgba(185, 130, 63, .16);
  --green-soft: rgba(27, 155, 125, .12);
  --red-soft: rgba(163, 75, 72, .12);
  --blue-soft: rgba(62, 110, 142, .13);
  --violet-soft: rgba(109, 91, 208, .13);
  --cyan-soft: rgba(46, 122, 148, .13);
  --amber-soft: rgba(176, 118, 47, .14);
  --gray-soft: rgba(82, 113, 116, .12);
  --ink-panel: #062F33;
  --ink-panel-text: #E2F0E9;
  --ink-panel-muted: #9CB8B2;
  --hero-glow: radial-gradient(520px 300px at 18% -8%, rgba(27, 155, 125, .12), transparent 62%),
               radial-gradient(600px 340px at 88% 12%, rgba(185, 130, 63, .1), transparent 60%);
  --hero-art-grad: linear-gradient(135deg, #D8E8E1, #C6DED9);
  --header-bg: rgba(245, 242, 233, .86);
  color-scheme: light;
}

/* Светлая тема: более тёмные тексты бейджей и чипов (WCAG AA для мелкого шрифта) */
[data-theme="light"] .badge { background: var(--gray-soft); color: #4A5F63; }
[data-theme="light"] .badge.audit { background: var(--gold-soft); color: #6E4A1A; }
[data-theme="light"] .badge.risk { background: var(--red-soft); color: #8C3B37; }
[data-theme="light"] .badge.control { background: var(--blue-soft); color: #2F5B77; }
[data-theme="light"] .badge.governance { background: var(--green-soft); color: #0E5A47; }
[data-theme="light"] .badge.regulation { background: var(--violet-soft); color: #5B4CB8; }
[data-theme="light"] .badge.tech { background: var(--cyan-soft); color: #1E5E75; }
[data-theme="light"] .badge.cyber { background: var(--amber-soft); color: #8F5E24; }
[data-theme="light"] .badge.research, [data-theme="light"] .badge.event,
[data-theme="light"] .badge.standard, [data-theme="light"] .badge.tool,
[data-theme="light"] .badge.news { background: var(--gray-soft); color: #4A5F63; }
[data-theme="light"] .date-chip { color: #6E4A1A; }
[data-theme="light"] .summary-chip { color: #E2F0E9; }

/* ============ Base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  transition: background var(--trans), color var(--trans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: inherit; }
::selection { background: rgba(88, 185, 156, .28); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

/* ============ Masthead ============ */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 12px 24px; max-width: var(--maxw); margin: 0 auto;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: var(--gold);
  background: var(--surface-2);
  border: 1px solid var(--green);
  transition: all var(--trans);
}
.brand:hover .brand-mark { color: var(--ink-panel-text); background: var(--green); border-color: var(--green); transform: rotate(-6deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px;
  letter-spacing: -.015em; white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-top: 3px;
}
.mainnav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 7px 12px; border-radius: var(--r-sm); transition: all var(--trans);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.masthead-actions { display: flex; align-items: center; gap: 12px; }
.theme-switcher { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); padding: 3px; border-radius: var(--r-pill); }
.theme-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text-3);
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: var(--r-pill); cursor: pointer; transition: all var(--trans);
}
.theme-btn:hover { color: var(--text); }
.theme-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.tg-link {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--text-2); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); padding: 7px 13px; border-radius: var(--r-pill);
  transition: all var(--trans); white-space: nowrap;
}
.tg-link:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; background: var(--bg); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--hero-glow);
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center;
  padding: 64px 24px 56px; max-width: var(--maxw); margin: 0 auto;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 18px;
}
.eyebrow b { color: var(--text); font-weight: 700; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 750; line-height: 1.06; letter-spacing: -.028em;
  margin-bottom: 16px; text-wrap: balance;
}
.hero-title .hl {
  color: var(--green);
  background: linear-gradient(100deg, var(--gold), var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 15px; color: var(--text-2); max-width: 560px; margin-bottom: 28px; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-meta span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
}
.hero-meta b { color: var(--text-2); font-weight: 600; }

/* Художественный блок hero (чистый CSS — без картинок) */
.hero-art { position: relative; height: 250px; border-radius: 20px; background: var(--hero-art-grad); overflow: hidden; border: 1px solid var(--border-strong); }
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 80% 90% at 50% 100%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 100%, #000 30%, transparent 100%);
}
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); }
.orbit-one { width: 300px; height: 300px; right: -90px; top: -140px; }
.orbit-two { width: 220px; height: 220px; left: -70px; bottom: -130px; border-color: rgba(211, 162, 98, .25); }
.doc-card {
  position: absolute; right: 20%; top: 18%;
  width: 128px; height: 146px; transform: rotate(4deg);
  background: var(--bg-2); border-radius: 14px;
  box-shadow: 0 18px 28px rgba(0, 0, 0, .3);
  padding: 16px 14px; border: 1px solid var(--border-strong);
}
.doc-fold { position: absolute; top: 0; right: 0; width: 26px; height: 26px; background: var(--gold-soft); border-bottom-left-radius: 12px; }
.doc-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.doc-lines i { height: 7px; border-radius: 3px; background: var(--surface-3); }
.doc-lines i:nth-child(2) { width: 82%; }
.doc-lines i:nth-child(3) { width: 64%; }
.doc-lines i:nth-child(4) { width: 74%; }
.doc-seal {
  position: absolute; left: 14px; bottom: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--green);
}
.tick { position: absolute; font-size: 11px; color: var(--gold); font-family: var(--font-mono); }
.tick-a { left: 14%; top: 22%; }
.tick-b { right: 12%; bottom: 20%; color: var(--green); }
.tick-c { left: 30%; bottom: 16%; color: var(--text-3); }

/* ============ Итог выпуска ============ */
.issue-summary {
  background: var(--ink-panel); color: var(--ink-panel-text);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.summary-inner {
  display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start;
  padding: 20px 24px; max-width: var(--maxw); margin: 0 auto;
}
.summary-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
  padding-top: 3px;
}
.summary-body { display: flex; flex-direction: column; gap: 6px; }
.summary-line { font-size: 14px; color: var(--ink-panel-text); }
.summary-line b { color: var(--green); font-weight: 700; }
.summary-line.muted { color: var(--ink-panel-muted); font-size: 12.5px; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.summary-chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
  border: 1px solid rgba(226, 240, 233, .22); border-radius: var(--r-pill);
  padding: 3px 10px; color: var(--ink-panel-text);
}

/* ============ Toolbar ============ */
.main { padding-top: 6px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin: 28px 0 14px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.issue-select {
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 34px 8px 12px; cursor: pointer; outline: none; max-width: 290px;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  transition: border-color var(--trans);
}
.issue-select:hover, .issue-select:focus { border-color: var(--green); }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; }
.search-input {
  flex: 1; font-family: var(--font-ui); font-size: 13.5px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 14px; outline: none;
  transition: border-color var(--trans), background var(--trans);
}
.search-input:focus { border-color: var(--green); background: var(--surface-2); }
.search-input::placeholder { color: var(--text-3); }
.rss-link {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; color: var(--gold);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 13px; transition: all var(--trans); white-space: nowrap;
}
.rss-link:hover { border-color: var(--gold); background: var(--gold-soft); }

/* ============ Табы категорий ============ */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-tab {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 6px 14px; cursor: pointer; transition: all var(--trans);
}
.cat-tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.cat-tab .t-emoji { font-size: 12.5px; line-height: 1; }
.cat-tab .n {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  background: var(--surface-3); border-radius: var(--r-pill);
  padding: 1px 7px; color: var(--text-3);
}
.cat-tab.active { color: var(--ink-panel-text); border-color: transparent; background: var(--ink-panel); }
.cat-tab.active .n { background: rgba(255, 255, 255, .16); color: var(--ink-panel-text); }

/* ============ Секции тем ============ */
.sections { display: flex; flex-direction: column; gap: 30px; }
.section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px;
  padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.section-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.section-title .emoji { font-size: 15px; margin-right: 4px; }
.section-count { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ============ Карточки новостей ============ */
.card {
  position: relative;
  min-width: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 17px 18px;
  box-shadow: var(--shadow-card);
  transition: transform var(--trans), border-color var(--trans), background var(--trans), box-shadow var(--trans);
}
.card-cover-link {
  display: block; margin: -17px -18px 12px; border-radius: var(--r) var(--r) 0 0;
  overflow: hidden; line-height: 0;
}
.card-cover {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  display: block; transition: transform var(--trans);
}
.card-cover-link:hover .card-cover { transform: scale(1.02); }
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-pop);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  border-radius: var(--r-xs); padding: 3px 8px;
  background: var(--gray-soft); color: var(--text-2);
}
/* Домены (бейдж карточки, с 24.08.2026) */
.badge.audit { background: var(--gold-soft); color: var(--gold); }
.badge.risk { background: var(--red-soft); color: var(--red); }
.badge.control { background: var(--blue-soft); color: var(--blue); }
.badge.governance { background: var(--green-soft); color: var(--green); }
.badge.regulation { background: var(--violet-soft); color: var(--violet); }
.badge.tech { background: var(--cyan-soft); color: var(--cyan); }
.badge.cyber { background: var(--amber-soft); color: var(--amber); }
.badge.research { background: var(--gray-soft); color: var(--text-2); }
.badge.event, .badge.standard, .badge.tool, .badge.news { background: var(--gray-soft); color: var(--text-2); }
/* Тип материала — мелкая метка рядом с бейджем */
.kind { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); margin-left: 6px; align-self: center; white-space: nowrap; }
.card h3 { font-family: var(--font-ui); font-size: 14.5px; font-weight: 650; line-height: 1.42; letter-spacing: -.01em; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--green); }
.card h3.no-link { color: var(--text-2); cursor: default; }
.card .summary { font-size: 13px; color: var(--text-2); margin-top: 7px; flex: 1; }
.link-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-3); flex-wrap: wrap;
}
.link-line .src { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; color: var(--text-2); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-line a { color: var(--green); text-decoration: none; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.link-line a:hover { text-decoration: underline; }

.empty-state {
  text-align: center; color: var(--text-3); padding: 64px 20px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  font-size: 14px;
}

/* ============ Результаты поиска ============ */
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 12px; }
.search-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 16px; transition: border-color var(--trans), background var(--trans);
}
.search-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.search-row .date-chip {
  flex: none; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .05em; color: var(--gold); background: var(--gold-soft);
  border-radius: var(--r-xs); padding: 3px 8px; white-space: nowrap;
}
.search-row .row-title { flex: 1; font-size: 13.5px; font-weight: 600; line-height: 1.4; min-width: 0; }
.search-row .row-title a { color: inherit; text-decoration: none; }
.search-row .row-title a:hover { color: var(--green); }
.search-row .row-src { flex: none; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ About ============ */
.about {
  margin-top: 54px; padding: 34px 0 44px;
  border-top: 1px solid var(--border); background: var(--bg-2);
}
.about-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.about-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.about-tag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-soft); border-radius: var(--r-xs); padding: 3px 9px;
}
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 22px; }
.about-item { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.about-ico { font-size: 22px; margin-bottom: 10px; }
.about-item h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.about-item p { font-size: 13px; color: var(--text-2); }
.about code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.disclaimer {
  border-top: 1px solid var(--border); padding-top: 14px;
  font-size: 12.5px; color: var(--text-3); max-width: 860px;
}

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 26px 24px; max-width: var(--maxw); margin: 0 auto; flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: 3px; }
.footer-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.footer-note { font-size: 12px; color: var(--text-3); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; transition: color var(--trans); }
.footer-links a:hover { color: var(--green); }
.footer-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--text-3); }
.footer-legal {
  border-top: 1px solid var(--border);
  padding: 14px 24px 20px; max-width: var(--maxw); margin: 0 auto;
  font-size: 11.5px; color: var(--text-3);
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { max-width: 420px; height: 220px; }
}
@media (max-width: 720px) {
  .container, .masthead-inner, .hero-inner, .summary-inner, .footer-inner, .footer-legal { padding-left: 16px; padding-right: 16px; }
  .hero-inner { padding-top: 44px; padding-bottom: 40px; }
  .masthead-inner { gap: 10px; }
  .mainnav { order: 3; width: 100%; justify-content: center; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
  .news-grid { grid-template-columns: 1fr; }
  .summary-inner { grid-template-columns: 1fr; gap: 10px; }
  .search-row { flex-wrap: wrap; gap: 8px; }
  .search-row .row-src { max-width: 100%; }
  .hero-meta { gap: 14px; }
  .toolbar { margin-top: 20px; }
  .issue-select { max-width: 100%; }
}

/* ============ Доступность / движение ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   P2: закладки, фильтр источников, шаринг, toast
   ============================================================ */

.bm-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--trans), transform var(--trans);
}
.bm-btn:hover { color: var(--gold); transform: translateY(-1px); }
.bm-btn.active { color: var(--gold); }
.card-top { justify-content: space-between; }

.bm-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 550;
  color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: color var(--trans), border-color var(--trans), background var(--trans);
}
.bm-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.bm-toggle.active { color: var(--gold); border-color: rgba(211, 162, 98, .45); background: var(--gold-soft); }
.bm-count {
  background: var(--gold); color: #14202a; font-weight: 700; font-size: 10.5px;
  border-radius: var(--r-pill); padding: 1px 6px;
}

.source-select { max-width: 220px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 16px);
  background: var(--ink-panel); color: var(--ink-panel-text);
  font-family: var(--font-ui); font-size: 13px; font-weight: 550;
  padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Деликатный апгрейд: hero-градиент заголовка и свечение карточек */
.hero-title {
  background: linear-gradient(100deg, var(--text) 55%, var(--green) 82%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .hero-title {
  background: linear-gradient(100deg, #1A2530 55%, #2E8A6F 82%, #B07E3C 100%);
  -webkit-background-clip: text; background-clip: text;
}
.section-title { letter-spacing: -.015em; }
.news-section .section-count { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* ============================================================
   Mobile overflow fixes — экраны 320–430px
   Результат аудита горизонтального переполнения.
   Блок аддитивный: десктопные правила не переопределяет.
   ============================================================ */

/* --- Глобальные страховки --- */
body { overflow-x: clip; } /* последний рубеж; clip не создаёт скролл-контейнер и не ломает position:sticky шапки */
.card h3, .card .summary,
.summary-line, .row-title, .empty-state,
.about-item p, .disclaimer, .footer-note, .footer-legal,
.issue-links {
  overflow-wrap: break-word;
}
/* inline style запрещён CSP (style-src 'self') — стили #issueLinks из index.html перенесены сюда */
.issue-links { margin-top: 12px; font-size: 12px; line-height: 2; }

/* 1) Ссылка-первоисточник в карточке: label = URL без протокола и без
      переносов (до сотен символов у news.google.com/...) при
      white-space:nowrap распирала карточку. Режем многоточием, как .src. */
.link-line a {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-line .src { min-width: 0; }

@media (max-width: 720px) {
  /* 2) Шапка: свитчер тем (~210px) + tg-link (~145px) не помещаются
        в 288px контента при 320px — разрешаем внутренний перенос */
  .masthead-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }

  /* 3) Тулбар: снимаем min-width:260px у .toolbar-right, поиск — вся строка */
  .toolbar-right { flex-wrap: wrap; min-width: 0; width: 100%; }
  .search-input { min-width: 0; flex: 1 1 160px; font-size: 16px; } /* 16px — без авто-зума iOS */

  /* toolbar-left (архив + фильтр источников): селекты сжимаются и переносятся */
  .toolbar { min-width: 0; }
  .toolbar-left { flex-direction: column; align-items: stretch; min-width: 0; width: 100%; }
  .toolbar-left .toolbar-label { margin-bottom: 2px; }
  .toolbar-left .issue-select,
  .toolbar-left .source-select { min-width: 0; max-width: 100%; width: auto; flex: 1 1 auto; }
  .toolbar-label { white-space: normal; }

  /* 4) Каскадная ошибка: базовый .source-select{max-width:220px} объявлен
        НИЖЕ media-правила .issue-select{max-width:100%} и побеждал его.
        Чиним явно на том же уровне каскада. */
  .source-select { max-width: 100%; }

  /* 5) hero-meta: плотнее при переносе 5 span'ов */
  .hero-meta { row-gap: 6px; }

  /* toast не шире вьюпорта */
  .toast { max-width: calc(100vw - 40px); text-align: center; }
}

@media (max-width: 430px) {
  /* 6) Узкие экраны: кнопки тем — только иконки (подписи остаются
        в title/aria-label), tg-link компактнее — шапка снова в одну строку */
  .theme-btn span { display: none; }
  .theme-btn { padding: 5px 9px; gap: 0; }
  .tg-link { font-size: 12px; padding: 6px 11px; gap: 5px; }
  .masthead-actions { gap: 8px; }

  /* карточкам чуть больше воздуха */
  .card { padding: 15px 14px; }
}

@media print {
  .masthead, .hero, .issue-summary, .toolbar, .cat-tabs, .theme-switcher, .tg-link, .rss-link, .site-footer, .about { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .search-row { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
}

/* Страницы выпусков: навигация и футер (перенесены из inline — CSP style-src 'self') */
.archive-back { margin: 32px 0; }
.issue-footer { padding: 24px 0; text-align: center; color: var(--text-3); }
