/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'Satoshi', system-ui, -apple-system, sans-serif;

  /* Surface (backgrounds) */
  --surface-50:  #f5f7ff;
  --surface-100: #eef1fb;
  --surface-200: #e2e7f5;
  --surface-300: #cdd4ea;

  /* Ink (text) */
  --ink-900: #141729;
  --ink-800: #1e2240;
  --ink-700: #353a54;
  --ink-600: #4e5370;
  --ink-500: #6b7194;
  --ink-400: #8b90b0;
  --ink-300: #b0b4cc;

  --white: #FFFFFF;

  /* Accent */
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #a855f7 100%);
  --violet-700: #6d28d9;
  --violet-600: #7c3aed;
  --violet-500: #8b5cf6;
  --violet-100: #ede9fe;
  --violet-50:  #f5f3ff;
  --blue-600:   #2563eb;
  --bg-page: var(--surface-50);

  --shadow-xs:  0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.08), 0 3px 8px rgba(0,0,0,.04);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  180ms;

}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--ink-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* Отключаем нативный pull-to-refresh браузера — обновление делаем своё */
  overscroll-behavior-y: contain;
}

.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ───────────────────────────────────────────────── */
.header {
  background: rgba(245, 247, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-200);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header__brand { display: flex; align-items: center; gap: 14px; }
.header__logo  { flex-shrink: 0; line-height: 0; }

.header__title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
/* ── Header chip link ─────────────────────────────────────── */
.header__chip {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 600;
  color: var(--violet-600);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--surface-200);
  background: var(--white);
  transition: all .15s;
  white-space: nowrap;
}
.header__chip:hover {
  background: var(--violet-50);
  border-color: var(--violet-500);
}
.header__chips { margin-left: auto; display: flex; gap: 8px; }
.header__chips .header__chip { margin-left: 0; }

/* ── Currency toggle switch ────────────────────────────────── */
.currency-switch {
  position: relative;
  width: max-content;
  margin: 16px auto 0;
  display: flex;
  padding: 4px;
  background: var(--surface-100);
  border: 1px solid var(--surface-200);
  border-radius: 999px;
  box-shadow: inset var(--shadow-xs);
}

/* sliding thumb behind the active option */
.currency-switch__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
  z-index: 0;
}
.currency-switch[data-active="USD"] .currency-switch__thumb {
  transform: translateX(100%);
}

.currency-switch__opt {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 116px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
  background: transparent;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink-500);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
.currency-switch__opt:hover     { color: var(--violet-600); }
.currency-switch__opt.is-active { color: var(--white); }
.currency-switch__opt.is-active:hover { color: var(--white); }

.currency-switch__sym {
  font-weight: 800;
  opacity: .9;
}

/* центральный кружок «X» — кросс-курс рубль↔доллар */
.currency-switch__cross {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--surface-200);
  background: var(--white);
  color: var(--ink-500);
  font-family: var(--font);
  font-weight: 800;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.currency-switch__cross:hover {
  color: var(--violet-600);
  border-color: var(--violet-500);
}
.currency-switch[data-active="CROSS"] .currency-switch__cross {
  background: var(--accent-gradient);
  color: var(--white);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
/* в режиме кросса ползунок RUB/USD прячем — активен сам кружок */
.currency-switch[data-active="CROSS"] .currency-switch__thumb {
  opacity: 0;
}

/* ── Actions bar ─────────────────────────────────────────── */
.actions-bar {
  max-width: 1080px;
  margin: 12px auto 0;
  padding: 0 28px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.meta-datetime {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--surface-200);
  border-radius: var(--radius-md);
  padding: 6px 12px;
}

.meta-value {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* ── Snapshot (история курсов) — кликабельный блок времени + выпадающий список ── */
.meta-snapshot { position: relative; }

/* .meta-datetime теперь <button> — триггер выпадающего списка истории */
button.meta-datetime {
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
button.meta-datetime:hover { border-color: var(--violet-500); }
button.meta-datetime:focus-visible { outline: 2px solid var(--violet-500); outline-offset: 2px; }
.meta-caret { color: var(--ink-400); transition: transform .2s; flex-shrink: 0; }
button.meta-datetime[aria-expanded="true"] .meta-caret { transform: rotate(180deg); }

/* режим истории — подсветка триггера + плашка */
button.meta-datetime.is-snapshot {
  border-color: var(--violet-500);
  background: var(--violet-50);
}
.snapshot-pill {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--violet-600);
  background: var(--violet-100);
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.4;
}

.snapshot-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  max-height: 460px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--surface-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  -webkit-overflow-scrolling: touch;
}

/* ── Календарь истории ─────────────────────────────────────── */
.cal-live {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-family: inherit; font-size: .82rem; font-weight: 700; color: var(--violet-600);
  background: none; border: none; cursor: pointer; padding: 9px 10px;
  border-radius: var(--radius-sm); text-align: left;
}
.cal-live:hover { background: var(--surface-100); }
.cal-live.is-active { background: var(--violet-50); }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 6px 6px;
}
.cal-title { font-size: .85rem; font-weight: 700; color: var(--ink-800); }
.cal-nav {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--surface-200); border-radius: 8px; background: var(--white);
  color: var(--ink-600); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0;
  transition: border-color .15s, color .15s;
}
.cal-nav:hover:not(:disabled) { border-color: var(--violet-500); color: var(--violet-600); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 4px 6px; }
.cal-wd { text-align: center; font-size: .62rem; font-weight: 700; color: var(--ink-400); padding: 3px 0; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--ink-300);
  background: none; border: none; border-radius: 8px; cursor: default; padding: 0;
}
.cal-day.is-blank { visibility: hidden; }
.cal-day.has-data { color: var(--ink-800); cursor: pointer; background: var(--surface-50); }
.cal-day.has-data:hover { background: var(--violet-50); color: var(--violet-600); }
.cal-day.is-selected { background: var(--violet-500); color: #fff; }
.cal-day.is-pick:not(.is-selected) { box-shadow: inset 0 0 0 2px var(--violet-400); }
.cal-times { padding: 8px 8px 6px; margin-top: 4px; border-top: 1px solid var(--surface-100); }
.cal-times__label {
  display: block; font-size: .64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-400); margin-bottom: 7px;
}
.cal-times__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-time {
  font-family: inherit; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 5px 13px; border: 1px solid var(--surface-200); border-radius: 999px;
  background: var(--white); color: var(--ink-700); cursor: pointer; transition: all .15s;
}
.cal-time:hover { border-color: var(--violet-500); color: var(--violet-600); }
.cal-time.is-active { background: var(--violet-500); color: #fff; border-color: var(--violet-500); }
.snapshot-menu__group {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-400);
  padding: 9px 10px 4px;
}
.snapshot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-700);
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}
.snapshot-item:hover  { background: var(--surface-100); }
.snapshot-item.is-active { background: var(--violet-50); color: var(--violet-600); }
.snapshot-item__time  { font-variant-numeric: tabular-nums; }
.snapshot-item__live  { color: var(--violet-600); font-weight: 700; }
.snapshot-item__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--violet-500); flex-shrink: 0;
}
.snapshot-empty { padding: 14px 10px; font-size: .8rem; color: var(--ink-400); text-align: center; }

/* ── Telegram notify button ───────────────────────────────── */
.btn-notify[hidden] { display: none; }  /* иначе display:inline-flex перебивает атрибут hidden */
.btn-notify {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 38px;
  background: transparent;
  color: var(--ink-600);
  border: 1.5px solid var(--surface-300);
  border-radius: 999px;
  font-family: var(--font);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
  letter-spacing: -.01em;
}
.btn-notify:hover    { background: var(--violet-50); border-color: var(--violet-500); color: var(--violet-600); }
.btn-notify:active   { transform: scale(.96); }
.btn-notify:disabled { opacity: .5; cursor: not-allowed; }
.btn-notify.loading .btn-notify__icon { animation: spin 650ms linear infinite; }
.btn-notify.success  { border-color: #22C55E; color: #16A34A; background: #F0FDF4; }
.btn-notify.error    { border-color: #EF4444; color: #DC2626; background: #FEF2F2; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pull-to-refresh ──────────────────────────────────────── */
.ptr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  /* Управляется из JS через transform: translateY(...) */
  transform: translateY(-48px);
}
.ptr.snap { transition: transform .25s var(--ease); }
.ptr__spinner {
  margin-top: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--violet-600);
}
/* Поворот иконки пропорционально вытягиванию (--ptr-rot задаётся из JS) */
.ptr__spinner svg { transform: rotate(var(--ptr-rot, 0deg)); }
.ptr.loading .ptr__spinner svg { animation: spin 650ms linear infinite; }

/* ── Summary section ──────────────────────────────────────── */
.summary {
  background: var(--bg-page);
  border-bottom: 1px solid var(--surface-200);
  padding: 20px 0;
}

.summary__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Лучшие курсы — в стиле нижней таблицы ─────────────────── */
.best-wrap__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 4px 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--violet-600);
}
.best-row .cell-bank { color: var(--ink-600); }
.best-star {
  color: var(--violet-500);
  font-size: .95rem;
  margin-right: 10px;
  flex: 0 0 auto;
}
.best-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.best-cell__rate {
  font-weight: 700;
  color: var(--violet-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* «Оптимум» — цепочка из двух банков */
.opt-star { font-size: 1.05rem; line-height: 1; }
.opt-row .cell-bank__name { font-weight: 600; }
/* Цепочка из 1–2 банков: иконки СТОЛБИКОМ (одна под другой), чтобы 1 и 2 банка
   давали одинаковую ширину ячейки и цифры в строке «Оптимум» не съезжали. */
.opt-cell .opt-chain {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}
.opt-cell .opt-chain .bank-logo-box {
  width: 18px; height: 18px; margin: 0;
}
.opt-cell .opt-chain .bank-logo-box + .bank-logo-box {
  margin-left: 0;
  box-shadow: none;
}

/* ── Summary cards ────────────────────────────────────────── */
.scard {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.scard__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--surface-100);
}

.scard--best .scard__header { color: var(--violet-600); background: var(--violet-50); }
.scard__body { padding: 4px 0; }

/* Best rates table */
.best-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.best-table thead th {
  font-size: .65rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: .06em;
  color: var(--ink-500);
  padding: 8px 12px 4px;
  text-align: right;
}

.best-table thead th:first-child { text-align: left; }

.best-table tbody tr + tr { border-top: 1px solid var(--surface-100); }

.best-table__label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--ink-700);
  padding: 10px 12px;
  white-space: nowrap;
}

.best-table__label--buy { color: var(--violet-600); }

.best-table__cell {
  text-align: right;
  padding: 8px 12px;
}

.best-table__rate {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink-900);
  line-height: 1.15;
  display: block;
}

.best-table__rate--buy { color: var(--violet-600); }

.best-table__bank {
  font-size: .6875rem;
  color: var(--ink-500);
  display: block;
  margin-top: 1px;
}

/* ── Main ─────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 24px auto 40px;
  padding: 0 28px;
}

/* ── Error state ──────────────────────────────────────────── */
.state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.state-error__icon  { margin-bottom: 6px; }
.state-error__title { font-size: 1.0625rem; font-weight: 700; color: var(--ink-900); }
.state-error__desc  { font-size: .875rem; color: var(--ink-500); max-width: 400px; }

.btn-retry {
  margin-top: 10px;
  padding: 0 22px;
  height: 38px;
  background: transparent;
  border: 1.5px solid var(--surface-300);
  border-radius: 999px;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-700);
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.btn-retry:hover { border-color: var(--violet-600); color: var(--violet-600); background: var(--violet-50); }

/* ── Table wrap ───────────────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--surface-200);
  animation: fadeIn .3s var(--ease) both;
}

/* ── Rates table ──────────────────────────────────────────── */
.rates-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

/* Group header row */
.thead-group th {
  background: var(--surface-100);
  border-bottom: 1px solid var(--surface-200);
  padding: 10px 16px 8px;
  font-size: .625rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .09em;
  color: var(--ink-500);
}

.col-bank {
  text-align: left;
  vertical-align: bottom;
  min-width: 160px;
}

.col-group {
  text-align: center;
  border-left: 1px solid var(--surface-200);
  border-top: 3px solid var(--violet-500);
}

/* Sub-header row */
.col-sub {
  border-bottom: 2px solid var(--surface-200);
  border-left: 1px solid var(--surface-200);
  padding: 6px 14px 9px;
  text-align: center;
  font-size: .6rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .08em;
  color: var(--ink-500);
  white-space: nowrap;
}

/* ── Table rows ───────────────────────────────────────────── */
.rates-table tbody tr {
  border-bottom: 1px solid var(--surface-100);
  transition: background var(--dur) var(--ease);
  animation: fadeIn .22s var(--ease) both;
}
.rates-table tbody tr:last-child { border-bottom: none; }
.rates-table tbody tr:hover { background: var(--violet-50); }

.rates-table tbody td {
  padding: 13px 14px;
  font-size: .9rem;
  vertical-align: middle;
}

.cell-bank {
  font-weight: 600;
  color: var(--ink-900);
}

.cell-bank__index {
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-300);
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.cell-bank {
  display: flex;
  align-items: center;
}

.cell-bank__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bank logo box (logo over monogram fallback) ──────────── */
.bank-logo-box {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-right: 10px;
  border-radius: 7px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--mono-h, 250), 55%, 92%);
}
.bank-logo-mono {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: hsl(var(--mono-h, 250), 50%, 38%);
  text-transform: uppercase;
  line-height: 1;
}
.bank-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.bank-logo-box {
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.bank-logo-box:hover  { transform: scale(1.08); }
.bank-logo-box:active { transform: scale(.94); }
.bank-logo-box:focus-visible {
  outline: 2px solid var(--violet-500);
  outline-offset: 2px;
}

/* ── Bank name tooltip ─────────────────────────────────────── */
.bank-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--ink-900);
  color: var(--white);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 7px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
  white-space: nowrap;
  max-width: 72vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bank-tooltip.show { opacity: 1; transform: translateY(0); }
.bank-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink-900);
}
.bank-tooltip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--ink-900);
}
/* Вариант со ссылкой (российские источники) — кликабельный, не авто-скрывается */
.bank-tooltip.has-link { pointer-events: auto; white-space: normal; max-width: 260px; }
.bank-tooltip.has-link a {
  color: #c4b5fd; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.bank-tooltip.has-link a:hover { text-decoration: underline; }

/* ── Доп. блоки на /app: российские банки + опорные курсы ── */
.ext-block { margin-top: 28px; }
.ext-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: .98rem; font-weight: 800; color: var(--ink-800);
  letter-spacing: -.01em; margin: 0 2px 10px;
}
/* Опорная таблица — те же классы (rates-table/cell-bank/cell-rate), данные по центру */
.ref-table .col-bank { width: auto; }
.ext-block .cell-na { color: var(--ink-300); text-align: center; }

.cell-rate {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-600);
  letter-spacing: -.01em;
  border-left: 1px solid var(--surface-100);
}

.cell-empty { color: var(--ink-300); }

/* ── VTB highlight row ───────────────────────────────────── */
.row-vtb { background: var(--violet-50); }
.rates-table tbody tr.row-vtb:hover { background: var(--violet-100); }

/* ── Best rate pill ───────────────────────────────────────── */
.rate-best {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  background: var(--violet-50);
  color: var(--violet-600);
  font-weight: 700;
  font-size: .9rem;
  border: 1px solid var(--violet-100);
  letter-spacing: -.01em;
}

.rate-best__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet-600);
  flex-shrink: 0;
}

/* ── Delta badge (VTB difference from best) ──────────────── */
.cell-rate-wrap {
  position: relative;
  display: inline-block;
}
.delta-badge {
  position: absolute;
  top: -7px;
  right: -24px;
  font-size: .5rem;
  font-weight: 600;
  color: var(--ink-400);
  background: var(--surface-100);
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: .75rem;
  color: var(--ink-500);
}
.footer-actual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--violet-50);
  color: var(--violet-600);
  font-weight: 600;
}
.footer-actual svg { flex-shrink: 0; }
.footer a {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-weight: 600;
}
.footer a:hover { text-decoration: underline; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 780px) {
  .header__inner       { padding: 0 16px; height: 60px; }
  .currency-switch     { width: calc(100% - 32px); }
  .currency-switch__opt { min-width: 0; padding: 0 12px; }
  .actions-bar         { padding: 0 16px; flex-wrap: wrap; }
  .meta-snapshot       { flex: 1 1 auto; }
  .meta-datetime       { width: 100%; justify-content: center; }
  .snapshot-menu       { left: 0; right: 0; min-width: 0; }
  .main             { padding: 0 10px; margin-top: 16px; }
  .summary__inner   { padding: 0 12px; grid-template-columns: 1fr auto; }
  .col-group        { font-size: .55rem; padding: 8px 8px 6px; }
  .best-table__rate { font-size: 1.1rem; }

  /* ── Таблица курсов влезает без горизонтального свайпа ── */
  .rates-table      { min-width: 0; width: 100%; table-layout: fixed; }
  .table-wrap       { overflow-x: hidden; }
  .rates-table td,
  .rates-table th   { padding: 10px 4px; font-size: .76rem; }

  /* Колонка банка — только логотип, без названия и номера */
  .col-bank         { min-width: 0; width: 34px; }
  .cell-bank__index,
  .cell-bank__name  { display: none; }
  .cell-bank        { justify-content: center; }
  .bank-logo-box    { margin-right: 0; width: 24px; height: 24px; }

  /* Курсы — компактнее, бейдж дельты ВТБ скрыт (он абсолютный) */
  .cell-rate        { font-variant-numeric: tabular-nums; }
  .rate-best        { padding: 2px 6px 2px 5px; gap: 3px; font-size: .76rem; }
  .delta-badge      { display: none; }
}

@media (max-width: 480px) {
  .summary__inner { grid-template-columns: 1fr; }
}
