/* ============================================================================
   365fx.ru — Стили (v6)
   ============================================================================ */

:root {
  --bg: #000000;
  --text: #FFFFFF;
  --positive: #22C55E;
  --negative: #EF4444;

  --text-muted: rgba(255, 255, 255, 0.62);
  --text-dim:   rgba(255, 255, 255, 0.42);
  --text-faint: rgba(255, 255, 255, 0.22);

  --border:         rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.22);
  --border-hover:   rgba(255, 255, 255, 0.45);

  --bg-soft:  rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.02);

  --container-w: 1280px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font: 'Unbounded', 'Trebuchet MS', system-ui, -apple-system, sans-serif;

  --t: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-synthesis: style weight;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--text);
  text-decoration: none;
  transition: opacity var(--t);
}
a:hover { opacity: 0.7; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; font-size: 15px; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
strong { font-weight: 700; color: var(--text); }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.accent { color: var(--text); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.neutral  { color: var(--text-muted); }

/* -----------------------------------------------------------
   Топбар: 365FX + «Обновление ЦБ РФ: дата»
   ----------------------------------------------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 0 40px;
}

.topbar-logo {
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.05em;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity var(--t);
}
.topbar-logo:hover { opacity: 0.75; }
.topbar-logo .logo-365 { color: var(--positive); }
.topbar-logo .logo-fx  { color: var(--negative); }

.topbar-title {
  font-weight: 700;
  font-style: italic;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-align: right;
  color: var(--text);
  margin: 0;
}

/* Явный перенос после двоеточия на мобильных */
.tb-break { display: inline; }
@media (min-width: 640px) {
  .tb-break { display: none; }
}

@media (min-width: 640px) {
  .topbar { padding: 36px 0 48px; }
  .topbar-logo { font-size: 40px; }
  .topbar-title {
    font-size: 16px;
    white-space: nowrap; /* одна строка на десктопе */
  }
}

@media (min-width: 960px) {
  .topbar { padding: 44px 0 56px; }
  .topbar-logo { font-size: 48px; }
  .topbar-title { font-size: 18px; }
}

/* -----------------------------------------------------------
   Main
   ----------------------------------------------------------- */
.site-main {
  flex: 1;
  padding: 0 0 40px;
}
@media (min-width: 960px) {
  .site-main { padding: 0 0 56px; }
}

/* -----------------------------------------------------------
   H1 / Подзаголовки
   ----------------------------------------------------------- */
.page-title {
  font-size: 30px;
  line-height: 1.08;
  margin: 0 0 24px;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.page-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 32px;
}

@media (min-width: 640px) { .page-title { font-size: 40px; } }
@media (min-width: 960px) { .page-title { font-size: 52px; } }

/* -----------------------------------------------------------
   Секции
   ----------------------------------------------------------- */
.section { margin: 48px 0; }
.section:first-child { margin-top: 0; }
.section-title {
  font-size: 22px;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.section-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.section-title + .pairs-grid,
.section-title + .amounts-grid,
.section-title + .matrix-wrap,
.section-title + .same-amount-grid,
.section-title + .related-pairs,
.section-title + .converter,
.section-title + .currencies-grid {
  margin-top: 18px;
}

@media (min-width: 960px) {
  .section { margin: 64px 0; }
  .section-title { font-size: 26px; }
}

/* Секция конвертера (главная) — заголовок «Выберите валютную пару»
   должен быть того же размера, что H1 на страницах пар */
.section-converter { margin-top: 0; margin-bottom: 48px; }
.section-converter .section-title {
  font-size: 30px;
  line-height: 1.08;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

@media (min-width: 640px) {
  .section-converter .section-title { font-size: 40px; }
}

@media (min-width: 960px) {
  .section-converter .section-title { font-size: 52px; }
}

/* -----------------------------------------------------------
   Форма конвертера (знак = вместо swap)
   ----------------------------------------------------------- */
.converter {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.conv-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.conv-field {
  display: block;
  min-width: 0;
  width: 100%;
}
.conv-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 700;
}

.conv-input-wrap {
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--t);
  height: 56px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.conv-input-wrap:focus-within { border-color: var(--text); }

.conv-amount {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  padding: 0 14px;
  background: transparent;
  border: none;
  outline: none;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.conv-amount:read-only {
  color: var(--text);
  background: transparent;
}

.select-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  min-width: 108px;
  border-left: 1px solid var(--border);
  background: transparent;
  transition: background var(--t);
}
.select-wrap:hover { background: var(--bg-soft); }

.select-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 32px 0 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  z-index: 1;
  transition: color var(--t);
}
.select-wrap:hover .select-arrow { color: var(--text); }

.conv-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  min-width: 0;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px;
}
.conv-select option {
  background: #000;
  color: var(--text);
  padding: 8px;
}

.conv-code {
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: transparent;
  border-left: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Кнопка "скопировать сумму" — между полем ввода и кодом валюты */
.conv-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--t);
  padding: 0;
  position: relative;
}
.conv-copy:hover { color: var(--text); }
.conv-copy:active { transform: scale(0.92); }
.conv-copy.is-copied { color: var(--positive); }
.conv-copy.is-copied::after {
  content: 'скопировано';
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--positive);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: fx-copied-fade 1.4s ease forwards;
}
@keyframes fx-copied-fade {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* Круглая swap-кнопка со знаком = внутри (кликабельная) */
.conv-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  padding: 0;
  transition: color var(--t), border-color var(--t);
  flex-shrink: 0;
  user-select: none;
}
.conv-swap:hover {
  color: var(--text);
  border-color: var(--text);
}
.conv-swap:active {
  transform: scale(0.96);
}

.conv-footer {
  margin-top: 18px;
  text-align: right;
}
.conv-more-link {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--text-faint);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--t);
}
.conv-more-link:hover {
  opacity: 1;
  text-decoration-color: var(--text);
}

@media (min-width: 720px) {
  .conv-row {
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: end;
  }
  .conv-swap { align-self: end; }
}

/* -----------------------------------------------------------
   Популярные пары
   ----------------------------------------------------------- */
.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.pair-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--t);
}
.pair-card:hover { border-color: var(--border-hover); opacity: 1; }

.pair-flags {
  display: flex;
  position: relative;
  width: 52px;
  height: 32px;
  flex-shrink: 0;
}
.pair-flags img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
}
.pair-flags img:first-child { position: absolute; left: 0; z-index: 1; }
.pair-flags img:last-child  { position: absolute; left: 20px; }

.pair-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pair-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.pair-codes {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pair-rate {
  font-size: 17px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pair-change {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* -----------------------------------------------------------
   Матрица
   ----------------------------------------------------------- */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 720px;
}
.matrix th, .matrix td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.matrix th:last-child, .matrix td:last-child { border-right: none; }
.matrix tbody tr:last-child td,
.matrix tbody tr:last-child th { border-bottom: none; }

.matrix-corner {
  background: var(--bg);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 110px;
  width: 110px;
}
.matrix-col, .matrix-row {
  font-weight: 700;
  font-size: 13px;
}
.matrix-row {
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 2;
  min-width: 110px;
  width: 110px;
}
.matrix-self { color: var(--text-faint); background: transparent; }
.matrix-cell { padding: 0; }
.matrix-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.matrix-head img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.matrix-link {
  display: block;
  padding: 12px 10px;
  color: var(--text);
  font-size: 13px;
  transition: background var(--t);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.matrix-link:hover { background: var(--bg-soft); opacity: 1; }

/* -----------------------------------------------------------
   Hero страницы пары
   ----------------------------------------------------------- */
.pair-hero {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
}

.pair-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 720px) {
  .pair-hero-grid {
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
  }
}

.pair-hero-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pair-hero-flags {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pair-hero-flags img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.pair-hero-arrow {
  color: var(--text-dim);
  font-size: 32px;
  line-height: 1;
}

.pair-hero-change {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pair-hero-change-label {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
}

@media (min-width: 640px) {
  .pair-hero-flags img { width: 80px; height: 80px; }
  .pair-hero-arrow { font-size: 40px; }
  .pair-hero-change { font-size: 28px; }
  .pair-hero-change-label { font-size: 15px; }
}

@media (min-width: 960px) {
  .pair-hero-flags img { width: 88px; height: 88px; }
  .pair-hero-change { font-size: 32px; }
  .pair-hero-change-label { font-size: 16px; }
}

.pair-hero-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.pair-hero-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.pair-hero-prefix {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pair-hero-sep { color: var(--text-dim); font-size: 24px; font-weight: 400; }
.pair-hero-big {
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pair-hero-code {
  font-size: 22px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pair-hero-reverse-link {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-muted);
  font-size: 22px;
  font-weight: 700;
  padding: 4px 0;
  transition: color var(--t);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.pair-hero-reverse-link:hover { color: var(--text); opacity: 1; }
.pair-reverse-sep { color: var(--text-faint); font-weight: 400; }
.pair-reverse-arrow {
  font-size: 16px;
  margin-left: 4px;
  color: var(--text-dim);
  font-weight: 400;
}

@media (min-width: 720px) {
  .pair-hero-right {
    align-items: flex-end;
    gap: 16px;
  }
  .pair-hero-value { justify-content: flex-end; }
}

@media (min-width: 640px) {
  .pair-hero { padding: 36px 32px; }
  .pair-hero-big { font-size: 60px; }
  .pair-hero-code { font-size: 28px; }
  .pair-hero-reverse-link { font-size: 26px; }
  .pair-hero-prefix { font-size: 18px; }
}

@media (min-width: 960px) {
  .pair-hero { padding: 44px 40px; }
  .pair-hero-big { font-size: 76px; }
  .pair-hero-code { font-size: 32px; }
  .pair-hero-reverse-link { font-size: 30px; }
  .pair-hero-prefix { font-size: 20px; }
}

/* -----------------------------------------------------------
   График
   ----------------------------------------------------------- */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.chart-range {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.chart-range-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 5px;
  transition: all var(--t);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.chart-range-btn:hover { color: var(--text); }
.chart-range-btn.active { background: var(--text); color: var(--bg); }
.chart-container {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: 360px;
  position: relative;
}
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* -----------------------------------------------------------
   Суммы — ГИБКИЙ flex layout, ничего не вылезает
   ----------------------------------------------------------- */
.amounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.amount-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 16px;
  padding: 14px 18px;
  background: transparent;
  color: var(--text);
  transition: background var(--t);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.amounts-grid > :last-child { border-bottom: none; }

a.amount-row:hover { background: var(--bg-soft); color: var(--text); opacity: 1; }
.amount-row.is-current { background: var(--bg-soft); }
.amount-row.is-current .amount-to { color: var(--text); font-weight: 800; }

.amount-left, .amount-right {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.amount-right {
  justify-content: flex-end;
  margin-left: auto;
}

.amount-from { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.amount-from-word { color: var(--text-muted); font-size: 13px; }
.amount-eq { color: var(--text-dim); font-weight: 400; }
.amount-to { font-weight: 800; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.amount-to-code { color: var(--text-dim); font-size: 12px; font-weight: 700; }

@media (min-width: 640px) {
  .amounts-grid { grid-template-columns: repeat(2, 1fr); }
  .amounts-grid > * { border-right: 1px solid var(--border); }
  .amounts-grid > *:nth-child(2n) { border-right: none; }
}

/* 3 колонки только на широких экранах — чтобы длинные названия не вылезали */
@media (min-width: 1200px) {
  .amounts-grid { grid-template-columns: repeat(3, 1fr); }
  .amounts-grid > * { border-right: 1px solid var(--border); }
  .amounts-grid > *:nth-child(2n) { border-right: 1px solid var(--border); }
  .amounts-grid > *:nth-child(3n) { border-right: none; }
}

/* -----------------------------------------------------------
   Hero суммовой страницы
   ----------------------------------------------------------- */
.amount-hero {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
}

.amount-hero-block {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.amount-hero-from, .amount-hero-to { text-align: center; }
.amount-hero-flag { margin-bottom: 12px; }
.amount-hero-flag img {
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
}
.amount-hero-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 6px;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.amount-hero-word { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.amount-hero-eq { font-size: 28px; color: var(--text-dim); font-weight: 400; }

.amount-rate-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-weight: 500;
}

@media (min-width: 640px) {
  .amount-hero { padding: 36px 32px; }
  .amount-hero-value { font-size: 36px; }
  .amount-hero-eq { font-size: 32px; }
}
@media (min-width: 800px) {
  .amount-hero-value { font-size: 44px; }
}

/* -----------------------------------------------------------
   Та же сумма в других валютах
   ----------------------------------------------------------- */
.same-amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.same-amount-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--t);
}
.same-amount-link:hover { border-color: var(--border-hover); opacity: 1; }
.same-amount-link img { border-radius: 50%; flex-shrink: 0; }
.same-amount-info {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}
.same-amount-info .mono { color: var(--text-muted); font-size: 13px; }

/* -----------------------------------------------------------
   Навигация
   ----------------------------------------------------------- */
.section-nav { margin-top: 32px; }
.nav-group { display: grid; grid-template-columns: 1fr; gap: 10px; }
.nav-link {
  padding: 14px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  transition: all var(--t);
  font-weight: 500;
}
.nav-link:hover { color: var(--text); border-color: var(--border-hover); opacity: 1; }
.nav-center { font-weight: 800; color: var(--text); }

@media (min-width: 640px) {
  .nav-group { grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; }
  .nav-prev { text-align: left; }
  .nav-next { text-align: right; }
}

/* -----------------------------------------------------------
   Связанные пары
   ----------------------------------------------------------- */
.related-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all var(--t);
}
.related-link:hover { color: var(--text); border-color: var(--border-hover); opacity: 1; }
.related-link img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

/* -----------------------------------------------------------
   Сетка валют
   ----------------------------------------------------------- */
.currencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.currency-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--t);
  min-width: 0;
}
.currency-card:hover { border-color: var(--border-hover); opacity: 1; }
.currency-card-flag {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.currency-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.currency-card-top,
.currency-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.currency-card-code {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.currency-card-rate {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.currency-card-rate-unit {
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 2px;
}
.currency-card-name {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.currency-card-change {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}

/* -----------------------------------------------------------
   SEO-текст
   ----------------------------------------------------------- */
.section-text { /* max-width убран — заголовок на всю ширину */ }
.section-text h2 {
  font-size: 24px;
  margin-bottom: 18px;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.section-text h3 {
  font-size: 17px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
  max-width: 820px;
}
.section-text p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 16px;
  max-width: 820px;
}
.section-text strong { color: var(--text); font-weight: 700; }
.section-text .lead { font-size: 16px; color: var(--text); }
.section-text a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text-faint); text-underline-offset: 3px; }
.section-text a:hover { text-decoration-color: var(--text); opacity: 1; }

.section-text ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 20px;
  max-width: 820px;
}
.section-text ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
.section-text ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 8px;
  height: 1.5px;
  background: var(--text);
}

@media (min-width: 640px) {
  .section-text h2 { font-size: 30px; }
}

/* -----------------------------------------------------------
   Дисклеймер с email
   ----------------------------------------------------------- */
.disclaimer {
  margin-top: 32px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
}
.disclaimer a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-faint);
  text-underline-offset: 3px;
}
.disclaimer a:hover { text-decoration-color: var(--text); opacity: 1; }

/* -----------------------------------------------------------
   404
   ----------------------------------------------------------- */
.error-page {
  text-align: center;
  padding: 60px 16px;
  max-width: 600px;
  margin: 0 auto;
}
.error-code {
  font-size: 96px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.08em;
  margin-bottom: 12px;
}
.error-title { font-size: 24px; margin-bottom: 12px; font-weight: 800; }
.error-text { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }
.error-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  transition: all var(--t);
  border: 1px solid transparent;
  letter-spacing: -0.02em;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { opacity: 0.85; color: var(--bg); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text); color: var(--text); opacity: 1; }

.error-popular { text-align: left; }
.error-popular h2 {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0;
}
.error-popular .related-pairs { justify-content: center; }
