:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --ink: #1D1D1F;
  --ink-soft: #6E6E73;
  --ink-faint: #A1A1A6;
  --line: #E5E5EA;
  --line-strong: #D2D2D7;
  --accent: #0A66E0;
  --accent-bg: #EAF2FE;
  --green: #1E8E3E;
  --green-bg: #E9F7EC;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#checkout[hidden] { display: none !important; }
body.is-checkout {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
  min-height: 100vh;
}

.checkout {
  width: 100%;
  max-width: 400px;
}

.frame {
  width: 100%;
  background: var(--surface);
  border-radius: 28px;
  padding: 32px 22px 26px;
  border: 1px solid var(--line);
}

.header { text-align: center; padding-bottom: 20px; }
.mark {
  width: 36px; height: 36px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--ink);
}
.mark svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.1px;
  color: var(--ink);
  margin: 0 0 2px;
}
.secure-line {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-faint);
  margin-top: 2px;
}
.secure-line svg { width: 11px; height: 11px; flex-shrink: 0; display: block; }

.title-block { padding: 8px 2px 22px; }
h1 {
  font-weight: 700;
  font-size: 23px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.subtitle {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  font-weight: 400;
}

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--accent-bg);
  color: var(--accent);
}
.banner.banner-ok { background: var(--green-bg); color: var(--green); }
.banner.banner-err { background: #FEF2F2; color: #B91C1C; }
.banner.banner-info { background: var(--accent-bg); color: var(--accent); }

.plan-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.plan-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.plan-icon svg { width: 18px; height: 18px; }
.plan-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.plan-info { flex: 1; min-width: 0; }
.plan-provider {
  font-size: 11.5px; font-weight: 600; color: var(--ink-faint);
  margin: 0 0 2px; text-transform: uppercase; letter-spacing: .3px;
}
.plan-name {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  margin: 0 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-meta {
  font-size: 12.5px; color: var(--ink-soft); margin: 0; font-weight: 400;
}
.plan-price { text-align: right; flex-shrink: 0; }
.plan-price-label {
  font-size: 11px; color: var(--ink-faint); font-weight: 500;
  margin: 0 0 2px;
}
.plan-price-value {
  font-size: 19px; font-weight: 700; color: var(--ink); margin: 0;
  font-variant-numeric: tabular-nums;
}

.section-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-faint);
  margin: 0 0 10px 2px;
}

.merchants { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.merchant {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.merchant.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.merchant:disabled { opacity: 0.55; cursor: not-allowed; }

.radio {
  width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.merchant.selected .radio { border-color: var(--accent); background: var(--accent); }
.radio-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; display: none; }
.merchant.selected .radio-dot { display: block; }

.logo-badge {
  width: 40px; height: 40px; border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.logo-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-parity { background: #fff; border-color: var(--line); padding: 4px; }
.logo-parity img { object-fit: contain; }
.logo-platega { background: #fff; border-color: var(--line); padding: 6px; }
.logo-platega img { object-fit: contain; }
.logo-yookassa { background: #EFFAE9; }
.logo-payop { background: #F3EEFF; }
.logo-binance { background: #181A20; border-color: #181A20; }
.logo-sever { background: #0A0A0A; border-color: #0A0A0A; padding: 0; }
.logo-sever img { object-fit: cover; }
.logo-smerch { background: transparent; border-color: transparent; padding: 0; overflow: hidden; }
.logo-smerch img { object-fit: cover; }
.logo-letter {
  font-size: 15px; font-weight: 700; color: var(--ink);
}

.merchant-body { flex: 1; min-width: 0; overflow: visible; }
.merchant-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.merchant-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
  text-overflow: clip;
}
.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-rec { background: var(--accent-bg); color: var(--accent); }
.badge-fee { background: var(--green-bg); color: var(--green); }
.merchant-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 7px; font-weight: 400; }
.chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: visible;
}
.chip {
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1px;
  background: var(--bg);
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
  text-overflow: clip;
}
.chip-qr {
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.chip-more { background: transparent; color: var(--ink-faint); font-weight: 600; padding: 0 2px; font-size: 10.5px; flex-shrink: 0; white-space: nowrap; }
.chevron { flex-shrink: 0; color: var(--ink-faint); width: 16px; height: 16px; }

.trust {
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 2px;
  margin-top: 18px;
  margin-bottom: 0;
}
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; text-align: center; }
.trust-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.trust-icon svg { width: 18px; height: 18px; }
.trust-label { font-size: 10.5px; font-weight: 500; color: var(--ink-soft); line-height: 1.3; }

.cta {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  margin-top: 8px;
}
.cta:disabled { opacity: 0.45; cursor: not-allowed; }
.cta svg { flex-shrink: 0; }

.footnote {
  text-align: center; font-size: 11.5px; color: var(--ink-faint);
  margin: 14px 0 0; line-height: 1.6; font-weight: 400;
}
.footnote a { color: var(--ink-soft); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line-strong); }

.empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 50;
  max-width: calc(100% - 32px);
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

@media (min-width: 480px) {
  body.is-checkout { padding-top: 56px; }
}
