/* fnpr.org.ru - redesign 2026. ASCII only: file is served inside a cp1251 page. */

/* ---------- tokens ---------- */
:root {
  --bg:        #0b1220;
  --bg-2:      #101a2e;
  --panel:     rgba(255,255,255,.045);
  --panel-2:   rgba(255,255,255,.075);
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.18);
  --ink:       #e8eef8;
  --ink-2:     #a8b6cd;
  --ink-3:     #7386a3;
  --accent:    #2fd4a3;
  --accent-2:  #35b9ff;
  --warn:      #ffb03a;
  --down:      #ff6b6b;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
  --maxw:      1240px;
  --font:      "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="light"] {
  --bg:      #f5f7fb;
  --bg-2:    #ffffff;
  --panel:   rgba(14,25,45,.035);
  --panel-2: rgba(14,25,45,.06);
  --line:    rgba(14,25,45,.10);
  --line-2:  rgba(14,25,45,.20);
  --ink:     #0e1a2d;
  --ink-2:   #43536c;
  --ink-3:   #6b7c96;
  --accent:  #0d9e78;
  --accent-2:#0a7fc4;
  --shadow:  0 10px 28px rgba(14,25,45,.10);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; border: 0; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { line-height: 1.22; margin: 0 0 .55em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(26px, 3.6vw, 40px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: clamp(19px, 2vw, 23px); }
p  { margin: 0 0 1.05em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.clear { clear: both; }

/* ---------- background glow ---------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 12% -8%,  rgba(47,212,163,.16), transparent 60%),
    radial-gradient(55vw 45vh at 92% 4%,   rgba(53,185,255,.14), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: var(--bg); /* фолбэк для браузеров без color-mix */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 18px; min-height: 68px; }

/* min-width:0 обязателен: иначе флекс-элемент не сжимается ниже своего текста
   и выталкивает кнопки шапки за экран на узких экранах. */
.brand { display: flex; align-items: center; gap: 11px; flex: 0 1 auto; min-width: 0; }
.brand .brand-txt { min-width: 0; }
.brand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--ink); font-size: 18px; letter-spacing: -.02em; display: block; }
.brand .brand-txt span { color: var(--ink-3); font-size: 11.5px; letter-spacing: .10em; text-transform: uppercase; display: block; }

.nav { margin-left: auto; }
.nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 9px 13px; border-radius: 999px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500; white-space: nowrap;
  transition: background .18s, color .18s;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav .current > a { background: var(--accent); color: #062018; font-weight: 600; }
html[data-theme="light"] .nav .current > a { color: #fff; }

.head-btn {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--panel); color: var(--ink); cursor: pointer;
  transition: background .18s, transform .18s;
}
.head-btn:hover { background: var(--panel-2); }
.head-btn:active { transform: scale(.94); }
.head-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-sun { display: none; }
html[data-theme="light"] .icon-sun  { display: block; }
html[data-theme="light"] .icon-moon { display: none; }
.nav-toggle { display: none; }

/* ---------- ticker ---------- */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
/* Семь позиций ЦБ должны помещаться на 1280 px; уже — строка горизонтально скроллится. */
.ticker-row { display: flex; gap: 18px; padding: 9px 0; overflow-x: auto; scrollbar-width: none; }
.ticker-row::-webkit-scrollbar { display: none; }
.tick { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; font-size: 13.5px; }
.tick b { color: var(--ink-2); font-weight: 600; letter-spacing: .04em; }
.tick i { font-style: normal; color: var(--ink); font-variant-numeric: tabular-nums; }
.tick em { font-style: normal; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.up   { color: var(--accent); }
.down { color: var(--down); }
.tick-src { color: var(--ink-3); font-size: 12.5px; }

/* ---------- hero ---------- */
.hero {
  position: relative; margin: 22px 0 0;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(6,12,24,.93) 0%, rgba(6,12,24,.72) 45%, rgba(6,12,24,.30) 100%);
}
html[data-theme="light"] .hero::after {
  background: linear-gradient(100deg, rgba(8,16,32,.90) 0%, rgba(8,16,32,.66) 45%, rgba(8,16,32,.28) 100%);
}
.hero-in { padding: clamp(28px, 5vw, 64px); max-width: 720px; color: #eaf2ff; }
/* Визуально заголовок, семантически — нет: h1 страницы остаётся контентным. */
.hero-title {
  color: #fff; font-weight: 700; letter-spacing: -.015em; line-height: 1.18;
  font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 .5em;
}
.hero-in p { color: #c2d2e8; font-size: clamp(15px, 1.5vw, 17.5px); margin-bottom: 1.5em; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: #d7e4f5;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(47,212,163,.22); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .16s, box-shadow .16s, background .16s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04180f; box-shadow: 0 8px 22px rgba(47,212,163,.30); }
.btn-ghost { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.25); color: #eaf2ff; }

/* ---------- section heads ---------- */
.sec { margin: 46px 0 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 0; color: var(--ink-3); font-size: 14px; }
.eyebrow { color: var(--accent); font-size: 12.5px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  position: relative; display: block; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  overflow: hidden;
  transition: transform .2s, border-color .2s, background .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--panel-2); text-decoration: none; }
.card img { width: 58px; height: 58px; border-radius: 13px; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin-bottom: 6px; }
.card p { color: var(--ink-3); font-size: 13.5px; margin: 0; }
.card .go { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.card .go::after { content: " \2192"; }

/* ---------- charts ---------- */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 22px;
}
.charts { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 17px; }
.panel-note { color: var(--ink-3); font-size: 12px; margin: 4px 0 14px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.seg button {
  border: 0; background: none; cursor: pointer; color: var(--ink-3);
  padding: 6px 14px; border-radius: 999px; font: 600 13px var(--font);
  transition: background .16s, color .16s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--accent); color: #062018; }
html[data-theme="light"] .seg button[aria-selected="true"] { color: #fff; }

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-txt { fill: var(--ink-3); font: 500 11px var(--font); }
.spark-line { fill: none; stroke: url(#gline); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: url(#garea); }
.hit { fill: transparent; cursor: crosshair; }
.cursor-line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; }
.cursor-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 3; opacity: 0; }

.tip {
  position: absolute; z-index: 20; pointer-events: none; opacity: 0;
  transform: translate(-50%, -120%);
  padding: 8px 11px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); color: var(--ink);
  font-size: 12.5px; white-space: nowrap; transition: opacity .12s;
}
.tip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.tip span { color: var(--ink-3); }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { flex: 0 0 168px; position: relative; }
.donut svg { transform: rotate(-90deg); }
.donut-seg { cursor: pointer; transition: opacity .18s, stroke-width .18s; }
.donut-seg:hover, .donut-seg.on { stroke-width: 26; }
.donut.dim .donut-seg:not(.on):not(:hover) { opacity: .28; }
.donut-mid {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.donut-mid b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.donut-mid span { color: var(--ink-3); font-size: 11.5px; }
.legend { flex: 1 1 170px; list-style: none; margin: 0; padding: 0; }
.legend li {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px;
  font-size: 13.5px; cursor: pointer; transition: background .16s;
}
.legend li:hover { background: var(--panel-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend span { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 116px 1fr 56px; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 1.1s cubic-bezier(.22,.9,.3,1);
}
.bar-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- content layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 30px; margin: 44px 0 0; align-items: start; }
.main-col { min-width: 0; }
.article {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: clamp(20px, 3vw, 36px);
}
.article h1 { margin-top: 0; }
.article img { border-radius: var(--radius-sm); margin: 10px 0 18px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 1.05em; }
.article li { margin-bottom: .4em; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 1.05em; font-size: 14.5px; display: block; overflow-x: auto; }
.article td, .article th { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.article blockquote {
  margin: 0 0 1.05em; padding: 12px 18px;
  border-left: 3px solid var(--accent); background: var(--panel-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2);
}
.article .date, .date { color: var(--ink-3); font-size: 13px; }

.breadcrumb { font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-2); }

/* engine-generated lists (menu.php / news.php) */
.side .list-1, .side ul.pos, .article ul.pos { list-style: none; padding: 0; margin: 0; }
/* Движок отдаёт "<span>дата</span> - <a>". Дата вынесена на свою строку, поэтому
   голый дефис между ними гасим нулевым кеглем на li и возвращаем его детям. */
.side .list-1 li, .side ul.pos li {
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0; line-height: 1.45;
}
.side .list-1 li > *, .side ul.pos li > * { font-size: 14px; }
.side .list-1 li:last-child, .side ul.pos li:last-child { border-bottom: 0; }
.side .list-1 li span, .side ul.pos li span { display: block; color: var(--ink-3); font-size: 11.5px; margin-bottom: 3px; }
.side .list-1 a, .side ul.pos a { color: var(--ink); }
.side .list-1 a:hover, .side ul.pos a:hover { color: var(--accent); text-decoration: none; }

.side { display: grid; gap: 18px; position: sticky; top: 90px; }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.side-box h5, .side-box .p4-1 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.side-box hr { margin: 16px 0; }

/* sape blocks stay visible and in flow */
.sape-block { margin: 0 0 18px; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); }
.sape-block a { color: var(--ink-2); }
.side-box .sape-block { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }

/* forms (search / discuss) */
input[type="text"], input[type="email"], textarea, select {
  width: 100%; max-width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--ink); font: 400 15px var(--font);
}
textarea { min-height: 120px; resize: vertical; }
button, input[type="submit"] {
  padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #062018; font: 600 14.5px var(--font);
}
html[data-theme="light"] button, html[data-theme="light"] input[type="submit"] { color: #fff; }
button:hover, input[type="submit"]:hover { filter: brightness(1.08); }
form div { margin-bottom: 11px; }
form span { display: block; color: var(--ink-3); font-size: 13px; margin-bottom: 4px; }

/* ---------- footer ---------- */
.site-foot {
  margin-top: 56px; padding: 30px 0 34px;
  border-top: 1px solid var(--line); background: var(--panel);
  color: var(--ink-3); font-size: 13.5px;
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.foot-nav a { color: var(--ink-2); font-size: 14px; }
.foot-nav a:hover { color: var(--accent); text-decoration: none; }
.foot-row { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: var(--ink-2); }
.foot-links { margin-top: 14px; font-size: 13px; line-height: 1.8; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .cards  { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .side   { position: static; }
}
@media (max-width: 760px) {
  .nav-toggle { display: grid; order: 3; }
  .nav {
    order: 4; flex: 1 0 100%; margin: 0;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.open { max-height: 420px; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 14px; }
  .nav a { padding: 11px 14px; border-radius: var(--radius-sm); }
  .head-row { flex-wrap: wrap; }
  .brand { margin-right: auto; }
  .hero-in { padding: 26px 20px 30px; }
  .bar-row { grid-template-columns: 92px 1fr 48px; font-size: 12.5px; }
  .donut { flex: 0 0 138px; }
}
@media (max-width: 460px) {
  .cards { grid-template-columns: 1fr; }
  body { font-size: 15.5px; }
  /* Экономим ширину шапки, чтобы обе кнопки гарантированно помещались. */
  .brand img { width: 28px; height: 28px; }
  .brand b { font-size: 16px; }
  .brand .brand-txt span { display: none; }
  .head-row { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-head, .ticker, .hero, .sec, .side, .site-foot { display: none !important; }
  body { background: #fff; color: #000; }
}
