:root {
  --bg: #f4f6f9;
  --bg-soft: #eef2f6;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(21, 39, 64, 0.09);
  --line-strong: rgba(21, 39, 64, 0.16);
  --text: #162235;
  --muted: #66758a;
  --accent: #3d73c9;
  --accent-deep: #234b95;
  --positive: #1f8a52;
  --negative: #bc4b4b;
  --shadow: 0 10px 24px rgba(17, 35, 58, 0.06);
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --max-width: 1360px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(83, 117, 174, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #f2f5f8 52%, #edf1f5 100%);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 0;
}

.topbar,
.ad-slot-before-header,
.layout {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.topbar-main,
.topbar-menu {
  display: flex;
  align-items: center;
}

.topbar-main {
  flex-shrink: 0;
}

.topbar-menu {
  flex: 1;
  justify-content: space-between;
  gap: 16px;
}

.topbar-menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.topbar-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.topbar-menu-button span {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

.topbar-menu-button span:nth-child(1) {
  transform: translateY(-6px);
}

.topbar-menu-button span:nth-child(3) {
  transform: translateY(6px);
}

.topbar-menu-toggle:checked ~ .topbar-main .topbar-menu-button span:nth-child(1) {
  transform: rotate(45deg);
}

.topbar-menu-toggle:checked ~ .topbar-main .topbar-menu-button span:nth-child(2) {
  opacity: 0;
}

.topbar-menu-toggle:checked ~ .topbar-main .topbar-menu-button span:nth-child(3) {
  transform: rotate(-45deg);
}

.brand-group,
.topbar-tools,
.topnav,
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  gap: 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.topnav-right {
  flex-wrap: nowrap;
  margin-left: auto;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #21457f, #3f77cf);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-text {
  font-size: 1rem;
}

.brand-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  display: block;
}

.topnav a,
.market-chip,
.ghost-button,
.period,
.quick-values button {
  transition: 180ms ease;
}

.topnav a {
  color: var(--muted);
  font-size: 0.88rem;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
}

.market-chip,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(61, 115, 201, 0.06);
  color: var(--accent-deep);
  font-size: 0.78rem;
}

.pill.positive {
  background: rgba(31, 138, 82, 0.08);
  color: var(--positive);
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: rgba(61, 115, 201, 0.34);
  background: rgba(61, 115, 201, 0.06);
}

.layout {
  display: grid;
  gap: 18px;
}

.market-tape {
  width: min(100%, var(--max-width));
  margin: 0 auto 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #eef3f8 0%, #f4f7fb 100%);
  box-shadow: 0 10px 24px rgba(17, 35, 58, 0.05);
  cursor: grab;
  scrollbar-width: none;
  touch-action: pan-y;
  user-select: none;
}

.market-tape::-webkit-scrollbar {
  display: none;
}

.market-tape.is-dragging {
  cursor: grabbing;
}

.market-tape-track {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
}

.market-tape-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 108px;
  min-height: 31px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.92);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-drag: none;
  user-drag: none;
}

.market-tape-symbol {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.market-tape-change {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-align: right;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.ticker-hero-composition {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: stretch;
  padding: 22px;
}

.ticker-hero-heading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cbrf-header-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.cbrf-header-link:hover {
  background: var(--accent);
  color: #fff;
}

.ticker-hero-composition > .calculator-panel {
  align-self: stretch;
  height: 100%;
}

.ticker-hero-composition .ticker-page-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ticker-hero-main {
  display: grid;
  gap: 16px;
  align-content: stretch;
  align-self: stretch;
}

.ticker-hero-main > .ticker-page-card,
.ticker-hero-main .ticker-rate-panel {
  height: 100%;
}

.cbrf-pivot-section {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.cbrf-tools-composition {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: stretch;
}

.cbrf-tools-composition > .compact-panel {
  align-self: stretch;
  height: 100%;
}

.main-column {
  container-type: inline-size;
}

.main-column,
.sidebar-column {
  display: grid;
  gap: 18px;
}

.column-shell {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-xl) + 2px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 250, 253, 0.9));
  box-shadow: var(--shadow);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 254, 0.98));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.hero-main,
.mini-panel,
.sidebar-panel,
.chart-section,
.dynamics-section,
.quotes-section,
.converter-card,
.context-card,
.cb-section,
.faq-section {
  display: grid;
  gap: 14px;
}

.eyebrow,
.section-kicker,
.label,
.breadcrumbs {
  color: var(--muted);
}

.eyebrow,
.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  max-width: none;
  font-size: clamp(1.9rem, 2.6vw, 2.7rem);
  line-height: 1;
  white-space: nowrap;
}

h2 {
  font-size: clamp(1.25rem, 1.6vw, 1.7rem);
  line-height: 1.05;
}

.hero-copy,
.section-copy,
.data-card p,
.cb-card p,
.faq-list p {
  margin: 0;
  color: #536175;
  line-height: 1.5;
  font-size: 0.92rem;
}

.hero-stats {
  display: grid;
  gap: 12px;
}

.hero-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 2px;
}

.hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 2px;
}

.headline-stat {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, #f7faff, #eef3f8);
  border: 1px solid var(--line);
  min-height: 108px;
  align-content: start;
}

.headline-value {
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 2.7vw, 2.7rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.headline-value-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.headline-arrow {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(31, 138, 82, 0.12);
  color: var(--positive);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.headline-arrow.positive {
  background: rgba(31, 138, 82, 0.12);
  color: var(--positive);
}

.headline-arrow.negative {
  background: rgba(188, 75, 75, 0.12);
  color: var(--negative);
}

.headline-arrow.neutral {
  background: rgba(21, 39, 64, 0.08);
  color: var(--text);
}

.headline-unit,
.delta {
  font-size: 0.8rem;
}

.headline-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.headline-metric {
  display: grid;
  gap: 5px;
}

.headline-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(61, 115, 201, 0.08);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.headline-metric strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.headline-metric.positive strong {
  color: var(--positive);
}

.headline-metric.negative strong {
  color: var(--negative);
}

.indicator-arrow {
  margin-right: 3px;
  font-size: 0.85em;
  opacity: 0.85;
}

.delta.positive,
.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--text);
}

.stat-grid,
.data-grid,
.cb-grid {
  display: grid;
  gap: 10px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid div,
.data-card,
.mini-panel,
.cb-card {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(247, 250, 253, 0.9);
  border: 1px solid var(--line);
}

.stat-grid strong,
.data-card strong,
.cb-card strong,
.sidebar-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.mini-panel-head,
.signal-list li,
.watchlist li,
.section-heading,
.converter,
.quick-values,
.converter-result {
  display: flex;
}

.mini-panel-head,
.section-heading {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mini-panel-head h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

.signal-list,
.watchlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.signal-list li,
.watchlist li {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.signal-list li:first-child,
.watchlist li:first-child {
  padding-top: 0;
  border-top: 0;
}

.sidebar-panel {
  padding: 14px 16px;
}

.compact-panel {
  padding: 14px;
}

.calculator-panel {
  min-height: 108px;
  align-content: start;
}

.related-panel {
  gap: 10px;
}

.pair-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pair-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.pair-link:hover,
.pair-link:focus-visible {
  border-color: rgba(61, 115, 201, 0.36);
  background: rgba(61, 115, 201, 0.06);
  color: var(--text);
}

.pair-links-vertical {
  display: grid;
  gap: 10px;
}

.pair-links-vertical .pair-link {
  width: 100%;
  justify-content: flex-start;
}

.chart-section,
.dynamics-section,
.quotes-section,
.converter-card,
.context-card,
.cb-section,
.faq-section,
.seo-brief {
  padding: 18px;
}

.periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period,
.quick-values button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.period:hover,
.period:focus-visible,
.quick-values button:hover,
.quick-values button:focus-visible,
.period.is-active {
  color: var(--text);
  border-color: rgba(61, 115, 201, 0.4);
  background: rgba(61, 115, 201, 0.08);
}

.chart-frame {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #f7f9fc, #eff4f9);
  border: 1px solid var(--line);
}

.chart-frame img {
  width: 100%;
  border-radius: 6px;
}

.chart-frame figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-expand-button {
  font-size: 0.92rem;
  font-weight: 700;
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 31, 0.56);
  backdrop-filter: blur(4px);
}

.chart-modal-dialog {
  position: relative;
  width: min(95vw, 1560px);
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(12, 24, 40, 0.22);
  overflow: auto;
}

.chart-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-modal-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.chart-modal-close:hover,
.chart-modal-close:focus-visible {
  border-color: rgba(61, 115, 201, 0.36);
  background: rgba(61, 115, 201, 0.06);
}

.chart-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.chart-frame-modal {
  min-height: 100%;
}

.ad-slot-modal-wide {
  min-height: auto;
}

.sidebar-metrics {
  display: grid;
  gap: 8px;
}

.sidebar-metric {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.sidebar-metric:first-child {
  padding-top: 0;
  border-top: 0;
}

.converter-compact {
  align-items: end;
  gap: 10px;
}

.field-compact {
  flex: 1 1 108px;
}

.field-compact input {
  min-height: 40px;
}

.swap-button {
  align-self: center;
  min-width: 60px;
  width: auto;
  min-height: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-deep);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.swap-button:hover,
.swap-button:focus-visible {
  border-color: rgba(61, 115, 201, 0.36);
  background: rgba(61, 115, 201, 0.06);
  color: var(--text);
}

.swap-button.active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #ffffff;
}

.rate-switcher {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
}

.converter-result-compact {
  min-width: 148px;
  min-height: 40px;
  padding: 0 12px;
}

.converter-result-compact strong {
  font-size: 1.18rem;
}

.compact-list li {
  padding-top: 10px;
}

.insights,
.converter-and-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.insights > .card {
  display: grid;
  gap: 20px;
  padding: 28px;
}

.quote-groups {
  display: grid;
  gap: 14px;
}

.quote-group {
  display: grid;
  gap: 8px;
}

.quote-group h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-card.featured {
  background:
    linear-gradient(145deg, #f8fbff, #edf4fb);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
}

.quote-table {
  border-radius: 6px;
}

.quote-table table {
  width: 100%;
  table-layout: fixed;
}

.quote-col-type {
  width: 18%;
}

.quote-col-rate,
.quote-col-diff,
.quote-col-change {
  width: 11%;
}

.quote-col-change-percent {
  width: 12%;
}

.quote-col-time {
  width: 15%;
}

.quote-table th,
.quote-table td {
  text-align: right;
  white-space: nowrap;
}

.quote-table th:first-child,
.quote-table td:first-child {
  text-align: left;
}

.quote-table td:not(.instrument):not(:last-child) {
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.84rem;
}

thead {
  background: #f3f6fa;
}

th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

tbody tr + tr {
  border-top: 1px solid var(--line);
}

td.quote-cell-flash-up {
  background: rgba(31, 138, 82, 0.11);
}

td.quote-cell-flash-down {
  background: rgba(188, 75, 75, 0.11);
}

td.quote-cell-flash-up,
td.quote-cell-flash-down {
  transition: background-color 160ms ease;
}

.instrument {
  color: var(--accent-deep);
  font-weight: 700;
  white-space: nowrap;
}

.quote-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.seo-brief {
  display: grid;
  gap: 12px;
}

.news-feed {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.news-feed .section-heading > div {
  display: grid;
  gap: 6px;
}

.news-feed h2 {
  line-height: 1.12;
  font-size: 1.15rem;
}

.news-list {
  display: grid;
  gap: 2px;
}

.news-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.news-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.news-bullet {
  width: 6px;
  height: 6px;
  background: var(--primary, #0066cc);
  border-radius: 50%;
  flex-shrink: 0;
}

.news-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.news-title {
  font-size: 0.9rem;
  line-height: 1.4;
  min-width: 0;
  font-weight: 450;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
}

.news-time {
  font-size: 0.78rem;
  color: var(--text-secondary, #666);
  font-weight: 400;
  flex-shrink: 0;
}

.news-time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  text-align: right;
  padding-left: 12px;
}

.faq-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.ad-slot {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px dashed rgba(61, 115, 201, 0.28);
  border-radius: var(--radius-lg);
  background: #f9fbfd;
  color: var(--muted);
  text-align: center;
}

.yandex-rtb-slot {
  overflow: hidden;
}

.yandex-rtb-container {
  width: 100%;
  min-height: 90px;
}

.ad-slot-before-header {
  width: min(100%, var(--max-width));
  margin-bottom: 12px;
  min-height: 90px;
}

.ad-slot-main-flow {
  min-height: 90px;
}

.ad-slot-mobile-only {
  display: none;
}

.ad-slot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(21, 39, 64, 0.08);
  background: #ffffff;
}

.ad-slot span {
  font-size: 0.78rem;
}

.ad-caption {
  color: var(--muted);
  line-height: 1.35;
}

.ad-slot-horizontal {
  min-height: auto;
}

.ad-slot-topwide {
  min-height: auto;
}

.ad-slot-billboard {
  min-height: auto;
}

.ad-slot-rect {
  min-height: 250px;
}

.sidebar-column .ad-slot {
  padding: 0;
  overflow: hidden;
}

.sidebar-column .ad-slot > div {
  max-width: 100%;
}

.ad-slot-vertical {
  min-height: 400px;
}

.ad-slot-skyscraper {
  min-height: 600px;
}

.converter {
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  flex: 1 1 220px;
}

.field span {
  color: var(--muted);
  font-size: 0.8rem;
}

.field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.field input:focus {
  outline: 2px solid rgba(61, 115, 201, 0.16);
  border-color: rgba(61, 115, 201, 0.42);
}

.converter-result {
    justify-content: center;
    min-height: 42px;
    min-width: 190px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(31, 138, 82, 0.16);
    background: rgba(31, 138, 82, 0.05);
}

.converter-result span {
    color: var(--muted);
    font-size: 0.76rem;
}

.converter-result strong {
    font-size: 1.45rem;
    font-weight: 700;
    white-space: nowrap;
    line-height:1;
}

.quick-values {
  gap: 8px;
  flex-wrap: wrap;
}

.cb-grid {
  grid-template-columns: 1fr 1fr 1.5fr;
}

.cb-grid.compact {
  grid-template-columns: 1fr;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfcfe;
  height: 100%;
  overflow: hidden;
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  font-size: 0.88rem;
  padding: 12px 14px;
}

.faq-inline details summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 1rem;
  line-height: 1;
}

.faq-inline details[open] summary::after {
  content: "−";
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list details p {
  margin: 0;
  padding: 0 14px 12px;
}

.site-footer {
  width: min(100%, var(--max-width));
  margin: auto auto 0;
  padding-top: 22px;
  color: var(--muted);
}

.site-footer-legacy {
  text-align: center;
  margin-bottom: 10px;
  font-size: 0.84rem;
}

.site-footer-legacy a,
.site-footer-link {
  color: var(--accent-deep);
}

.site-footer-legacy a:hover,
.site-footer-legacy a:focus-visible,
.site-footer-link:hover,
.site-footer-link:focus-visible {
  color: var(--text);
}

.site-footer-panel {
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 252, 0.94));
  box-shadow: var(--shadow);
}

.site-footer-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, 1fr)) minmax(260px, 1.35fr);
  gap: 18px;
  padding: 22px 24px;
}

.site-footer-col {
  display: grid;
  gap: 8px;
  align-content: start;
}

.site-footer-col h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 0.92rem;
  line-height: 1.2;
}

.site-footer-link {
  width: fit-content;
  font-size: 0.86rem;
  line-height: 1.25;
}

.site-footer-about {
  gap: 12px;
}

.site-footer-logo {
  width: fit-content;
}

.site-footer-logo img {
  width: 123px;
  height: auto;
}

.site-footer-info {
  max-width: 420px;
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  .content-grid,
  .ticker-hero-composition,
  .cbrf-tools-composition,
  .insights,
  .converter-and-context,
   .cb-grid,
   .stat-grid,
   .hero-dashboard,
   .faq-inline,
     .chart-modal-grid {
     grid-template-columns: 1fr;
   }

  .site-footer-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    border-radius: 12px;
  }

  .column-shell {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .market-tape {
    width: min(100%, var(--max-width));
    margin: 0 auto 14px;
  }

  .ticker-hero-composition > .calculator-panel {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding: 12px 12px 0;
  }

  .ad-slot-desktop-only {
    display: none;
  }

  .topbar,
  .hero,
  .sidebar-panel,
  .chart-section,
  .dynamics-section,
  .quotes-section,
  .converter-card,
  .context-card,
  .cb-section,
  .faq-section,
  .seo-brief,
  .news-feed {
    padding: 16px;
  }

  .topbar,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    align-items: stretch;
    gap: 0;
  }

  .topbar-main {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .topbar-menu-button {
    display: inline-flex;
    position: relative;
  }

  .topbar-menu {
    display: none;
    width: 100%;
    padding-top: 14px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-menu-toggle:checked ~ .topbar-menu {
    display: flex;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .topbar-menu .topnav {
    gap: 8px;
  }

  .topbar-menu .topnav a {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(61, 115, 201, 0.05);
  }

  .topnav-right {
    margin-left: 0;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .site-footer-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 18px;
  }

  .site-footer-about {
    grid-column: 1 / -1;
  }

  .headline-value {
    font-size: 3rem;
  }
}

@container (max-width: 560px) {
  .ad-slot-wide-only {
    display: none;
  }

  .ad-slot-mobile-only {
    display: grid;
  }
}

@media (max-width: 560px) {
  .quote-col-rate:nth-of-type(2),
  .quote-col-rate:nth-of-type(3),
  .quote-col-diff {
    display: none;
  }

  .quote-col-type {
    width: 31%;
  }

  .quote-col-rate,
  .quote-col-change,
  .quote-col-change-percent {
    width: 17%;
  }

  .quote-col-time {
    width: 18%;
  }

  .quote-table th:nth-child(2),
  .quote-table td:nth-child(2),
  .quote-table th:nth-child(3),
  .quote-table td:nth-child(3),
  .quote-table th:nth-child(5),
  .quote-table td:nth-child(5) {
    display: none;
  }

  h1 {
    font-size: 2.1rem;
    white-space: normal;
  }

  .headline-value {
    font-size: 2.3rem;
  }

  .headline-metrics {
    gap: 6px;
  }

  .headline-metric-label {
    font-size: 0.7rem;
  }

  .headline-metric strong {
    font-size: 0.85rem;
  }

  .metric-icon {
    width: 14px;
  }

  .topbar {
    margin-bottom:0;
  }

  .brand-logo {
    height: 46px;
  }

  .site-footer {
    padding-top: 16px;
  }

  .site-footer-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 16px;
  }

  .site-footer-col {
    min-width: 0;
  }

  .site-footer-col h3 {
    font-size: 0.82rem;
  }

  .site-footer-link {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .site-footer-about {
    grid-column: 1 / -1;
    gap: 10px;
  }

  .site-footer-info {
    max-width: none;
  }

  .page-shell,
  .column-shell {
    padding:0 2px;
  }

  .main-column > .card,
  .main-column > .ad-slot,
  .main-column > .ad-slot-main-flow {
    padding: 10px;
  }

  .ticker-hero-composition {
    padding: 10px;
  }

  th,
  td {
    padding: 9px 10px;
  }
}
