:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-tint: #eef4ff;
  --ink: #16202d;
  --muted: #667085;
  --line: #d8e0ea;
  --line-strong: #bfccd9;
  --accent: #1d4ed8;
  --accent-strong: #143b8f;
  --good: #067647;
  --good-bg: #e8f6ee;
  --bad: #b42318;
  --bad-bg: #fff0ee;
  --warn: #946200;
  --warn-bg: #fff5d6;
  --shadow: 0 10px 28px rgba(20, 43, 72, 0.08);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-display: 34px;
  --fs-num-table: 15px;
  --fs-num-card: 24px;
  --fs-num-hero: 32px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 650;
  --fw-bold: 750;
  --fw-heavy: 800;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #121926;
  color: #fff;
  font-weight: var(--fw-heavy);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.brand small {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.source-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

body:not([data-page-type="currency"]) .currency-detail-section,
body:not([data-page-type="methodology"]) .methodology-section {
  display: none;
}

body[data-page-type="methodology"] .terminal-currency,
body[data-page-type="methodology"] .decision-grid,
body[data-page-type="methodology"] .terminal-body,
body[data-page-type="methodology"] .summary-section,
body[data-page-type="methodology"] .history-section,
body[data-page-type="methodology"] .market-section,
body[data-page-type="methodology"] .growth-section,
body[data-page-type="methodology"] .official-section,
body[data-page-type="methodology"] .seo-block {
  display: none;
}

.status-pill,
.demo-note,
.rate-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.status-loading {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-live {
  background: var(--good-bg);
  color: var(--good);
}

.status-fallback {
  background: var(--bad-bg);
  color: var(--bad);
}

.demo-note,
.rate-chip {
  background: var(--surface-soft);
  color: var(--muted);
}

.terminal,
.summary-section,
.currency-detail-section,
.methodology-section,
.history-section,
.market-section,
.growth-section,
.official-section,
.seo-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.terminal {
  padding: 20px;
}

.terminal-head,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading.tight {
  align-items: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: var(--fw-heavy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  font-weight: var(--fw-bold);
}

h1 {
  max-width: 760px;
  font-size: var(--fs-display);
  line-height: 1.1;
}

h2 {
  font-size: var(--fs-xl);
  line-height: 1.18;
}

.terminal-currency {
  display: grid;
  gap: 7px;
  min-width: 150px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  padding: 0 13px;
}

select {
  padding: 0 34px 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.decision-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}

.decision-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.decision-card.primary {
  background: #f0f9f4;
  border-color: #b9e4cb;
}

.card-label,
.decision-card small,
.metric small,
.trust-grid span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
}

.decision-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.decision-card strong span {
  min-width: 0;
}

.decision-card b {
  display: block;
  margin-top: 6px;
  color: var(--good);
  font-size: var(--fs-num-hero);
  font-weight: var(--fw-heavy);
  line-height: 1.05;
}

.decision-card small {
  display: block;
  margin-top: 14px;
  line-height: 1.35;
}

.terminal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 12px;
  margin-top: 12px;
}

.breadcrumbs {
  display: flex;
  gap: 7px;
  align-items: center;
  max-width: 1180px;
  margin: 12px auto -2px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent-strong);
}

.deal-panel,
.trust-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented,
.sortbar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment,
.sort-button,
.filter-toggle,
.quick-amounts button,
.favorite-button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.segment {
  padding: 0 12px;
}

.sort-button {
  padding: 0 13px;
}

.filter-toggle,
.quick-amounts button,
.favorite-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: var(--fw-bold);
}

.filter-toggle {
  align-self: end;
  min-height: 42px;
  padding: 8px 12px;
  white-space: nowrap;
}

.favorite-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  line-height: 1;
}

.segment.active,
.sort-button.active {
  background: var(--ink);
  color: #fff;
}

.filter-toggle[aria-pressed="true"],
.favorite-button[aria-pressed="true"] {
  border-color: #b9e4cb;
  background: var(--good-bg);
  color: var(--good);
}

.quick-amounts button.active {
  border-color: var(--accent);
  background: var(--surface-tint);
  color: var(--accent-strong);
}

.favorite-button:focus-visible,
.filter-toggle:focus-visible,
.quick-amounts button:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.24);
  outline-offset: 2px;
}

.deal-mode-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.deal-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(110px, 0.45fr) minmax(190px, 1fr);
  gap: 12px;
}

.field,
.search-control {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

.bank-select {
  min-width: 0;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.quick-amounts button {
  min-height: 32px;
  padding: 6px 10px;
}

.deal-result {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.deal-result-main {
  padding: 15px;
}

.deal-result-main span,
.deal-deltas span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.deal-result-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.deal-result-main strong span {
  color: var(--ink);
  font-size: inherit;
}

.deal-result-main b {
  display: block;
  margin-top: 5px;
  color: var(--good);
  font-size: var(--fs-num-card);
  font-weight: var(--fw-heavy);
  line-height: 1.1;
}

.deal-deltas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.deal-deltas span {
  padding: 12px;
  background: #fff;
}

.deal-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.deal-result-meta span {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.deal-freshness-warning {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--warn);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trust-grid div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.trust-grid b {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: 1.15;
}

.server-hint {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #f6d58f;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
  line-height: 1.45;
}

.source-summary {
  margin: 12px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.source-summary.good {
  border-color: #b9e4cb;
  background: #f0f9f4;
  color: #197547;
}

.source-summary.warn {
  border-color: #f6d58f;
  background: var(--warn-bg);
  color: var(--warn);
}

.summary-section,
.currency-detail-section,
.methodology-section,
.history-section,
.market-section,
.growth-section,
.official-section,
.seo-block {
  margin-top: 14px;
  padding: 20px;
}

.rate-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.section-copy {
  max-width: 780px;
  margin: -4px 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.currency-highlights,
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.currency-highlight,
.methodology-grid article {
  min-height: 110px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.currency-highlight span,
.methodology-grid p,
.top-bank-row span,
.mini-history-row span,
.faq-item p,
.methodology-status,
.methodology-source-row span {
  color: var(--muted);
}

.currency-highlight strong,
.methodology-grid strong {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: 1.15;
}

.currency-highlight small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.currency-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 12px;
  margin-top: 14px;
}

.currency-tools-grid h3,
.methodology-live h3 {
  margin: 0 0 10px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.top-bank-list,
.mini-history,
.methodology-live {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.top-bank-row,
.mini-history-row,
.methodology-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.top-bank-row:last-child,
.mini-history-row:last-child,
.methodology-source-row:last-child {
  border-bottom: 0;
}

.top-bank-row strong,
.mini-history-row strong,
.methodology-source-row strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: var(--fw-bold);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.faq-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.faq-item strong {
  display: block;
  margin-bottom: 6px;
}

.faq-item p,
.methodology-grid p {
  margin: 0;
  line-height: 1.5;
}

.methodology-live {
  margin-top: 14px;
}

.methodology-status {
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.history-controls {
  grid-template-columns: minmax(110px, 135px) minmax(150px, 190px) minmax(130px, 160px);
}

.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
}

.history-collection {
  margin: -2px 0 12px;
}

.collection-status {
  display: inline-block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.collection-status.warn {
  color: #a64b00;
}

.history-chart-panel,
.history-rows {
  min-width: 0;
}

.history-chart-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.history-stats div {
  min-height: 86px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-stats span,
.history-stats small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.history-stats b {
  display: block;
  margin-top: 5px;
  font-size: var(--fs-num-card);
  font-weight: var(--fw-bold);
  line-height: 1.15;
}

.history-stats small {
  margin-top: 7px;
  font-weight: 700;
}

.history-chart {
  position: relative;
  min-height: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#e9eef5 1px, transparent 1px) 0 0 / 100% 33.333%,
    #fff;
  color: var(--accent-strong);
}

.history-chart svg {
  display: block;
  width: 100%;
  height: 150px;
}

.history-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.history-empty {
  display: grid;
  align-content: center;
  min-height: 164px;
  gap: 7px;
  color: var(--muted);
}

.history-empty strong {
  color: var(--ink);
  font-size: var(--fs-md);
}

.history-empty span {
  line-height: 1.45;
}

.history-rows {
  display: grid;
  align-content: start;
  gap: 8px;
}

.history-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-row div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-row strong {
  font-size: 14px;
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.history-row span {
  color: var(--muted);
  font-size: var(--fs-xs);
  text-align: right;
}

.history-row b {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

.rate-card,
.official-card,
.growth-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.rate-card {
  padding: 16px;
}

.rate-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.currency-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 76px;
  height: 46px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--accent-strong);
  font-weight: var(--fw-heavy);
}

.currency-code .currency-mark {
  box-shadow: none;
}

.rate-card h3 {
  margin: 14px 0 0;
  font-size: var(--fs-lg);
  line-height: 1.2;
}

.rate-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.metric {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.metric b {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-num-card);
  font-weight: var(--fw-heavy);
  line-height: 1.1;
}

.metric small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  text-transform: none;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  gap: 12px;
}

.market-section .controls {
  grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 0.8fr) auto auto;
  align-items: end;
}

.best-hint,
.source-health {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.source-health:empty {
  display: none;
}

.source-health-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.source-health-panel div {
  display: grid;
  gap: 4px;
}

.source-health-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

.source-health-panel b {
  font-size: var(--fs-num-card);
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

.source-health-panel p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.hint-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.hint-pill.good {
  background: var(--good-bg);
  color: var(--good);
}

.hint-pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.sortbar {
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f7f9fc;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.best-row {
  background: #fbfffd;
}

.stale-row {
  background: #fffaf1;
}

.bank-name {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.bank-icon,
.currency-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: var(--fs-xs);
  font-weight: var(--fw-heavy);
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.bank-icon {
  overflow: hidden;
  background: #fff;
  padding: 4px;
}

.bank-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bank-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.bank-icon-fallback[hidden] {
  display: none;
}

.bank-icon--compact,
.currency-mark--compact {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 10px;
}

.bank-icon--compact {
  padding: 3px;
}

.bank-icon--belarusbank,
.bank-icon--belapb,
.bank-icon--belveb,
.bank-icon--belinvestbank {
  background: #eef7f0;
  color: #147447;
}

.bank-icon--alfabank {
  background: #fff1f1;
  color: #c1121f;
}

.bank-icon--mtbank,
.bank-icon--bnb,
.bank-icon--bsb {
  background: #fff7e8;
  color: #a15c00;
}

.bank-icon--priorbank,
.bank-icon--sberbank,
.bank-icon--tcbank,
.bank-icon--neobank {
  background: #eaf7f4;
  color: #08766b;
}

.bank-icon--technobank,
.bank-icon--zepterbank,
.bank-icon--belincasgroup,
.bank-icon--paritetbank {
  background: #f1f3f8;
  color: #344054;
}

.currency-mark--USD {
  background: #edf7ee;
  color: #157347;
}

.currency-mark--EUR {
  background: #eef4ff;
  color: #2457c5;
}

.currency-mark--RUB {
  background: #fff4e5;
  color: #a15c00;
}

.currency-mark--BYN {
  background: #f1f3f8;
  color: #475467;
}

.currency-mark--CNY {
  background: #fff1f1;
  color: #b42318;
}

.currency-mark--GBP,
.currency-mark--CHF,
.currency-mark--PLN {
  background: #f4f1ff;
  color: #6941c6;
}

.currency-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.currency-label--compact {
  gap: 4px;
}

.bank-name strong {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.bank-name-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bank-name span,
.source-cell,
.delta-cell {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.bank-name-text > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.money {
  font-size: var(--fs-num-table);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.good-text {
  color: var(--good);
}

.bad-text {
  color: var(--bad);
}

.warn-text {
  color: var(--warn);
}

.decision-card b,
.deal-result-main b,
.deal-deltas b,
.trust-grid b,
.currency-highlight strong,
.history-stats b,
.history-row b,
.metric b,
.money,
.official-card b,
.source-health-panel b,
.mobile-rate-grid b,
.rate-chip,
.currency-code,
.currency-label {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "kern" 1;
}

.best-label {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--good-bg);
  color: var(--good);
  font-size: 11px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

.source-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.source-cell a {
  color: var(--accent-strong);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.source-cell a:hover {
  text-decoration: underline;
}

.demo-badge,
.live-badge,
.freshness-badge {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.demo-badge {
  background: var(--warn-bg);
  color: var(--warn);
}

.live-badge {
  background: var(--good-bg);
  color: var(--good);
}

.freshness-badge.current {
  background: var(--surface-soft);
  color: var(--muted);
}

.freshness-badge.aging {
  background: var(--warn-bg);
  color: var(--warn);
}

.freshness-badge.stale,
.freshness-badge.unknown {
  background: var(--bad-bg);
  color: var(--bad);
}

.freshness-badge.demo {
  background: var(--warn-bg);
  color: var(--warn);
}

.bank-cards-mobile {
  display: none;
}

.growth-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: start;
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.growth-grid article {
  padding: 14px;
}

.growth-grid strong,
.growth-grid span {
  display: block;
}

.growth-grid span,
.seo-block p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.official-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.official-card {
  min-height: 104px;
  padding: 14px;
}

.official-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.official-card strong span {
  display: inline;
  color: var(--ink);
  font-size: inherit;
  min-height: 0;
  margin: 0;
}

.official-card span {
  display: block;
  min-height: 36px;
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.official-card b {
  font-size: var(--fs-num-card);
  font-weight: var(--fw-heavy);
  line-height: 1.1;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .terminal-head,
  .section-heading,
  .growth-section {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .decision-grid,
  .terminal-body,
  .history-grid,
  .currency-tools-grid,
  .rate-cards,
  .official-grid {
    grid-template-columns: 1fr;
  }

  .deal-form,
  .currency-highlights,
  .methodology-grid,
  .faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bank-select {
    grid-column: 1 / -1;
  }

  .terminal-currency,
  .controls {
    width: 100%;
  }

  .market-section .controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-strip {
    justify-content: flex-start;
  }

  .terminal,
  .summary-section,
  .currency-detail-section,
  .methodology-section,
  .history-section,
  .market-section,
  .growth-section,
  .official-section,
  .seo-block {
    padding: 14px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  h2 {
    font-size: 20px;
  }

  .decision-card {
    min-height: 132px;
  }

  .decision-card b {
    font-size: 28px;
  }

  .deal-form,
  .deal-deltas,
  .currency-highlights,
  .methodology-grid,
  .faq-grid,
  .trust-grid,
  .history-stats,
  .rate-pair,
  .growth-grid {
    grid-template-columns: 1fr;
  }

  .history-chart {
    min-height: 170px;
  }

  .history-chart svg {
    height: 128px;
  }

  .history-row div {
    display: grid;
    gap: 4px;
  }

  .history-row span {
    text-align: left;
  }

  .segmented,
  .sortbar {
    width: 100%;
    overflow-x: auto;
  }

  .segment,
  .sort-button {
    flex: 1 0 auto;
  }

  .deal-mode-stack {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-toggle {
    align-self: stretch;
  }

  .market-section .controls {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .bank-cards-mobile {
    display: grid;
    gap: 10px;
  }

  .bank-card-mobile {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .bank-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }

  .bank-card-head div {
    flex: 1 1 auto;
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .bank-card-head .favorite-button,
  .bank-card-head .bank-icon {
    flex: 0 0 auto;
  }

  .bank-card-head strong {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    line-height: 1.2;
  }

  .bank-card-head span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
  }

  .bank-card-head em {
    flex: 0 0 auto;
    max-width: 118px;
    padding: 5px 7px;
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: var(--fw-bold);
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
  }

  .bank-card-head em.mobile-rank-best {
    background: var(--good-bg);
    color: var(--good);
  }

  .mobile-rate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .mobile-rate-grid div {
    min-height: 82px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
  }

  .mobile-rate-grid span,
  .mobile-rate-grid b,
  .mobile-rate-grid small {
    display: block;
  }

  .mobile-rate-grid span {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
  }

  .mobile-rate-grid b {
    margin-top: 4px;
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    line-height: 1.2;
  }

  .mobile-rate-grid small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
  }

  .best-mobile {
    background: var(--good-bg) !important;
    border-color: #b9e4cb !important;
  }

  .mobile-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
  }

  .mobile-card-foot > span {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
  }

  .mobile-card-foot .source-cell {
    justify-content: flex-end;
    text-align: right;
  }

  .source-health-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
