/* A2P Mini App 3.7.34 — цвета берутся из темы Telegram (переменные --tg-theme-*), запасные — тёмная тема A2P */
:root {
  --bg: var(--tg-theme-bg-color, #0b111b);
  --bg2: var(--tg-theme-secondary-bg-color, #070b12);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #111a28));
  --text: var(--tg-theme-text-color, #e9eef6);
  --hint: var(--tg-theme-hint-color, #8a96a8);
  --link: var(--tg-theme-link-color, #5aa2ff);
  --btn: var(--tg-theme-button-color, #3d8bff);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --sep: var(--tg-theme-section-separator-color, rgba(127, 140, 160, .18));
  --good: #22c55e;
  --warn: #f59e0b;
  --crit: #ef4444;
  --a1: #3d8bff;
  --a2: #7a5cff;
  --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg2); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: var(--link); }
#app { max-width: 560px; margin: 0 auto; padding: 12px 14px calc(28px + env(safe-area-inset-bottom)); }

.boot { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.mark { font-weight: 800; font-size: 34px; letter-spacing: 1px; background: linear-gradient(135deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spin { width: 26px; height: 26px; border: 3px solid var(--sep); border-top-color: var(--btn); border-radius: 50%; animation: sp .8s linear infinite; }
.spin.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes sp { to { transform: rotate(360deg); } }

.top { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.top .mark { font-size: 22px; }
.top .sp { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); font-weight: 600; font-size: 14px; }
.chip.sel::after { content: "▾"; color: var(--hint); font-size: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--hint); font-size: 17px; }

.hero { border-radius: 20px; padding: 18px 18px 16px; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); position: relative; overflow: hidden; }
.hero.expired { background: linear-gradient(135deg, #b91c1c, #7c2d12); }
.hero.off { background: linear-gradient(135deg, #475569, #1e293b); }
.hero::after { content: "A2P"; position: absolute; right: -6px; bottom: -22px; font-size: 92px; font-weight: 900; opacity: .09; letter-spacing: 2px; }
.hero .k { font-size: 13px; opacity: .85; }
.hero .v { font-size: 25px; font-weight: 750; margin: 2px 0 2px; }
.hero .s { font-size: 14px; opacity: .92; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .25); margin-top: 12px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: #fff; }

.card { background: var(--card); border-radius: var(--r); padding: 4px 14px; margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--sep); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .d { color: var(--hint); font-size: 13px; margin-top: 1px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.good { color: var(--good); background: rgba(34, 197, 94, .14); }
.pill.warn { color: var(--warn); background: rgba(245, 158, 11, .14); }
.pill.crit { color: var(--crit); background: rgba(239, 68, 68, .14); }
.pill.mute { color: var(--hint); background: var(--sep); }
.mini-bar { height: 4px; border-radius: 4px; background: var(--sep); margin-top: 6px; overflow: hidden; }
.mini-bar > i { display: block; height: 100%; background: var(--btn); }
.mini-bar.warn > i { background: var(--warn); }

.cta { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; min-height: 50px; border-radius: 14px; background: var(--btn); color: var(--btn-text); font-weight: 700; font-size: 16px; }
.cta.ghost { background: var(--card); color: var(--link); font-weight: 600; font-size: 15px; }
.cta:active, .tile:active, .row.tap:active { opacity: .7; }
.cta[disabled] { opacity: .5; }
.cta .sub { font-weight: 500; opacity: .85; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.tile { background: var(--card); border-radius: var(--r); padding: 14px; text-align: left; min-height: 82px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .e { font-size: 24px; line-height: 1; }
.tile .n { font-weight: 650; margin-top: 10px; }
.tile .h { color: var(--hint); font-size: 12px; margin-top: 2px; }

.sec { color: var(--hint); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 0; }
.foot { text-align: center; color: var(--hint); font-size: 12px; margin-top: 18px; }
.note { color: var(--hint); font-size: 13px; margin: 10px 2px 0; }
.banner { border-radius: 14px; padding: 12px 14px; margin-top: 12px; background: rgba(245, 158, 11, .14); color: var(--warn); font-size: 14px; }
.empty { text-align: center; padding: 40px 10px; }
.empty .big { font-size: 46px; }
.empty h2 { margin: 12px 0 6px; font-size: 20px; }
.empty p { color: var(--hint); margin: 0 0 6px; }

.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: fi .18s ease; }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column; background: var(--bg2); border-radius: 20px 20px 0 0; animation: su .22s ease; max-width: 560px; margin: 0 auto; }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--sep); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; padding: 10px 16px 6px; font-size: 17px; }
.sheet-head b { flex: 1; }
.x { width: 32px; height: 32px; border-radius: 50%; background: var(--card); color: var(--hint); }
.sheet-body { overflow-y: auto; padding: 0 14px calc(20px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@keyframes fi { from { opacity: 0; } }
@keyframes su { from { transform: translateY(40px); opacity: .4; } }

.copy { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.copy code { flex: 1; min-width: 0; font: 13px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; color: var(--text); }
.copy button { color: var(--link); font-weight: 600; font-size: 14px; white-space: nowrap; }
.qr { display: block; width: 220px; max-width: 70%; margin: 12px auto 4px; background: #fff; border-radius: 12px; padding: 8px; }
.apps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.apps button { background: var(--card); border-radius: 10px; padding: 9px 12px; font-size: 14px; color: var(--link); font-weight: 600; }
.steps { margin: 6px 0 0; padding-left: 20px; color: var(--hint); font-size: 14px; }
.steps li { margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: 88vw; background: rgba(20, 24, 32, .94); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }

/* 3.7.35: оплата, чек, аккаунты, поддержка — внутри приложения */
.pre { white-space: pre-wrap; }
.banner.info { background: rgba(61, 139, 255, .14); color: var(--link); }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border-radius: 14px; padding: 15px 16px; font-size: 16px; text-align: left; }
.opt b { color: var(--link); white-space: nowrap; }
.opt:active, .mini-btn:active { opacity: .7; }
.pay-sum { border-radius: 18px; padding: 16px 18px; margin-top: 6px; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.pay-sum .k { font-size: 13px; opacity: .85; }
.pay-sum .v { font-size: 30px; font-weight: 800; }
.pay-sum .s { font-size: 14px; opacity: .92; }
.mini-btn { background: var(--btn); color: var(--btn-text); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.mini-btn.ghost { background: var(--sep); color: var(--link); }
.ta { width: 100%; margin-top: 10px; border: 1px solid var(--sep); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; padding: 10px 12px; resize: vertical; }
.ta:focus { outline: 2px solid var(--btn); border-color: transparent; }
.rc-prev { margin-top: 10px; text-align: center; }
.rc-prev img { max-width: 100%; max-height: 260px; border-radius: 12px; }
.rc-prev .d { color: var(--hint); }
.result { text-align: center; padding: 18px 6px 4px; }
.result .big { font-size: 44px; }
.result h3 { margin: 8px 0 6px; font-size: 19px; }
.result p { color: var(--hint); margin: 6px 0; text-align: left; }

/* 3.7.36: режим администратора, история оплат */
.seg { display: flex; gap: 4px; background: var(--card); border-radius: 12px; padding: 4px; margin: 0 0 12px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--hint); }
.seg button.on { background: var(--btn); color: var(--btn-text); }
.seg button[disabled] { opacity: .4; }
.card.pad { padding: 12px 14px; }
.small { font-size: 13px; color: var(--hint); }
.mt6 { margin-top: 6px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rc-img { display: block; max-width: 100%; max-height: 420px; margin-top: 10px; border-radius: 10px; }
.row > b { white-space: nowrap; }
