:root {
  --ink: #122a3d;
  --soft: #2f5168;
  --muted: #5a7a90;
  --brand: #3487bc;
  --deep: #1f5f8a;
  --panel: #f7fbfe;
  --panel-edge: rgba(31, 95, 138, .16);
  --item: #eef5fa;
  --ease: cubic-bezier(.22, .82, .2, 1);
  --ma-dock-h: 118px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Onest", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(70vw 48vw at 50% -10%, rgba(255,255,255,.75) 0%, transparent 58%),
    radial-gradient(48vw 38vw at 0% 82%, rgba(110, 175, 210, .28), transparent 62%),
    radial-gradient(44vw 34vw at 100% 18%, rgba(150, 200, 225, .45), transparent 58%),
    linear-gradient(180deg, #d7eaf4 0%, #c5dfec 100%);
  -webkit-font-smoothing: antialiased;
}

.ma-cloud {
  position: fixed;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}
.ma-cloud-a {
  width: 260px; height: 260px; left: -70px; top: 8%;
  background: #b9dff0; opacity: .45;
}
.ma-cloud-b {
  width: 200px; height: 200px; right: -50px; bottom: 22%;
  background: #9fd0e8; opacity: .32;
}

/* Loader */
.ma-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: inherit;
  transition: opacity .3s var(--ease), visibility .3s;
}
.ma-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.ma-loader__mark { display: block; }
.ma-loader__logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--deep);
  letter-spacing: -.04em;
}
.ma-loader__spin {
  width: 26px; height: 26px; margin-top: 4px;
  border: 2.5px solid rgba(31, 95, 138, .12);
  border-top-color: var(--deep);
  border-radius: 50%;
  animation: ma-spin .65s linear infinite;
}
@keyframes ma-spin { to { transform: rotate(360deg); } }

/* Shell */
.ma-app {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top) 14px 0;
}
.ma-app.is-hidden { visibility: hidden; }

/* Header */
.ma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px 10px;
}
.ma-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.ma-logo {
  display: block;
  width: 40px;
  height: auto;
  flex-shrink: 0;
}
.ma-brand-name {
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.04em;
  color: var(--deep);
}
.ma-user-pill {
  max-width: 46%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(31, 95, 138, .1);
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ma-user-pill:empty { display: none; }

/* Main scroll */
.ma-main { min-height: 0; position: relative; }
.ma-view {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
  padding: 0 2px calc(var(--ma-dock-h) + env(safe-area-inset-bottom) + 8px);
}
.ma-view.is-active { opacity: 1; pointer-events: auto; }

/* Typography — как на сайте */
.ma-wrap { padding-bottom: 8px; }
.ma-kicker {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}
.ma-section-title {
  font-size: clamp(1.4rem, 4.2vw, 1.65rem);
  font-weight: 800;
  color: var(--deep);
  letter-spacing: -.03em;
  line-height: 1.12;
  margin-bottom: 6px;
}
.ma-section-lead {
  font-size: .84rem;
  line-height: 1.5;
  color: var(--soft);
  margin-bottom: 16px;
}
.ma-section-lead b { color: var(--deep); font-weight: 700; }

.ma-form { display: grid; gap: 16px; }

.ma-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ma-field-label span:first-child {
  font-size: .82rem;
  font-weight: 700;
  color: var(--soft);
}
.ma-field-label span:last-child {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Term — как buy.html */
.ma-term-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid var(--panel-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.ma-term-seg-item {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  min-width: 0;
}
.ma-term-seg-face {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  min-height: 46px;
  padding: 5px 2px;
  border-radius: 12px;
  color: var(--soft);
  transition: background .15s, color .15s, box-shadow .15s;
}
.ma-term-seg-m {
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.1;
}
.ma-term-seg-d {
  font-size: .58rem;
  font-weight: 700;
  color: var(--brand);
}
.ma-term-seg-item.is-active .ma-term-seg-face {
  background: #fff;
  color: var(--deep);
  box-shadow: 0 4px 14px rgba(31, 95, 138, .13);
}

/* Qty */
.ma-qty-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
}
.ma-qty-btn {
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--panel-edge);
  background: rgba(255,255,255,.75);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--deep);
  cursor: pointer;
}
.ma-qty-btn:active { transform: scale(.96); }
.ma-qty-input {
  height: 42px;
  text-align: center;
  border-radius: 12px;
  border: 1.5px solid var(--panel-edge);
  background: rgba(255,255,255,.9);
  font-weight: 800;
  font-size: 1rem;
  color: var(--deep);
}
.ma-qty-note {
  margin-top: 8px;
  font-size: .76rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Products — buy-option 1:1 */
.ma-buy-options { display: flex; flex-direction: column; gap: 8px; }
.ma-buy-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 4.8rem;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1.5px solid var(--panel-edge);
  box-shadow: 0 8px 20px rgba(31, 95, 138, .07);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ma-buy-option.is-active {
  border-color: var(--deep);
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 95, 138, .12);
}
.ma-tag {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #5aa8d0, #1f5f8a);
}
.ma-tag svg { width: 20px; height: 20px; display: block; }
.ma-buy-option-text strong {
  font-size: .94rem;
  font-weight: 800;
  color: var(--deep);
}
.ma-buy-option-text span {
  display: none;
  margin-top: 2px;
  font-size: .7rem;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}
.ma-buy-option.is-active .ma-buy-option-text span { display: block; }
.ma-buy-option-price {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0;
}
.ma-buy-price {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ma-price-full {
  font-size: .66rem;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 600;
}

.ma-btn,
.ma-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #3d8fc4, var(--deep));
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(31, 95, 138, .2);
  transition: transform .2s var(--ease), filter .2s ease;
}
.ma-btn:active,
.ma-btn--primary:active { transform: scale(.98); }
.ma-gate .ma-btn,
.ma-gate .ma-btn--primary { max-width: 280px; margin: 0 auto; }
.ma-btn-soft {
  background: rgba(255,255,255,.8);
  color: var(--deep);
  border: 1.5px solid var(--panel-edge);
  box-shadow: none;
}
.ma-foot-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  font-size: .76rem;
}
.ma-foot-links a {
  color: var(--deep);
  font-weight: 700;
  text-decoration: none;
}

/* Footer chrome */
.ma-footer {
  position: relative;
  z-index: 8;
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(180deg, rgba(215,234,244,0) 0%, rgba(247,251,254,.92) 28%, rgba(247,251,254,.98) 100%);
  backdrop-filter: blur(10px);
}
.ma-footer-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(31, 95, 138, .1);
}
.ma-footer-total.is-hidden { display: none; }
.ma-checkout-bar__label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ma-checkout-bar__total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.ma-checkout-bar__full {
  font-size: .72rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 600;
}

.ma-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 0 6px;
}
.ma-tab {
  position: relative;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: .66rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.ma-tab svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ma-tab.is-active {
  background: rgba(255,255,255,.85);
  color: var(--deep);
  box-shadow: 0 4px 14px rgba(31, 95, 138, .1);
}
.ma-tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 26px);
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-size: .56rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* Proxies */
.ma-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.ma-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 95, 138, .12);
  background: rgba(255,255,255,.7);
  color: var(--deep);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.ma-proxy-list { display: grid; gap: 8px; }
.ma-access-card {
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(31, 95, 138, .1);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(31, 95, 138, .05);
}
.ma-access-card--mtproto .ma-access-card__head { background: rgba(232, 245, 252, .8); }
.ma-access-card--http .ma-access-card__head { background: rgba(234, 247, 238, .8); }
.ma-access-card--all .ma-access-card__head { background: rgba(238, 241, 255, .85); }
.ma-access-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(31, 95, 138, .06);
}
.ma-access-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #fff;
}
.ma-access-tag--mtproto { color: #1f5f8a; box-shadow: inset 0 0 0 1px rgba(31, 95, 138, .12); }
.ma-access-tag--http { color: #2d6a4a; box-shadow: inset 0 0 0 1px rgba(45, 106, 74, .12); }
.ma-access-tag--all { color: #3d4f9a; box-shadow: inset 0 0 0 1px rgba(61, 79, 154, .12); }
.ma-access-card__exp {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
}
.ma-cred {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.ma-cred + .ma-cred { border-top: 1px solid rgba(31, 95, 138, .06); }
.ma-cred.is-copied { background: rgba(45, 106, 74, .06); }
.ma-cred__label {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.ma-cred__value {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
  font-family: ui-monospace, monospace;
}
.ma-open-link {
  display: block;
  width: 100%;
  padding: 4px 12px 8px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--brand);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

/* Pricing */
.ma-price-card {
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1.5px solid var(--panel-edge);
}
.ma-price-card h3 {
  font-size: .92rem;
  font-weight: 800;
  color: var(--deep);
  margin-bottom: 4px;
}
.ma-sub {
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}
.ma-price-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(31, 95, 138, .07);
  font-size: .8rem;
  color: var(--soft);
}
.ma-price-row:last-child { border-bottom: 0; }
.ma-price-row b { color: var(--deep); }
.ma-disc { color: var(--brand); font-weight: 700; font-size: .74rem; }

.ma-gate {
  text-align: center;
  padding: 32px 20px 28px;
  border-radius: 22px;
  background: rgba(255,255,255,.62);
  border: 1.5px solid var(--panel-edge);
  box-shadow: 0 12px 32px rgba(31, 95, 138, .08);
}
.ma-gate .ma-section-title { margin-bottom: 8px; }
.ma-muted { color: var(--muted); font-size: .86rem; margin: 8px 0 16px; }

.ma-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--ma-dock-h) + 8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(18, 42, 61, .94);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  z-index: 20;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

@media (max-width: 360px) {
  .ma-term-seg-m { font-size: .7rem; }
  .ma-term-seg-d { font-size: .54rem; }
}
