:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --soft: #f2f2f7;
  --card: #f2f2f7;
  --text: #000000;
  --muted: #8e8e93;
  --green: #34c759;
  --green-dark: #248a3d;
  --green-soft: #eaf8ee;
  --black: #000000;
  --btn-fg: #ffffff;
  --btn-secondary-bg: #e5e5ea;
  --btn-secondary-fg: #000000;
  --danger-bg: #ffe5e5;
  --danger-fg: #c00;
  --warn-bg: #fff6e5;
  --warn-fg: #6b4500;
  --line: rgba(60,60,67,0.12);
  --header-bg: rgba(255,255,255,0.92);
  --tabbar-bg: rgba(255,255,255,0.94);
  --sheet-bg: #ffffff;
  --sheet-grab: #d1d1d6;
  --chip-on-bg: #000000;
  --chip-on-fg: #ffffff;
  --surface: #ffffff;
  --icon-ring: #ffffff;
  --input-fg: #000000;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html.dark, body.theme-dark {
  color-scheme: dark;
  --bg: #000000;
  --soft: #1c1c1e;
  --card: #1c1c1e;
  --text: #ffffff;
  --muted: #8e8e93;
  --green: #30d158;
  --green-dark: #30d158;
  --green-soft: #0f2918;
  --black: #ffffff;
  --btn-fg: #000000;
  --btn-secondary-bg: #2c2c2e;
  --btn-secondary-fg: #ffffff;
  --danger-bg: #3a1515;
  --danger-fg: #ff6b6b;
  --warn-bg: #3a2e14;
  --warn-fg: #ffd60a;
  --line: rgba(255,255,255,0.12);
  --header-bg: rgba(0,0,0,0.92);
  --tabbar-bg: rgba(0,0,0,0.94);
  --sheet-bg: #1c1c1e;
  --sheet-grab: #48484a;
  --chip-on-bg: #ffffff;
  --chip-on-fg: #000000;
  --surface: #1c1c1e;
  --icon-ring: #000000;
  --input-fg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  html:not(.light):not(.dark) {
    color-scheme: dark;
    --bg: #000000;
    --soft: #1c1c1e;
    --card: #1c1c1e;
    --text: #ffffff;
    --muted: #8e8e93;
    --green: #30d158;
    --green-dark: #30d158;
    --green-soft: #0f2918;
    --black: #ffffff;
    --btn-fg: #000000;
    --btn-secondary-bg: #2c2c2e;
    --btn-secondary-fg: #ffffff;
    --danger-bg: #3a1515;
    --danger-fg: #ff6b6b;
    --warn-bg: #3a2e14;
    --warn-fg: #ffd60a;
    --line: rgba(255,255,255,0.12);
    --header-bg: rgba(0,0,0,0.92);
    --tabbar-bg: rgba(0,0,0,0.94);
    --sheet-bg: #1c1c1e;
    --sheet-grab: #48484a;
    --chip-on-bg: #ffffff;
    --chip-on-fg: #000000;
    --surface: #1c1c1e;
    --icon-ring: #000000;
    --input-fg: #ffffff;
  }
}

* { box-sizing: border-box; }
/* Hide native scrollbars / grey indicators (iOS + Telegram WebView) */
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
html, body { margin: 0; background: var(--bg); color: var(--text); }
html {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}
/* Outer clip hides vertical scroll indicator while apps scroll */
.scroll-clip {
  height: 100%;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
}
/* iOS не зумит поля при фокусе */
input, textarea, select, button {
  font-size: 16px;
  touch-action: manipulation;
}
button, a, .app-cell, .chip, .bundle-card {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
}
button:focus, button:active, .app-cell:focus, .app-cell:active {
  outline: none;
  background-color: transparent;
}
.wrap {
  height: 100%;
  width: 100%;
  padding: 0 24px calc(72px + var(--safe-bottom)) 0;
  margin: 0 -24px 0 0;
  box-sizing: content-box;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}
.tg-header {
  display: grid;
  grid-template-columns: 72px 1fr 44px;
  align-items: center;
  padding: 8px 12px 10px;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  z-index: 20;
  border-bottom: 0.5px solid var(--line);
}
.tg-header .back, .tg-header .menu {
  appearance: none; border: 0; background: transparent;
  color: #007aff; font-size: 17px; padding: 8px 4px; cursor: pointer;
}
.tg-header .back { text-align: left; display: flex; align-items: center; gap: 2px; }
.tg-header .menu {
  width: 32px; height: 32px; border-radius: 50%; background: var(--soft);
  color: var(--text); font-size: 18px; line-height: 1; justify-self: end;
}
.tg-header .brand { text-align: center; }
.tg-header .brand strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }
.tg-header .brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.content { padding: 12px 16px 24px; }
h1 { font-size: 28px; font-weight: 700; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; text-transform: none; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.35; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  overflow: visible;
}
.card.white { background: var(--surface); border: 0.5px solid var(--line); }
.card.soft-green { background: var(--green-soft); }
.list-card { padding: 0; overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; background: var(--card);
  border-bottom: 0.5px solid var(--line); cursor: pointer;
}
.list-card .list-row:last-child { border-bottom: 0; }
.list-row .ico {
  width: 28px; height: 28px; display: grid; place-items: center;
  font-size: 18px; color: var(--muted);
}
.list-row .label { flex: 1; font-size: 16px; }
.list-row .chev { color: var(--muted); font-size: 18px; }
.list-row .value { color: var(--muted); font-size: 15px; }

.btn {
  display: block; width: 100%; border: 0; cursor: pointer;
  border-radius: 14px; padding: 15px 16px; font-size: 17px; font-weight: 600;
  text-align: center; text-decoration: none; color: var(--btn-fg); background: var(--black);
}
.btn.secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); }
.btn.green { background: var(--green); color: #fff; }
.btn.danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn:disabled, .btn.disabled { opacity: 0.4; pointer-events: none; }
.btn + .btn { margin-top: 10px; }
.hidden { display: none !important; }
.link-danger {
  display: block; width: 100%; border: 0; background: none; color: #ff3b30;
  font-weight: 600; font-size: 16px; padding: 14px; cursor: pointer; text-align: center;
}
.back-link {
  border: 0; background: none; color: #007aff; font-size: 16px;
  padding: 0 0 10px; cursor: pointer;
}

.success-hero { text-align: center; padding: 28px 12px 18px; }
.success-hero .check {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--green); color: #fff; display: grid; place-items: center;
  font-size: 36px; font-weight: 700;
}
.success-hero h1 { margin: 0; font-size: 28px; }

.detail-rows .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 0.5px solid var(--line); font-size: 16px;
}
.detail-rows .row:last-child { border-bottom: 0; }
.detail-rows .k { color: var(--text); }
.detail-rows .v { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.detail-rows .v.strong { color: var(--text); font-weight: 700; }

.progress {
  display: flex; gap: 8px; margin: 8px 0 16px;
}
.pill {
  flex: 1; text-align: center; font-size: 12px; font-weight: 600;
  padding: 8px 6px; border-radius: 999px; background: var(--btn-secondary-bg); color: var(--muted);
}
.pill.on { background: var(--chip-on-bg); color: var(--chip-on-fg); }
.pill.done { background: var(--green); color: #fff; }

.timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green-dark);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
}

.app-row {
  display: flex; align-items: center; gap: 12px; margin: 10px 0 14px;
}
.app-icon {
  width: 48px; height: 48px; border-radius: 11px;
  background: var(--btn-secondary-bg);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
img.app-icon { background: none; }
.catalog-list { display: grid; gap: 10px; }
.catalog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
}
.cat-icon {
  width: 56px; height: 56px; border-radius: 13px;
  object-fit: cover; flex-shrink: 0;
}
.cat-meta { flex: 1; min-width: 0; }
.cat-meta .title { font-size: 17px; font-weight: 700; }
.cat-meta .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cat-meta .price { font-size: 15px; font-weight: 700; margin-top: 6px; }
.cat-buy {
  width: auto; flex-shrink: 0;
  padding: 10px 16px; font-size: 15px; border-radius: 12px;
}

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--soft); border-radius: 12px; padding: 3px; margin: 4px 0 12px;
}
.seg-btn {
  border: 0; background: transparent; border-radius: 10px;
  padding: 10px 8px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--soft); border-radius: 14px; padding: 11px 14px; margin-bottom: 12px;
}
.search-ico { color: var(--muted); font-size: 17px; }
.search input {
  border: 0; background: transparent; outline: none; flex: 1;
  font-size: 16px; color: var(--input-fg);
}
.search input::placeholder { color: var(--muted); }

.promo {
  display: flex; justify-content: space-between; gap: 12px;
  background: #1c1c1e; color: #fff; border-radius: 18px;
  padding: 16px; margin-bottom: 14px;
}
.promo-tag { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.promo-title { font-size: 20px; font-weight: 700; margin: 6px 0 10px; line-height: 1.15; }
.promo-slots { display: flex; gap: 6px; margin-bottom: 10px; }
.promo-slots span {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1.5px dashed rgba(255,255,255,0.35);
  display: grid; place-items: center; color: rgba(255,255,255,0.45); font-size: 14px;
}
.promo-hint { font-size: 12px; color: rgba(255,255,255,0.45); }
.promo-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.promo-badge {
  background: var(--green); color: #fff; font-size: 12px; font-weight: 800;
  padding: 4px 8px; border-radius: 999px; margin-bottom: 6px;
}
.promo-old { font-size: 13px; color: rgba(255,255,255,0.4); text-decoration: line-through; }
.promo-price { font-size: 22px; font-weight: 800; margin-top: 2px; }

/* Clip iOS grey scroll indicator under horizontal group chips */
.chips-wrap {
  overflow: hidden;
  height: 42px;
  margin-bottom: 14px;
}
.chips {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  height: 64px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 24px;
}
.chip {
  flex-shrink: 0; border: 0; border-radius: 999px; padding: 9px 14px;
  background: var(--soft); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease, transform 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-fg); }

.app-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px;
  margin-bottom: 8px;
  padding-bottom: 88px;
}
.app-grid.anim-in {
  animation: grid-swap 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes grid-swap {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.app-cell {
  border: 0; background: transparent !important; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  font: inherit; color: inherit;
  appearance: none; -webkit-appearance: none;
  transition: opacity 0.4s ease, transform 0.25s ease;
}
.app-cell:active { transform: scale(0.94); background: transparent !important; }
.app-cell.dim { opacity: 0.35; pointer-events: none; }
.app-cell .icon-wrap {
  position: relative; width: 64px; height: 64px;
  border-radius: 16px;
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-cell.selected .icon-wrap {
  box-shadow: 0 0 0 2.5px var(--green);
}
.check-badge {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--icon-ring);
  z-index: 1;
  animation: pop-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pop-in {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.grid-icon {
  width: 64px; height: 64px; border-radius: 15px;
  object-fit: cover; display: block;
  background: var(--btn-secondary-bg);
}
.icon-fallback {
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--text);
}
.grid-label {
  font-size: 11px; font-weight: 500; color: var(--text);
  line-height: 1.2; max-width: 72px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Bundle promo card */
.bundle-card {
  display: block; width: 100%; text-align: left; font: inherit;
  appearance: none; -webkit-appearance: none; border: 2px solid transparent;
  background: #1c1c1e; color: #fff; border-radius: 18px;
  padding: 16px; margin-bottom: 14px; cursor: pointer;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease, transform 0.2s ease;
}
.bundle-card:active { transform: scale(0.985); background: #1c1c1e; }
.bundle-card.on {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.35);
}
.bundle-card.ready { background: #143d28; border-color: var(--green); }
.bundle-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bundle-tag { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.bundle-title { font-size: 20px; font-weight: 700; margin-top: 4px; line-height: 1.15; }
.bundle-price { text-align: right; }
.bundle-price .badge {
  display: inline-block; background: var(--green); color: #fff;
  font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; margin-bottom: 4px;
}
.bundle-price .old { font-size: 13px; color: rgba(255,255,255,0.4); text-decoration: line-through; }
.bundle-price .now { font-size: 22px; font-weight: 800; }
.bundle-slots { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; min-height: 36px; }
.bundle-slot {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px dashed rgba(255,255,255,0.35);
  display: grid; place-items: center; color: rgba(255,255,255,0.45); font-size: 16px;
  overflow: hidden; background: rgba(255,255,255,0.06); flex-shrink: 0;
}
.bundle-slot.filled { border-style: solid; border-color: rgba(255,255,255,0.25); padding: 0; }
.bundle-slot.more {
  border-style: solid; font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,0.12);
}
.bundle-hint-inline { font-size: 12px; color: rgba(255,255,255,0.45); }
.bundle-slot-icon, img.bundle-slot-icon {
  width: 100%; height: 100%; border-radius: 9px; object-fit: cover; display: block;
}
.bundle-slot .plus { line-height: 1; }
.bundle-bar {
  height: 4px; background: rgba(255,255,255,0.12); border-radius: 99px;
  overflow: hidden; margin: 0 0 10px;
}
.bundle-bar > i {
  display: block; height: 100%; background: var(--green); border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.bundle-status {
  font-size: 12px; color: rgba(255,255,255,0.45);
  display: flex; align-items: center; gap: 6px;
}
.bundle-card .bundle-price .now { font-size: 20px; }
.bundle-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.35); flex-shrink: 0;
}
.bundle-status.ok { color: var(--green); }
.bundle-status.ok::before { background: var(--green); }

/* Fly-to-slot ghost */
.fly-ghost {
  position: fixed; z-index: 9999; pointer-events: none;
  border-radius: 16px; overflow: hidden;
  transition: transform 0.68s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.68s ease;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  will-change: transform, opacity;
}
#toast {
  position: fixed; left: 50%; bottom: calc(120px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: rgba(28,28,30,0.92); color: #fff;
  padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  z-index: 10000; opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); text-align: center;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(8px);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.fly-ghost .fly-icon, .fly-ghost img.fly-icon, .fly-ghost .icon-fallback {
  width: 100%; height: 100%; border-radius: 16px; object-fit: cover; display: block;
}

/* Cart bar */
.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(64px + var(--safe-bottom));
  width: calc(100% - 24px); max-width: 406px;
  background: #1c1c1e; color: #fff; border-radius: 18px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  z-index: 30; box-shadow: 0 8px 28px rgba(0,0,0,0.28);
}
.cart-bar.tall {
  flex-direction: column; align-items: stretch; gap: 8px; padding: 12px;
}
.cart-bar .cart-row { display: flex; align-items: center; gap: 10px; }
.cart-promo, .pay-promo-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  color: rgba(255,255,255,0.92); cursor: pointer;
}
.pay-promo-check {
  color: var(--text); background: var(--green-soft); border-radius: 14px;
  padding: 12px 14px; margin: 0 0 10px;
}
html.dark .pay-promo-check, body.theme-dark .pay-promo-check { color: #d7ffe3; }
.cart-promo input, .pay-promo-check input {
  width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0;
  accent-color: var(--green);
}
.cart-meta { flex: 1; min-width: 0; }
.cart-count { font-size: 13px; color: rgba(255,255,255,0.65); }
.cart-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.cart-price .strike { font-size: 13px; color: rgba(255,255,255,0.4); text-decoration: line-through; }
.cart-price strong { font-size: 18px; font-weight: 800; }
.cart-x {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0;
}
.cart-buy {
  width: auto !important; flex-shrink: 0; margin: 0 !important;
  padding: 12px 16px !important; font-size: 15px !important; border-radius: 14px !important;
}
body.has-cart .wrap { padding-bottom: calc(148px + var(--safe-bottom)); }

.pay-app-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.pay-app-sm { margin: 0; padding: 10px 12px; background: var(--soft); border-radius: 14px; }
.pay-app-sm .pay-app-name { font-size: 16px; }
.pay-app-sm .pay-app-icon, .pay-app-sm img.pay-app-icon { width: 40px; height: 40px; border-radius: 10px; }

.bundle-pay-apps { display: flex; flex-direction: column; gap: 8px; }
.bundle-pay-app {
  display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
}
.bundle-pay-ico, img.bundle-pay-ico {
  width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
}
.bundle-progress {
  font-size: 13px; font-weight: 600; color: var(--green-dark);
  background: var(--green-soft); display: inline-block;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 8px;
}

.hidden { display: none !important; }
.app-row .meta .name { font-weight: 700; font-size: 16px; }
.app-row .meta .st { color: var(--green-dark); font-size: 13px; margin-top: 2px; }

.step-block { margin: 18px 0; }
.step-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; margin-bottom: 8px;
}
.num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--btn-secondary-bg); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.shot-carousel {
  margin: 12px 0 4px;
  margin-right: -16px; /* bleed to edge for peek */
  overflow: hidden;
}
.shot-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 16px 28px 0;
  margin-bottom: -18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shot-item {
  flex: 0 0 auto;
  width: 148px;
  scroll-snap-align: start;
}
button.shot {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 148px;
  height: 260px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #111;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  position: relative;
}
button.shot::after {
  content: "⌕";
  position: absolute; right: 8px; bottom: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 14px; line-height: 28px; text-align: center;
  pointer-events: none;
}
button.shot img.shot-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center top;
  display: block;
  border: 0 !important;
  border-radius: 0 !important;
  background: #111;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.shot-cap {
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.shot-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.code-timer {
  text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); margin: 6px 0 0;
}
.code-timer.warn { color: #ff3b30; }
.qr-panel { text-align: center; margin: 12px 0 4px; }
.qr-panel .muted { margin: 14px 0 6px; }
.qr-panel .tiny { margin: 0; }
.qr-box {
  width: 220px; height: 220px; margin: 0 auto; background: #fff;
  border-radius: 16px; display: grid; place-items: center;
  border: 1px solid var(--line); overflow: hidden; box-sizing: border-box;
}
.qr-box img {
  width: 200px; height: 200px; max-width: 100%; max-height: 100%;
  display: block; object-fit: contain;
}
.qr-box.qr-loading { background: #f7f7f8; }
.sheet-title {
  margin: 8px 0 0; font-size: 22px; font-weight: 700;
  padding-right: 36px; word-break: break-word;
}
#sheet-body { min-height: 40px; }
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.94);
  display: flex; flex-direction: column; touch-action: none;
}
.lightbox .lb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px));
  color: #fff; font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.lightbox .lb-x, .lightbox .lb-nav {
  appearance: none; border: 0; background: rgba(255,255,255,.18);
  color: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.lightbox .lb-nav:disabled { opacity: .35; }
.lightbox .lb-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 8px 12px; position: relative;
}
.lightbox .lb-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 12px;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.lightbox .lb-side {
  position: absolute; top: 0; bottom: 0; width: 28%; z-index: 2;
}
.lightbox .lb-side.prev { left: 0; }
.lightbox .lb-side.next { right: 0; }
.lightbox .lb-cap {
  color: #fff; text-align: center; font-size: 15px; font-weight: 600;
  padding: 8px 16px 6px; flex-shrink: 0;
}
.lightbox .lb-dots {
  display: flex; gap: 6px; justify-content: center;
  padding: 4px 0 calc(16px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.lightbox .lb-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); display: block;
}
.lightbox .lb-dots i.on { background: #fff; }

.checkline {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0; font-size: 15px;
}
.checkline input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--green); }

.cred {
  background: var(--surface); border-radius: 14px; padding: 12px 14px; margin: 8px 0;
  border: 0.5px solid var(--line); color: var(--text);
}
.cred .lab { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cred .valrow { display: flex; align-items: center; gap: 8px; }
.cred code { flex: 1; font-size: 15px; word-break: break-all; }
.copy-btn {
  border: 0; background: var(--green); color: #fff; font-weight: 600;
  font-size: 13px; padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.code-box {
  text-align: center; font-size: 36px; font-weight: 700; letter-spacing: 0.2em;
  padding: 18px; background: var(--surface); border-radius: 16px; margin: 10px 0;
  border: 0.5px solid var(--line); color: var(--text);
}
.link-green { color: var(--green); font-weight: 600; text-decoration: none; font-size: 15px; cursor: pointer; border: 0; background: none; padding: 0; }

.profile-head {
  display: flex; align-items: center; gap: 12px; padding: 8px 0 16px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #5ac8fa, #007aff); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 22px;
}
.profile-head .name { font-size: 20px; font-weight: 700; }
.profile-head .handle { color: var(--muted); font-size: 14px; }
.profile-head .right { margin-left: auto; }

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 430px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--tabbar-bg); backdrop-filter: blur(16px);
  border-top: 0.5px solid var(--line);
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 30;
}
.tabbar.admin-tabs { grid-template-columns: repeat(4, 1fr); }
.tabbar.hidden { display: none !important; }
.tabbar button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 10px; padding: 4px 2px; cursor: pointer;
}
.tabbar button .ico { display: block; font-size: 20px; margin-bottom: 2px; line-height: 1; }
.tabbar button.on { color: var(--green); font-weight: 600; }

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 430px; background: var(--sheet-bg); color: var(--text);
  border-radius: 16px 16px 0 0; padding: 10px 16px calc(20px + var(--safe-bottom));
  max-height: 85vh; overflow: auto;
}
.sheet .grab {
  width: 36px; height: 5px; border-radius: 999px; background: var(--sheet-grab);
  margin: 4px auto 12px;
}
.sheet .sheet-x {
  position: absolute; right: 14px; top: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: 0; background: var(--btn-secondary-bg); color: var(--text); cursor: pointer;
}
.sheet-wrap { position: relative; }
.sheet .tag { color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.help-list { list-style: none; padding: 0; margin: 12px 0 16px; }
.help-list li {
  display: flex; gap: 10px; margin: 0 0 12px; font-size: 15px; line-height: 1.35;
}
.help-list .n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--btn-secondary-bg);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.bullet { color: var(--green); margin-right: 6px; }
.code-box.code-flash {
  animation: codePulse 0.8s ease;
  outline: 2px solid var(--green);
}
@keyframes codePulse {
  0% { transform: scale(1); background: var(--green-soft); }
  40% { transform: scale(1.03); background: var(--surface); }
  100% { transform: scale(1); }
}
.admin-code-input {
  font-size: 28px !important; letter-spacing: 0.2em; text-align: center;
  font-weight: 700; padding: 12px !important; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; margin: 8px 0;
  background: var(--soft); color: var(--text);
}
.order-act {
  background: var(--green-soft); border-radius: 14px; padding: 12px; margin: 10px 0;
}

.warn {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-bg); color: var(--warn-fg); border-radius: 14px;
  padding: 12px 14px; font-size: 14px; line-height: 1.35; margin: 12px 0;
}
.warn .tri { flex-shrink: 0; font-size: 16px; }
.warn strong { color: var(--warn-fg); }

.help-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--warn-bg); color: var(--warn-fg); border-radius: 14px; padding: 12px 14px;
  margin: 12px 0; cursor: pointer; font-size: 15px; font-weight: 600;
}
.help-bar .q {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--warn-fg);
  color: var(--warn-fg); display: grid; place-items: center; font-size: 13px; flex-shrink: 0;
}
.help-bar .chev { margin-left: auto; color: var(--muted); font-weight: 400; }

.step-card {
  background: var(--green-soft); border-radius: var(--radius); padding: 16px; margin: 12px 0;
  overflow: visible;
}
.step-card .cur { color: var(--green-dark); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.step-card .shot-carousel,
.card .shot-carousel {
  margin-right: -16px;
}
.btn-row { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.qr-btn {
  width: 52px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.support-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  margin: 12px 0; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--text);
}
.support-row .q {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--muted);
  display: grid; place-items: center; color: var(--muted); font-size: 14px;
}
.access-row { display: flex; gap: 12px; align-items: center; margin: 8px 0 4px; }
.access-row .meta { font-size: 15px; font-weight: 600; }
.access-row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--btn-secondary-bg); border-top-color: var(--green);
  animation: spin 0.9s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wait-box { text-align: center; background: var(--surface); border-radius: 14px; padding: 22px 14px; margin: 8px 0; }

.avatar.avatar-img { object-fit: cover; display: block; }

.pay-app {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 14px;
}
.pay-app-icon, img.pay-app-icon {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  flex-shrink: 0; background: var(--btn-secondary-bg);
}
.pay-app-icon.icon-fallback {
  display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #5ac8fa, #007aff);
}
.pay-app-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.pay-app-meta { min-width: 0; }

.pay-warn {
  background: var(--warn-bg); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px;
  color: var(--warn-fg);
}
.pay-warn-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px;
}
.pay-warn-head .tri { flex-shrink: 0; }
.pay-warn-head strong { flex: 1; color: var(--warn-fg); }
.pay-warn-body { margin-top: 10px; font-size: 13px; color: var(--warn-fg); line-height: 1.4; }
.pay-warn-body ul { margin: 0; padding-left: 18px; }
.pay-method {
  display: flex; align-items: center; gap: 10px;
  background: var(--soft); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px;
  font-weight: 600; font-size: 15px;
}
.pay-method-ico {
  width: 28px; height: 28px; border-radius: 50%; background: #21a038; color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.pay-sum {
  background: var(--soft); border-radius: 14px; padding: 14px; margin-top: 4px;
}
.pay-sum-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 20px; font-weight: 700; margin: 4px 0;
}

.pay-hero {
  background: #1c1c1e; color: #fff; border-radius: 18px; padding: 18px 16px 14px;
  margin: 0 0 14px;
}
.pay-hero-sum { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 6px; }
.pay-timer-bar {
  height: 4px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; margin: 8px 0 6px;
}
.pay-timer-bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  font: inherit; color: inherit;
}
.order-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-no { font-size: 13px; color: var(--muted); font-weight: 600; }
.order-st { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--btn-secondary-bg); color: var(--muted); }
.order-st.st-new { background: var(--warn-bg); color: var(--warn-fg); }
.order-st.st-paid, .order-st.st-installing, .order-st.st-activating { background: var(--green-soft); color: var(--green-dark); }
.order-st.st-done { background: rgba(26,115,232,0.18); color: #6aa7ff; }
.order-st.st-cancelled, .order-st.st-expired { background: var(--danger-bg); color: var(--danger-fg); }
.order-card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.order-card-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.order-card-meta strong { color: var(--text); font-size: 15px; }

.tg-gate {
  text-align: center; padding: 48px 20px 24px;
}
.tg-gate-ico {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  background: #2AABEE; color: #fff; display: grid; place-items: center; font-size: 28px;
}
.tg-gate .btn { margin-top: 20px; }

.adm-card { margin-bottom: 10px; }
.adm-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.adm-mini { width: auto !important; padding: 10px 14px !important; font-size: 15px !important; margin: 0 !important; flex-shrink: 0; }
.adm-code-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.adm-code-row .adm-code { flex: 1; margin: 0; font-size: 22px !important; }
.adm-code-row .btn { width: 52px !important; padding: 12px 0 !important; }
