/* Global Gateway — mini app stylesheet
   Токены и правила: см. DESIGN.md */

:root{
  --bg:#0A0B0F;
  --surface:#14161D;
  --surface-2:#1B1E27;
  --line:rgba(255,255,255,.08);
  --line-2:rgba(255,255,255,.14);
  --text:#F5F7FA;
  --muted:#8A90A2;
  --muted-2:#5F6675;
  --accent:#6C5CE7;
  --accent-2:#8B5CF6;
  --accent-soft:rgba(108,92,231,.14);
  --ok:#22C55E;
  --ok-soft:rgba(34,197,94,.13);
  --warn:#F59E0B;
  --warn-soft:rgba(245,158,11,.13);
  --err:#EF4444;
  --err-soft:rgba(239,68,68,.13);
  --r-card:18px;
  --r-field:14px;
  --ease:cubic-bezier(.22,.61,.36,1);
  --safe-b:env(safe-area-inset-bottom,0px);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(108,92,231,.16), transparent 60%),
    var(--bg);
  color:var(--text);
  font:400 15px/1.45 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  font-variant-numeric:tabular-nums;
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer}
a{color:inherit;text-decoration:none}
.ic{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:0;flex:none}
.ic use{fill:currentColor;stroke:currentColor}
:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px;border-radius:8px}

/* ── каркас ───────────────────────────────────────────── */
.shell{height:100dvh;width:100%;min-width:0;display:flex;justify-content:center;align-items:stretch}
.phone{
  width:100%;max-width:430px;min-width:0;height:100dvh;
  display:flex;flex-direction:column;
  background:var(--bg);position:relative;overflow:hidden;
}
@media(min-width:520px){
  body{display:grid;place-items:center}
  .shell{width:100%;height:100dvh;padding:24px}
  .phone{
    height:min(900px,calc(100dvh - 48px));
    border:1px solid var(--line);border-radius:34px;
    box-shadow:0 40px 120px rgba(0,0,0,.6), 0 0 0 10px rgba(255,255,255,.02);
  }
}

/* ── верхняя панель ───────────────────────────────────── */
.topbar{
  display:flex;align-items:center;gap:12px;
  padding:14px 16px 12px;
  padding-top:calc(14px + env(safe-area-inset-top,0px));
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,rgba(20,22,29,.9),rgba(20,22,29,.55));
  backdrop-filter:blur(12px);
  z-index:5;flex:none;
}
.brand{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.brand__mark{
  width:34px;height:34px;border-radius:11px;flex:none;
  display:grid;place-items:center;color:#fff;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  box-shadow:0 6px 18px rgba(108,92,231,.35);
}
.brand__mark .ic{width:19px;height:19px}
.brand__txt{display:flex;flex-direction:column;min-width:0}
.brand__txt strong{font-size:15px;font-weight:650;letter-spacing:-.01em;white-space:nowrap}
.brand__txt span{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.iconbtn{
  height:32px;min-width:40px;padding:0 10px;border-radius:999px;
  border:1px solid var(--line);background:var(--surface-2);
  font-size:12px;font-weight:650;letter-spacing:.02em;color:var(--muted);
  transition:background .18s var(--ease),color .18s var(--ease);
}
.iconbtn:active{transform:scale(.96)}

/* ── область экрана ───────────────────────────────────── */
.view{
  flex:1;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  padding:18px 16px calc(28px + var(--safe-b));
  scrollbar-width:none;
}
.view::-webkit-scrollbar{display:none}
.screen{animation:in .22s var(--ease)}
@keyframes in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ── типографика ──────────────────────────────────────── */
.h1{font-size:22px;font-weight:700;letter-spacing:-.02em;margin:0 0 4px}
.sub{color:var(--muted);font-size:13.5px;margin:0}
.sec-title{
  font-size:12px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted-2);margin:26px 2px 10px;
}
.num{font-weight:750;letter-spacing:-.02em}

/* ── вводный блок «что это» ───────────────────────────── */
.intro .sub{max-width:40ch}
.feat{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-direction:column;gap:11px}
.feat li{display:flex;gap:10px;align-items:flex-start}
.feat__i{
  width:19px;height:19px;border-radius:7px;flex:none;margin-top:1px;
  display:grid;place-items:center;font-size:11px;font-weight:800;line-height:1;
  background:var(--ok-soft);color:#5EE9A0;
}
.feat div b{display:block;font-size:13.5px;font-weight:650;letter-spacing:-.01em}
.feat div span{display:block;font-size:12.5px;color:var(--muted);line-height:1.5;margin-top:2px}

.prov{margin-top:16px;border-top:1px solid var(--line);padding-top:13px}
.prov summary{
  display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;
  font-size:12.5px;font-weight:650;color:var(--muted);
}
.prov summary::-webkit-details-marker{display:none}
.prov summary::after{
  content:"";width:6px;height:6px;margin-left:auto;flex:none;
  border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;
  transform:rotate(45deg);transition:transform .2s var(--ease);
}
.prov[open] summary::after{transform:rotate(-135deg)}
.prov__note{font-size:12px;color:var(--muted-2);line-height:1.5;margin:11px 0 4px}
.prov__grp{
  font-size:11px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted-2);margin:13px 0 7px;
}
.prov__list{display:flex;flex-wrap:wrap;gap:6px}
.prov__tag{
  font-size:11.5px;padding:4px 9px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--line);color:var(--muted);
}

/* ── карточки ─────────────────────────────────────────── */
.card{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-card);padding:16px;
}
.card--err{
  border-color:rgba(255,120,120,.35);
  background:rgba(255,120,120,.07);
}
.card--err .sub{margin:6px 0 0}
.card--hero{
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(139,92,246,.22), transparent 55%),
    linear-gradient(180deg,#191C26,#14161D);
  border-color:var(--line-2);
  position:relative;overflow:hidden;
}
.card--hero::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.05),transparent 40%);
}
.hero-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;position:relative;z-index:1}
.hero-label{font-size:12px;color:var(--muted);margin-bottom:6px}
.hero-val{font-size:30px;font-weight:750;letter-spacing:-.03em;line-height:1.05}
.hero-val small{font-size:16px;font-weight:600;color:var(--muted);margin-left:3px}
.hero-val--ok{color:#5EE9A0}
.hero-note{
  margin-top:14px;padding-top:12px;border-top:1px solid var(--line);
  font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:7px;
  position:relative;z-index:1;
}
.hero-note .dot{width:6px;height:6px;border-radius:50%;background:var(--ok);flex:none;
  box-shadow:0 0 0 4px var(--ok-soft)}

/* ── метрики ──────────────────────────────────────────── */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.stat{
  background:var(--surface);border:1px solid var(--line);
  border-radius:14px;padding:12px 12px 11px;
}
.stat__v{font-size:19px;font-weight:700;letter-spacing:-.02em}
.stat__l{font-size:11px;color:var(--muted);margin-top:3px;line-height:1.3}

/* ── кнопки ───────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  height:52px;padding:0 20px;border-radius:15px;
  font-size:15px;font-weight:650;letter-spacing:-.01em;
  transition:transform .14s var(--ease),opacity .18s var(--ease),background .18s var(--ease);
  width:100%;
}
.btn:active{transform:scale(.98)}
.btn--primary{
  background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;
  box-shadow:0 10px 26px -8px rgba(108,92,231,.7);
}
.btn--secondary{background:var(--surface-2);border:1px solid var(--line);color:var(--text)}
.btn--ghost{background:transparent;border:1px solid var(--line);color:var(--muted)}
.btn--sm{height:42px;font-size:13.5px;border-radius:12px;padding:0 14px;width:auto}
.btn .ic{width:18px;height:18px}
.btn[disabled]{opacity:.45;pointer-events:none}
.btn-row{display:flex;gap:10px}
.btn-row .btn{flex:1}

/* ── поля ─────────────────────────────────────────────── */
.field{margin-bottom:14px}
.field__label{
  display:block;font-size:12.5px;font-weight:600;color:var(--muted);
  margin:0 0 7px 2px;
}
.field__hint{font-size:11.5px;color:var(--muted-2);margin:7px 2px 0;line-height:1.4}
.input,.select{
  width:100%;height:52px;padding:0 15px;border-radius:var(--r-field);
  background:var(--surface-2);border:1px solid var(--line);color:var(--text);
  font-size:15px;transition:border-color .18s var(--ease),box-shadow .18s var(--ease);
  appearance:none;
}
.input::placeholder{color:var(--muted-2)}
.input:focus,.select:focus{
  outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.input--amount{
  height:64px;font-size:26px;font-weight:700;letter-spacing:-.02em;
  padding-right:96px;
}
.amount-wrap{position:relative}
.amount-cur{
  position:absolute;right:8px;top:8px;height:48px;width:80px;
  border-radius:11px;border:1px solid var(--line);background:var(--surface);
  font-size:14px;font-weight:650;text-align:center;padding:0 8px;
}
.select{background-image:none;cursor:pointer;padding-right:40px}
.select-wrap{position:relative}
.select-wrap::after{
  content:"";position:absolute;right:16px;top:50%;width:8px;height:8px;
  border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);
  transform:translateY(-70%) rotate(45deg);pointer-events:none;
}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{
  height:40px;padding:0 15px;border-radius:999px;border:1px solid var(--line);
  background:var(--surface-2);font-size:13.5px;font-weight:600;color:var(--muted);
  transition:all .18s var(--ease);
}
.chip[aria-pressed="true"]{
  background:var(--accent-soft);border-color:var(--accent);color:#C9BEFF;
}
.chip:active{transform:scale(.97)}

/* ── сегмент-контрол ──────────────────────────────────── */
.seg{
  display:flex;gap:4px;padding:4px;border-radius:13px;
  background:var(--surface-2);border:1px solid var(--line);margin-bottom:14px;
}
.seg button{
  flex:1;height:36px;border-radius:10px;font-size:13px;font-weight:600;
  color:var(--muted);transition:all .18s var(--ease);
}
.seg button[aria-selected="true"]{background:var(--surface);color:var(--text);
  box-shadow:0 2px 8px rgba(0,0,0,.3)}

/* ── список ссылок ────────────────────────────────────── */
.list{display:flex;flex-direction:column;gap:10px}
.link-card{
  background:var(--surface);border:1px solid var(--line);
  border-radius:15px;padding:14px;display:flex;gap:13px;align-items:center;
  transition:transform .14s var(--ease),border-color .18s var(--ease);
  text-align:left;width:100%;
}
.link-card:active{transform:scale(.99);border-color:var(--line-2)}
.link-card__main{flex:1;min-width:0}
.link-card__sum{font-size:17px;font-weight:700;letter-spacing:-.02em}
.link-card__sum span{font-size:12px;font-weight:600;color:var(--muted);margin-left:5px}
.link-card__desc{
  font-size:12.5px;color:var(--muted);margin-top:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.link-card__meta{font-size:11px;color:var(--muted-2);margin-top:5px;display:flex;gap:8px;align-items:center}
.link-card__code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em}

/* ── пилюли ───────────────────────────────────────────── */
.pill{
  display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;
  border-radius:999px;font-size:11px;font-weight:650;letter-spacing:.01em;flex:none;
}
.pill--ok{background:var(--ok-soft);color:#5EE9A0}
.pill--warn{background:var(--warn-soft);color:#FBBF24}
.pill--err{background:var(--err-soft);color:#F87171}
.pill--neutral{background:rgba(255,255,255,.06);color:var(--muted)}
.pill .dot{width:5px;height:5px;border-radius:50%;background:currentColor}

/* ── платежи (строки) ─────────────────────────────────── */
.rows{display:flex;flex-direction:column}
.row{
  display:flex;align-items:center;gap:12px;padding:12px 0;
  border-bottom:1px solid var(--line);
}
.row:last-child{border-bottom:0}
.row__ic{
  width:38px;height:38px;border-radius:12px;flex:none;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--line);color:var(--muted);
}
.row__ic .ic{width:17px;height:17px}
.row__ic--ok{background:var(--ok-soft);border-color:transparent;color:#5EE9A0}
.row__ic--warn{background:var(--warn-soft);border-color:transparent;color:#FBBF24}
.row__main{flex:1;min-width:0}
.row__t{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row__s{font-size:11.5px;color:var(--muted);margin-top:2px}
.row__v{font-size:14.5px;font-weight:700;text-align:right;flex:none}
.row__v small{display:block;font-size:11px;font-weight:600;color:var(--muted);margin-top:2px}

/* ── пустое состояние ─────────────────────────────────── */
.empty{
  text-align:center;padding:44px 24px;border:1px dashed var(--line);
  border-radius:var(--r-card);background:rgba(20,22,29,.5);
}
.empty__ic{
  width:54px;height:54px;border-radius:18px;margin:0 auto 14px;display:grid;place-items:center;
  background:var(--accent-soft);color:#B9ACFF;
}
.empty__ic .ic{width:24px;height:24px}
.empty__t{font-size:15.5px;font-weight:650;margin-bottom:6px}
.empty__s{font-size:13px;color:var(--muted);line-height:1.5;margin-bottom:16px}

/* ── нижняя навигация ─────────────────────────────────── */
.tabbar{
  display:grid;grid-template-columns:1fr 1fr auto 1fr;
  gap:2px;align-items:center;
  padding:8px 10px calc(8px + var(--safe-b));
  border-top:1px solid var(--line);
  background:linear-gradient(180deg,rgba(20,22,29,.6),rgba(20,22,29,.95));
  backdrop-filter:blur(14px);flex:none;z-index:5;
}
.tab{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:7px 0;border-radius:12px;color:var(--muted-2);
  font-size:10.5px;font-weight:600;transition:color .18s var(--ease);
}
.tab .ic{width:21px;height:21px}
.tab[aria-selected="true"]{color:var(--text)}
.tab[aria-selected="true"] .ic{color:var(--accent-2)}
.tab--cta{
  width:54px;height:54px;border-radius:18px;padding:0;margin:0 8px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;
  box-shadow:0 10px 24px -8px rgba(108,92,231,.8);
}
.tab--cta .ic{width:25px;height:25px}
.tab--cta:active{transform:scale(.95)}

/* ── bottom sheet ─────────────────────────────────────── */
.sheet{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.sheet__backdrop{
  position:absolute;inset:0;background:rgba(0,0,0,.6);
  backdrop-filter:blur(3px);animation:fade .2s var(--ease);
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet__panel{
  position:relative;width:100%;max-width:430px;max-height:88dvh;overflow-y:auto;
  background:var(--surface);border:1px solid var(--line);border-bottom:0;
  border-radius:24px 24px 0 0;padding:10px 18px calc(24px + var(--safe-b));
  animation:up .26s var(--ease);scrollbar-width:none;
}
.sheet__panel::-webkit-scrollbar{display:none}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
.sheet__grip{width:38px;height:4px;border-radius:99px;background:var(--line-2);margin:4px auto 16px}
@media(min-width:520px){
  .sheet{align-items:center}
  .sheet__panel{border-radius:24px;border-bottom:1px solid var(--line);max-height:84dvh}
}
.sheet__title{font-size:19px;font-weight:700;letter-spacing:-.02em;margin:0 0 4px}
.sheet__sub{font-size:13px;color:var(--muted);margin:0 0 18px}

/* ── результат: ссылка + QR ───────────────────────────── */
.result{text-align:center;padding:6px 0 0}
.result__badge{
  width:62px;height:62px;border-radius:22px;margin:0 auto 14px;display:grid;place-items:center;
  background:var(--ok-soft);color:#5EE9A0;
}
.result__badge .ic{width:30px;height:30px}
.result__sum{font-size:32px;font-weight:750;letter-spacing:-.03em}
.result__desc{font-size:13.5px;color:var(--muted);margin-top:5px}
.linkbox{
  display:flex;align-items:center;gap:10px;margin:18px 0 14px;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:13px;padding:12px 12px 12px 14px;text-align:left;
}
.linkbox__url{
  flex:1;min-width:0;font-size:12.5px;color:#C9BEFF;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* ── тост ─────────────────────────────────────────────── */
.toast{
  position:fixed;left:50%;bottom:calc(84px + var(--safe-b));transform:translate(-50%,14px);
  background:#22252F;border:1px solid var(--line-2);color:var(--text);
  padding:11px 18px;border-radius:13px;font-size:13.5px;font-weight:600;
  opacity:0;pointer-events:none;transition:all .24s var(--ease);z-index:60;
  max-width:88vw;text-align:center;box-shadow:0 14px 40px rgba(0,0,0,.5);
}
.toast.is-on{opacity:1;transform:translate(-50%,0)}

/* ── скелетон ─────────────────────────────────────────── */
.sk{
  background:linear-gradient(90deg,var(--surface-2) 25%,#232733 37%,var(--surface-2) 63%);
  background-size:400% 100%;animation:sk 1.3s ease-in-out infinite;border-radius:10px;
}
@keyframes sk{0%{background-position:100% 0}100%{background-position:-100% 0}}

/* ── информационный блок ──────────────────────────────── */
.info{
  display:flex;gap:11px;padding:13px 14px;border-radius:14px;
  background:var(--surface-2);border:1px solid var(--line);
  font-size:12.5px;color:var(--muted);line-height:1.5;
}
.info .ic{width:17px;height:17px;color:var(--accent-2);margin-top:1px}
.info b{color:var(--text);font-weight:650}

/* ── детали (ключ-значение) ───────────────────────────── */
.kv{display:flex;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.kv:last-child{border-bottom:0}
.kv__k{color:var(--muted)}
.kv__v{font-weight:600;text-align:right;word-break:break-all}

.backline{display:flex;align-items:center;gap:8px;margin-bottom:14px}
.backline button{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:13.5px;font-weight:600}
.backline button .ic{width:18px;height:18px}
