:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --soft: #f2f2f7;
  --card: #f2f2f7;
  --fill: #f5f5f7;
  --fill-press: #ebebed;
  --panel: #ffffff;
  --text: #111111;
  --muted: #8e8e93;
  --accent: #007aff;
  --accent-dark: #0062cc;
  --accent-soft: #e8f2ff;
  --green: #007aff;
  --green-dark: #0062cc;
  --green-soft: #e8f2ff;
  --black: #111111;
  --inverse-bg: #111111;
  --inverse-fg: #ffffff;
  --btn-fg: #ffffff;
  --btn-secondary-bg: #e5e5ea;
  --btn-secondary-fg: #111111;
  --danger-bg: #ffe5e5;
  --danger-fg: #c00;
  --warn-bg: #fff6e5;
  --warn-fg: #6b4500;
  --info-bg: #eef4ff;
  --info-fg: #1d4ed8;
  --ok-bg: #e8f8ee;
  --ok-fg: #16a34a;
  --line: #e5e5ea;
  --hairline: rgba(60, 60, 67, 0.14);
  --header-bg: rgba(255,255,255,0.92);
  --tabbar-bg: #ffffff;
  --sheet-bg: #ffffff;
  --sheet-grab: #d1d1d6;
  --chip-on-bg: #007aff;
  --chip-on-fg: #ffffff;
  --surface: #ffffff;
  --icon-ring: #ffffff;
  --input-fg: #111111;
  --st-pay-bg: #fef3c7;
  --st-pay-fg: #b45309;
  --st-active-bg: #dcfce7;
  --st-active-fg: #15803d;
  --st-done-bg: #e0f2fe;
  --st-done-fg: #0369a1;
  --st-dead-bg: #fee2e2;
  --st-dead-fg: #b91c1c;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Telegram Mini App on iPhone: keep content clear of larger tabbar */
  --tabbar-h: 84px;
  --tabbar-clear: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
}

html.dark, body.theme-dark {
  color-scheme: dark;
  --bg: #000000;
  --soft: #1c1c1e;
  --card: #1c1c1e;
  --fill: #1c1c1e;
  --fill-press: #2c2c2e;
  --panel: #2c2c2e;
  --text: #ffffff;
  --muted: #8e8e93;
  --accent: #0a84ff;
  --accent-dark: #0a84ff;
  --accent-soft: #0a2540;
  --green: #0a84ff;
  --green-dark: #0a84ff;
  --green-soft: #0a2540;
  --black: #ffffff;
  --inverse-bg: #ffffff;
  --inverse-fg: #111111;
  --btn-fg: #000000;
  --btn-secondary-bg: #2c2c2e;
  --btn-secondary-fg: #ffffff;
  --danger-bg: #3a1515;
  --danger-fg: #ff6b6b;
  --warn-bg: #3a2e14;
  --warn-fg: #ffd60a;
  --info-bg: #152238;
  --info-fg: #93c5fd;
  --ok-bg: #0f2918;
  --ok-fg: #7dff9a;
  --line: rgba(255,255,255,0.12);
  --hairline: rgba(255, 255, 255, 0.14);
  --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: #0a84ff;
  --chip-on-fg: #ffffff;
  --surface: #1c1c1e;
  --icon-ring: #000000;
  --input-fg: #ffffff;
  --st-pay-bg: #3a2e14;
  --st-pay-fg: #ffd60a;
  --st-active-bg: #0f2918;
  --st-active-fg: #7dff9a;
  --st-done-bg: #0a2540;
  --st-done-fg: #7dcfff;
  --st-dead-bg: #3a1515;
  --st-dead-fg: #ff8a80;
}

@media (prefers-color-scheme: dark) {
  html:not(.light):not(.dark) {
    color-scheme: dark;
    --bg: #000000;
    --soft: #1c1c1e;
    --card: #1c1c1e;
    --fill: #1c1c1e;
    --fill-press: #2c2c2e;
    --panel: #2c2c2e;
    --text: #ffffff;
    --muted: #8e8e93;
    --accent: #0a84ff;
    --accent-dark: #0a84ff;
    --accent-soft: #0a2540;
    --green: #0a84ff;
    --green-dark: #0a84ff;
    --green-soft: #0a2540;
    --black: #ffffff;
    --inverse-bg: #ffffff;
    --inverse-fg: #111111;
    --btn-fg: #000000;
    --btn-secondary-bg: #2c2c2e;
    --btn-secondary-fg: #ffffff;
    --danger-bg: #3a1515;
    --danger-fg: #ff6b6b;
    --warn-bg: #3a2e14;
    --warn-fg: #ffd60a;
    --info-bg: #152238;
    --info-fg: #93c5fd;
    --ok-bg: #0f2918;
    --ok-fg: #7dff9a;
    --line: rgba(255,255,255,0.12);
    --hairline: rgba(255, 255, 255, 0.14);
    --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: #0a84ff;
    --chip-on-fg: #ffffff;
    --surface: #1c1c1e;
    --icon-ring: #000000;
    --input-fg: #ffffff;
    --st-pay-bg: #3a2e14;
    --st-pay-fg: #ffd60a;
    --st-active-bg: #0f2918;
    --st-active-fg: #7dff9a;
    --st-done-bg: #0a2540;
    --st-done-fg: #7dcfff;
    --st-dead-bg: #3a1515;
    --st-dead-fg: #ff8a80;
  }
}

* { 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%;
  /* Bottom clearance lives on .content — WebKit often clips padding on the scroller itself */
  padding: 0 24px 0 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 var(--tabbar-clear);
  box-sizing: border-box;
}
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: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--muted);
  background: var(--btn-secondary-bg);
}
.list-row .ico.ico-green {
  background: var(--green-soft); color: var(--green-dark);
}
.list-row .ico .ico-sticker,
.list-row .ico .ico-sticker svg {
  display: block; width: 18px; height: 18px;
}
html.dark .list-row .ico,
body.theme-dark .list-row .ico {
  background: var(--btn-secondary-bg); color: var(--muted);
}
html.dark .list-row .ico.ico-green,
body.theme-dark .list-row .ico.ico-green {
  background: var(--green-soft); color: var(--green);
}
.list-row .label { flex: 1; font-size: 16px; min-width: 0; }
.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: 10px;
  background: var(--soft); border-radius: 14px;
  height: 48px; padding: 0 14px; margin: 0 0 16px;
}
.search-ico {
  color: var(--muted); width: 20px; height: 20px; flex-shrink: 0;
  display: grid; place-items: center;
}
.search-ico svg { display: block; width: 18px; height: 18px; }
.search input {
  border: 0; background: transparent; outline: none; flex: 1;
  font-size: 16px; color: var(--input-fg); height: 100%;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }

/* Catalog banner carousel */
.banner-carousel {
  margin: 0 0 16px;
  user-select: none;
  -webkit-user-select: none;
}
.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 20px;
  gap: 0;
}
.banner-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--soft);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 2.2 / 1;
  position: relative;
  display: block;
  font: inherit; color: inherit;
  -webkit-appearance: none; appearance: none;
}
.banner-slide img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  background: var(--soft);
}
.banner-dots {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 10px; min-height: 8px;
}
.banner-dots.hidden { display: none; }
.banner-dot {
  width: 6px; height: 6px; border-radius: 999px;
  border: 0; padding: 0; background: #d1d1d6;
  cursor: pointer; transition: width 0.25s ease, background 0.25s ease;
}
.banner-dot.on { width: 16px; background: var(--accent); }

.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: 40px;
  margin: 0 0 16px;
}
.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: 20px;
  height: 36px; padding: 0 15px;
  background: var(--soft); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-fg); }

/* Admin-controlled chip scale (meta.chip_scale → html[data-chip-scale]) */
html[data-chip-scale="s"] .chips-wrap { height: 36px; }
html[data-chip-scale="s"] .chips { height: 56px; }
html[data-chip-scale="s"] .chip { height: 32px; padding: 0 12px; font-size: 13px; }
html[data-chip-scale="m"] .chips-wrap { height: 38px; }
html[data-chip-scale="m"] .chips { height: 60px; }
html[data-chip-scale="m"] .chip { height: 34px; padding: 0 14px; font-size: 14px; }
html[data-chip-scale="l"] .chips-wrap { height: 42px; }
html[data-chip-scale="l"] .chips { height: 66px; }
html[data-chip-scale="l"] .chip { height: 38px; padding: 0 16px; font-size: 15px; }

.app-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 10px;
  margin-bottom: 8px;
  padding: 6px 4px 12px; /* room for ✓ / НОВОЕ overhang — never clipped */
  overflow: visible;
}
@media (max-width: 340px) {
  .app-grid { gap: 12px 6px; }
  .app-cell .icon-wrap { width: 58px; height: 58px; border-radius: 13px; padding: 0; }
  .app-cell .grid-icon, .app-cell .icon-fallback.grid-icon { border-radius: 13px; }
  .grid-label { max-width: 72px; font-size: 11px; }
}
.app-grid.anim-in {
  /* no filter — filter creates a clip box and cuts check-badge */
  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); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.app-cell {
  border: 0; background: transparent !important; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  font: inherit; color: inherit;
  appearance: none; -webkit-appearance: none;
  overflow: visible;
  /* no opacity transition — dim must be instant (WebView ghosts otherwise) */
  transition: transform 0.25s ease;
}
.app-cell:active { transform: scale(0.94); background: transparent !important; }
.app-cell.dim { opacity: 0.4; pointer-events: none; }
.app-cell .icon-wrap {
  position: relative;
  box-sizing: border-box;
  width: 64px; height: 64px;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  overflow: visible;
  /* no box-shadow transition — intermediate frames = square rings in WKWebView */
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Ring always mounted (opacity only) — create/remove ::after leaves top-edge
   stripe ghosts 1–3s in iOS Telegram WKWebView when toggling selection. */
.app-cell .icon-wrap::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2.5px solid var(--accent);
  border-radius: 19px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.app-cell.selected .icon-wrap::after {
  opacity: 1;
}
/* Compact “НОВОЕ” overhang — left corner; ✓ stays on the right */
.new-badge {
  position: absolute; top: -5px; left: -5px; z-index: 2;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 7.5px; font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 0 2px var(--icon-ring);
  pointer-events: none;
}
/* АКЦИЯ — left pill with thick white ring + soft glow (E6) */
.sale-badge {
  position: absolute;
  top: -4px;
  left: -8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ff3b5c;
  color: #fff;
  font-size: 7.5px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    0 0 0 2.5px var(--icon-ring, #fff),
    0 0 0 3.5px rgba(255, 59, 92, 0.2),
    0 7px 16px rgba(255, 59, 92, 0.4);
  transform: rotate(-10deg);
  transform-origin: center;
  pointer-events: none;
}
.check-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2.5px var(--icon-ring);
  z-index: 3;
  pointer-events: none;
  overflow: visible;
  animation: pop-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.check-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}
@keyframes pop-in {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.grid-icon {
  width: 100%; height: 100%; border-radius: 14px;
  object-fit: cover; display: block;
  background: var(--btn-secondary-bg);
}
.app-cell .icon-fallback.grid-icon {
  width: 100%; height: 100%; border-radius: 14px;
}
.icon-fallback {
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--text);
}
.grid-label {
  font-size: 11.5px; font-weight: 560; color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2; width: 100%; max-width: 82px;
  min-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-align: center;
}
.grid-ver {
  font-size: 10px; font-weight: 600; color: var(--muted, #8e8e93);
  line-height: 1; margin-top: -2px;
}
.ver-pick {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: var(--soft); color: var(--text);
  border-radius: 14px; padding: 10px 12px; margin-top: 8px;
  font: inherit; text-align: left; cursor: pointer;
}
.ver-pick:active { transform: scale(0.98); opacity: 0.92; }
.ver-pick-icon, img.ver-pick-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  object-fit: cover;
}
.ver-pick-name { font-size: 15px; font-weight: 600; line-height: 1.25; }

/* 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(var(--tabbar-clear) + 48px);
  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 — two rows (stable on narrow screens) */
.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  width: calc(100% - 24px); max-width: 406px;
  background: #1c1c1e; color: #fff; border-radius: 20px;
  padding: 12px;
  display: flex; flex-direction: column; align-items: stretch; 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.compact {
  flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px;
  flex-wrap: nowrap;
}
.cart-bar-2row .cart-top {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.cart-slots {
  display: flex; gap: 0; align-items: center; flex-wrap: nowrap;
  min-height: 34px; flex: 0 0 auto;
  width: 134px; /* 5×34 − 4×9 overlap — never clipped */
  overflow: visible;
  padding-right: 0;
}
.cart-slots .bundle-slot,
.cart-slots .cart-slot {
  width: 34px; height: 34px; border-radius: 10px;
  margin-left: -9px;
  border: 0 !important;
  background: transparent;
  box-shadow: 0 0 0 2.5px #1c1c1e;
  overflow: hidden;
  padding: 0;
  position: relative;
  flex: 0 0 auto;
}
.cart-slots .bundle-slot:first-child,
.cart-slots .cart-slot:first-child { margin-left: 0; z-index: 5; }
.cart-slots .bundle-slot:nth-child(2),
.cart-slots .cart-slot:nth-child(2) { z-index: 4; }
.cart-slots .bundle-slot:nth-child(3),
.cart-slots .cart-slot:nth-child(3) { z-index: 3; }
.cart-slots .bundle-slot:nth-child(4),
.cart-slots .cart-slot:nth-child(4) { z-index: 2; }
.cart-slots .bundle-slot:nth-child(5),
.cart-slots .cart-slot:nth-child(5) { z-index: 1; }
.cart-slots .bundle-slot.filled,
.cart-slots .cart-slot.filled {
  border: 0 !important;
  background: #2c2c2e;
}
.cart-slots .bundle-slot-icon,
.cart-slots img.bundle-slot-icon,
.cart-slots .icon-fallback.bundle-slot-icon {
  width: 100%; height: 100%; border-radius: 10px; object-fit: cover; display: block;
}
.cart-slots .bundle-slot .plus { display: none; }
.cart-bar.compact .cart-meta { flex: 1; min-width: 0; }
.cart-bar.compact .cart-buy {
  padding: 11px 14px !important; font-size: 14px !important;
  border-radius: 12px !important; white-space: nowrap;
}
.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: 12px; font-weight: 600;
  color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-price {
  display: flex; align-items: baseline; gap: 6px; margin-top: 1px;
  flex-wrap: wrap; white-space: nowrap;
}
.cart-price .cart-cb-sub {
  display: block;
  flex-basis: 100%;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 800;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.cart-price .strike {
  font-size: 12px; color: rgba(255,255,255,0.4); text-decoration: line-through;
  white-space: nowrap; flex-shrink: 0;
}
.cart-price strong {
  font-size: 17px; font-weight: 800; letter-spacing: -0.02em;
  white-space: nowrap; flex-shrink: 0;
}
.cart-bar.compact .cart-slots {
  max-width: none;
  overflow: visible;
}
.cart-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 15px; 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;
}
.cart-buy-full {
  width: 100% !important;
  padding: 13px 16px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  text-align: center;
}
body.has-cart .content { padding-bottom: calc(128px + 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; }

.pay-apps-compact {
  display: flex; align-items: center; gap: 10px;
  background: var(--soft); border-radius: 14px;
  padding: 10px 12px; margin: 0 0 12px;
}
button.pay-apps-compact.pay-apps-toggle {
  width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
button.pay-apps-compact.pay-apps-toggle:active { opacity: 0.85; }
.pay-apps-compact .chev {
  color: var(--muted); font-size: 18px; font-weight: 600; flex-shrink: 0;
}
.pay-apps-compact-icos {
  display: flex; align-items: center; flex-shrink: 0;
}
.pay-apps-compact-icos .pay-app-ico-sm,
.pay-apps-compact-icos img.pay-app-ico-sm,
.pay-apps-compact-icos .icon-fallback.pay-app-ico-sm {
  width: 28px; height: 28px; border-radius: 7px;
  margin-left: -6px; object-fit: cover; display: block;
  box-shadow: 0 0 0 2px var(--soft);
}
.pay-apps-compact-icos .pay-app-ico-sm:first-child,
.pay-apps-compact-icos img.pay-app-ico-sm:first-child,
.pay-apps-compact-icos .icon-fallback.pay-app-ico-sm:first-child { margin-left: 0; }
.pay-apps-compact-txt {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pay-apps-compact-txt small {
  display: block; font-size: 12px; font-weight: 500; color: var(--muted);
  margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pay-apps-expand {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--soft); border-radius: 14px;
  padding: 10px 12px; margin: -4px 0 12px;
}
.pay-apps-expand-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
}
.pay-app-ico-md, img.pay-app-ico-md, .icon-fallback.pay-app-ico-md {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; display: block;
}
.pay-notice {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--soft); color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.35;
}
.pay-notice-warn {
  background: #fff4e5; color: #9a5b00;
}
html.dark .pay-notice-warn, body.theme-dark .pay-notice-warn {
  background: #3a2a10; color: #ffd60a;
}
/* Checkout VPN tip (amber + icon) */
.pay-vpn-notice {
  margin: 0 0 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #fff4e5;
  color: #9a5b00;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pay-vpn-ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #ffe0b0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.pay-vpn-copy { min-width: 0; }
.pay-vpn-t {
  display: block;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}
.pay-vpn-s {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}
html.dark .pay-vpn-notice,
body.theme-dark .pay-vpn-notice {
  background: #3a2a10;
  color: #ffd60a;
}
html.dark .pay-vpn-ico,
body.theme-dark .pay-vpn-ico {
  background: #5a3d12;
  color: #ffd60a;
}
.pay-promo-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; background: transparent; padding: 8px 2px; margin: 0 0 6px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--green); cursor: pointer;
}
.pay-promo-toggle .chev { color: var(--muted); }
.pay-promo-toggle-meta { color: var(--muted); font-weight: 600; font-size: 13px; }
.pay-sheet-price-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0 0;
}
.pay-sheet-price-row .pay-sheet-price { margin: 0; }
.pay-sheet-strike {
  font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: line-through;
}
.pay-sheet-foot-sticky {
  margin-top: 8px;
}
.order-pay-card {
  background: var(--card); border-radius: 16px; padding: 16px;
  border: 0.5px solid var(--line); margin-bottom: 10px;
}
.order-pay-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff4e5; color: #b86e00; border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700; margin-bottom: 10px;
}
.order-pay-status i {
  width: 7px; height: 7px; border-radius: 50%; background: #ff9f0a;
}
html.dark .order-pay-status, body.theme-dark .order-pay-status {
  background: #3a2a10; color: #ffd60a;
}
.order-pay-meta { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.order-pay-sum { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.order-pay-apps {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 0.5px solid var(--line);
}
.order-pay-legal {
  text-align: center; font-size: 12px; color: var(--muted); font-weight: 600;
  margin: 4px 0 12px; line-height: 1.4;
}
.order-pay-legal .link-green {
  border: 0; background: none; color: var(--green); font: inherit; font-size: inherit;
  font-weight: 700; cursor: pointer; padding: 0;
}

.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; }
.doc-prose {
  font-size: 14px; line-height: 1.45; color: var(--text);
  padding-bottom: 8px;
}
.doc-prose .doc-date {
  color: var(--muted); font-size: 12px; margin: 0 0 12px;
}
.doc-prose h3 {
  font-size: 15px; font-weight: 700; margin: 16px 0 6px;
}
.doc-prose p { margin: 0 0 10px; }
.doc-prose ul {
  margin: 0 0 12px; padding-left: 18px;
}
.doc-prose ul li { margin: 0 0 6px; }
.doc-prose code {
  font-size: 12px; background: var(--btn-secondary-bg);
  padding: 1px 6px; border-radius: 6px;
}
.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-stage video {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 12px; background: #000;
}
.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: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: #8b5cf6; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 26px;
}
.profile-head .meta { min-width: 0; flex: 1; }
.profile-head .name { font-size: 20px; font-weight: 700; }
.profile-head .handle { color: var(--muted); font-size: 14px; margin-top: 1px; }
.profile-badge {
  display: inline-block; margin-top: 6px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--soft); border-radius: 999px;
  padding: 3px 10px; line-height: 1.3;
}
.profile-head .right { margin-left: auto; flex-shrink: 0; }
.profile-support {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); font-weight: 600; font-size: 15px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.profile-support .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}
.profile-support .chev { color: var(--green); font-size: 16px; opacity: .7; }
.profile-foot {
  text-align: center;
  margin: 16px 0 0;
}

.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: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 30;
}
.tabbar.admin-tabs,
.tabbar.bonuses-tabs { grid-template-columns: repeat(4, 1fr); }
body:has(.tabbar.bonuses-tabs) { --tabbar-h: 96px; }
.tabbar.bonuses-tabs {
  padding: 10px 8px calc(12px + var(--safe-bottom));
  gap: 4px;
  box-shadow: 0 -8px 30px rgba(31, 60, 112, 0.04);
}
.tabbar.bonuses-tabs button {
  font-size: 12px; font-weight: 550; border-radius: 19px; min-height: 70px;
  position: relative;
}
.tabbar.bonuses-tabs button .ico { height: 31px; margin-bottom: 5px; }
.tabbar.bonuses-tabs button .ico svg { width: 26px; height: 26px; }
.tabbar.bonuses-tabs button.on {
  background: #edf2ff; color: #2f5de3; font-weight: 600;
}
.tabbar.bonuses-tabs button[data-tab="bonuses"].on {
  background: #e8efff; box-shadow: inset 0 0 0 1px #dce6ff;
}
html.dark .tabbar.bonuses-tabs button.on,
body.theme-dark .tabbar.bonuses-tabs button.on {
  background: rgba(47, 93, 227, 0.2); color: #93c5fd;
}
html.dark .tabbar.bonuses-tabs button[data-tab="bonuses"].on,
body.theme-dark .tabbar.bonuses-tabs button[data-tab="bonuses"].on {
  background: rgba(47, 93, 227, 0.28); box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.25);
}
.tabbar .badge-dot {
  position: absolute; top: -4px; left: calc(50% + 7px); margin: 0;
  min-width: 22px; height: 17px; padding: 0 3px; border-radius: 999px;
  border: 2px solid var(--tabbar-bg, #fff);
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 800;
  display: grid; place-items: center; line-height: 1; z-index: 1;
}
.tabbar .badge-dot.hidden { display: none !important; }
.tabbar button .ico { position: relative; }

/* Client bonuses tab — Рефка iApps.html */
.ref-h1 { font-size: 30px; letter-spacing: -0.03em; margin: 4px 0 20px; font-weight: 800; }
.balance-card {
  position: relative; overflow: hidden;
  background: linear-gradient(115deg, #244fdb, #436df1);
  border: 0; color: #fff; padding: 24px; border-radius: 26px; margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(52, 94, 229, 0.16);
}
.balance-card:after {
  content: ""; position: absolute; right: -80px; top: -90px;
  width: 260px; height: 260px; border: 1px solid rgba(255,255,255,0.28); border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,0.08), 0 0 0 42px rgba(255,255,255,0.05); pointer-events: none;
}
.balance-card > * { position: relative; z-index: 1; }
.balance-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; font-size: 14px; font-weight: 500; color: #e8eeff;
}
.balance-mark {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,0.27);
  border-radius: 12px; display: grid; place-items: center; color: #fff;
}
.balance-mark svg { width: 18px; height: 18px; display: block; }
.balance-card .balance {
  font-size: 58px; font-weight: 700; letter-spacing: -0.055em; line-height: 1;
}
.balance-card .balance span {
  font-size: 17px; font-weight: 400; margin-left: 6px; color: #eef2ff; letter-spacing: 0;
}
.balance-footer {
  border-top: 1px solid rgba(255,255,255,0.19); margin-top: 20px; padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; color: #eaf0ff;
}
.cashback-banner {
  display: flex; align-items: center; gap: 10px;
  background: #eaf0ff; color: #234dbb; font-weight: 600;
  padding: 14px 16px; border-radius: 17px; margin: 0 0 18px; font-size: 13px;
  border: 1px solid #dce6ff;
}
.cashback-banner:before { content: "↩"; font-size: 22px; line-height: 1; color: #3061ed; }
html.dark .cashback-banner, body.theme-dark .cashback-banner {
  background: #0a2540; color: #93c5fd; border-color: rgba(147, 197, 253, 0.2);
}
html.dark .cashback-banner:before, body.theme-dark .cashback-banner:before { color: #7dcfff; }
.invite-card {
  padding: 22px !important; border-radius: 25px !important; margin-bottom: 12px;
  box-shadow: 0 5px 22px rgba(35, 68, 119, 0.04);
}
.invite-card h2 {
  margin: 0 0 6px; font-size: 22px; letter-spacing: -0.035em; font-weight: 800; line-height: 1.2;
}
.invite-intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
/* Vivid tiles — как в «истрории в бонус.html» */
.reward-tile {
  border-radius: 18px; padding: 16px 14px; min-width: 0;
  background: linear-gradient(135deg, #2360ed 0%, #2443cb 100%);
  border: 1px solid #2552d5;
  box-shadow: 0 7px 18px rgba(36, 84, 220, 0.14);
}
.reward-tile.friend {
  background: linear-gradient(135deg, #9250df 0%, #7134be 100%);
  border: 1px solid #8040ce;
  box-shadow: 0 7px 18px rgba(130, 69, 207, 0.14);
}
.reward-eyebrow,
.friend .reward-eyebrow { font-size: 12px; font-weight: 600; color: #fff; }
.reward-value,
.friend .reward-value {
  font-size: 32px; font-weight: 750; letter-spacing: -0.05em; color: #fff; margin: 5px 0;
}
.reward-value small { font-size: 13px; font-weight: 600; letter-spacing: 0; color: #fff; }
.reward-caption,
.friend .reward-caption { font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, 0.92); }
html.dark .reward-tile, body.theme-dark .reward-tile {
  background: linear-gradient(135deg, #2360ed 0%, #2443cb 100%);
  border-color: #2552d5;
}
html.dark .reward-tile.friend, body.theme-dark .reward-tile.friend {
  background: linear-gradient(135deg, #9250df 0%, #7134be 100%);
  border-color: #8040ce;
}
html.dark .reward-eyebrow, body.theme-dark .reward-eyebrow,
html.dark .friend .reward-eyebrow, body.theme-dark .friend .reward-eyebrow,
html.dark .reward-value, body.theme-dark .reward-value,
html.dark .friend .reward-value, body.theme-dark .friend .reward-value,
html.dark .reward-value small, body.theme-dark .reward-value small,
html.dark .reward-caption, body.theme-dark .reward-caption,
html.dark .friend .reward-caption, body.theme-dark .friend .reward-caption {
  color: #fff;
}
.link-label { font-size: 12px; font-weight: 600; color: #627089; margin-bottom: 8px; }
html.dark .link-label, body.theme-dark .link-label { color: var(--muted); }
.ref-link-row {
  display: flex; align-items: center; gap: 0;
  border: 1px solid #e4eaf3; border-radius: 14px; background: #f7f9fc;
  margin-bottom: 12px; padding: 3px;
}
html.dark .ref-link-row, body.theme-dark .ref-link-row {
  background: var(--soft); border-color: var(--line);
}
.ref-link-row .bonus-linkbox,
.ref-link-row .linkbox {
  flex: 1; min-width: 0; background: none; border: 0;
  padding: 12px 10px; font-size: 12px; color: #526480;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html.dark .ref-link-row .bonus-linkbox,
html.dark .ref-link-row .linkbox,
body.theme-dark .ref-link-row .bonus-linkbox,
body.theme-dark .ref-link-row .linkbox { color: var(--muted); }
.ref-link-row .bonus-ico-btn,
.ref-link-row .iconbtn {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  background: #fff; border: 1px solid #e7ecf4; color: #526480;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
html.dark .ref-link-row .bonus-ico-btn,
html.dark .ref-link-row .iconbtn,
body.theme-dark .ref-link-row .bonus-ico-btn,
body.theme-dark .ref-link-row .iconbtn {
  background: #1c1c1e; border-color: var(--line); color: var(--muted);
}
.invite-actions { display: flex; gap: 10px; }
.invite-actions .btn {
  flex: 1; min-width: 0; margin: 0; font-size: 14px; min-height: 50px;
  box-shadow: 0 4px 10px rgba(47, 93, 227, 0.1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.invite-actions .btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.qr-button {
  flex: none; width: 52px; height: 50px; border: 1px solid #dce5f6;
  background: #eff4ff; color: #3159b6; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.qr-button svg { width: 23px; height: 23px; display: block; }
html.dark .qr-button, body.theme-dark .qr-button {
  background: rgba(47, 93, 227, 0.22); border-color: rgba(147, 197, 253, 0.25); color: #93c5fd;
}
@media (max-width: 360px) {
  .invite-card { padding: 17px !important; }
  .reward-tile { padding: 14px 11px; }
  .balance-footer { font-size: 11px; }
}
.story-card {
  width: 100%; text-align: left; cursor: pointer; position: relative;
  padding: 19px; border: 1px solid #c5d4ff; border-radius: 23px;
  background: linear-gradient(135deg, #f7f9ff 0%, #eef3ff 55%, #f5f0ff 140%);
  margin: 0 0 18px; display: flex; align-items: center; gap: 15px;
  color: var(--text); font: inherit;
  box-shadow: 0 8px 22px rgba(41, 76, 152, 0.1);
}
.story-icon {
  width: 58px; height: 68px; flex: none;
  background: linear-gradient(145deg, #436df1, #244fdb);
  border-radius: 17px; display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(36, 79, 219, 0.28);
}
.story-icon svg { width: 34px; height: 40px; }
.story-card b { display: block; font-size: 17px; letter-spacing: -0.4px; margin: 4px 0; color: #1a3fbc; }
.story-card small { font-size: 12px; color: #5a6f96; line-height: 1.4; display: block; }
.story-tag {
  font-size: 10px; font-weight: 750; letter-spacing: 0.8px; color: #4165df; text-transform: uppercase;
}
.story-arrow { margin-left: auto; color: #4165df; font-size: 26px; font-weight: 300; }
.story-hero {
  padding: 24px 20px; background: #eef2ff; border: 1px solid #dfe6fe;
  border-radius: 23px; margin: 12px 0 22px; position: relative; overflow: hidden;
}
.story-hero .story-tag { display: inline-block; margin-bottom: 2px; }
.story-hero .amount {
  font-size: 54px; letter-spacing: -3px; font-weight: 750; color: #315ce0;
  line-height: 1.1; margin: 13px 0 5px;
}
.story-hero .amount small { font-size: 17px; letter-spacing: 0; }
.story-hero h2 { font-size: 25px; line-height: 1.12; margin: 8px 0; letter-spacing: -0.03em; }
.story-hero p {
  font-size: 13px; line-height: 1.55; color: #627089; margin: 12px 0 0; max-width: 280px;
}
.story-step { display: flex; gap: 12px; margin: 14px 0; font-size: 14px; line-height: 1.4; }
.story-step i {
  font-style: normal; color: #315ce0; background: #edf2ff; border-radius: 10px;
  width: 29px; height: 29px; display: grid; place-items: center; flex: none; font-weight: 650;
}
.story-step small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.story-link {
  font-size: 12px; word-break: break-all; background: #f5f7fc; padding: 12px; border-radius: 12px; margin: 12px 0;
}
.story-input {
  display: block; width: 100%; border: 1px solid #dce3ef; background: #f7f9fd; color: var(--text);
  font: inherit; font-size: 14px; border-radius: 13px; padding: 13px; margin: 9px 0 16px; box-sizing: border-box;
}
.story-label { font-size: 13px; font-weight: 650; display: block; }
.story-check {
  display: flex; align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.5;
  color: var(--muted); margin: 12px 0;
}
.story-check input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.story-error { font-size: 12px; color: #b43e42; margin: 8px 0; }
.story-track {
  padding: 14px; border: 1px solid #e0e7f2; border-radius: 17px; margin: 12px 0;
}
.story-track div { padding: 8px 0; font-size: 13px; color: #70809a; }
.story-track .done { color: #246748; }
.story-mini {
  margin: 12px 0 0; padding: 11px 13px; border: 1px solid #dce5fb; border-radius: 12px;
  background: #f0f4ff; color: #345ac5; width: 100%; font: inherit; font-size: 13px;
  font-weight: 650; cursor: pointer;
}
.story-cand-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 12px; }
.story-cand {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 12px; border: 1px solid #dce5fb; border-radius: 18px; background: #f7f9ff;
  font: inherit; color: var(--text); cursor: pointer;
}
.story-cand-thumb {
  width: 56px; height: 72px; border-radius: 14px; flex: none;
  background: linear-gradient(160deg, #7aa2ff, #4b6ef0 55%, #8b5cf6);
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.story-cand-meta { flex: 1; min-width: 0; }
.story-cand-meta b { display: block; font-size: 14px; margin: 0 0 4px; }
.story-cand-meta small { display: block; font-size: 12px; color: #627089; line-height: 1.4; }
.story-cand-pick {
  flex: none; background: #2457e7; color: #fff; border-radius: 12px;
  padding: 10px 12px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.story-state-msg {
  background: #f5f7fc; border: 1px solid #e2e9f5; border-radius: 18px; padding: 16px; margin: 4px 0 12px;
}
.story-state-msg b { display: block; font-size: 16px; margin: 0 0 6px; }
.story-state-msg p { margin: 0; font-size: 13px; line-height: 1.5; color: #5a6b86; }

/* Story sheet only — must NOT collide with install done (.flow-success) / pills */
.story-flow-progress {
  display: flex; gap: 6px; margin: 14px 0 18px;
}
.story-flow-progress > span {
  height: 4px; flex: 1; background: #e5eaf4; border-radius: 9px;
}
.story-flow-progress > span.on { background: #3865ed; }
.story-flow-sheet .flow-head {
  font-size: 11px; font-weight: 750; letter-spacing: 1px; color: #7d8ca7; text-transform: uppercase;
}
.story-flow-sheet .flow-title {
  font-size: 27px !important; line-height: 1.15; margin: 8px 0 12px !important; letter-spacing: -0.8px;
}
.story-flow-sheet .flow-copy { font-size: 14px; line-height: 1.6; color: #687893; margin: 0 0 16px; }
.story-flow-sheet .flow-code {
  padding: 20px; text-align: center; background: #edf2ff; border: 1px dashed #b0c1ef;
  border-radius: 18px; margin: 12px 0 16px;
}
.story-flow-sheet .flow-code strong {
  font-size: 26px; letter-spacing: 2px; color: #3457c6; font-variant-numeric: tabular-nums;
  display: block; margin: 8px 0;
}
.story-flow-sheet .flow-code small { color: #7182a4; font-size: 11px; }
.story-flow-sheet .flow-textbtn {
  width: 100%; border: 0; background: none; color: #5c73a5; font: inherit; font-size: 13px;
  padding: 14px 4px; cursor: pointer;
}
.story-flow-sheet .flow-callout {
  padding: 14px; background: #f4f6fb; border-radius: 14px; font-size: 12px; line-height: 1.6;
  color: #62728c; margin: 12px 0;
}
.story-flow-sheet .flow-spinner {
  width: 58px; height: 58px; border: 4px solid #e5ecfb; border-top-color: #3061ed;
  border-radius: 50%; animation: story-spin 1s linear infinite; margin: 28px auto 12px;
}
.story-flow-sheet .flow-status { text-align: center; color: #798ba9; font-size: 12px; margin: 10px 0; min-height: 18px; }
.story-flow-sheet .flow-error-icon { font-size: 32px; padding: 18px; text-align: center; color: #637cad; }
.story-flow-sheet .flow-consent {
  font-size: 12px; line-height: 1.5; display: flex; gap: 9px; color: #677994; margin: 14px 0;
}
.story-flow-sheet .flow-consent input { width: 18px; height: 18px; flex: none; accent-color: #3061ed; }
.story-flow-sheet .flow-candidates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px;
}
.story-flow-sheet .flow-candidate {
  padding: 0; border: 2px solid transparent; overflow: hidden; border-radius: 18px;
  background: #f0f4ff; text-align: left; color: #263957; cursor: pointer; font: inherit;
}
.story-flow-sheet .flow-candidate.selected { border-color: #3061ed; box-shadow: 0 0 0 3px rgba(48, 97, 237, 0.12); }
.story-flow-sheet .flow-candidate.bad { opacity: 0.72; }
.story-flow-sheet .flow-thumb {
  min-height: 140px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: #dfe8ff; padding: 14px; text-align: center;
}
.story-flow-sheet .flow-thumb b { font-size: 15px; line-height: 1.25; margin-top: 8px; }
.story-flow-sheet .flow-thumb small { font-size: 10px; color: #536b9c; margin-top: 8px; }
.story-flow-sheet .flow-candidate footer {
  font-size: 11px; line-height: 1.45; padding: 10px 12px; background: #fff;
  border-top: 1px solid #e5ecfb;
}
.story-flow-sheet .flow-ref-ok { color: #17613a; font-weight: 700; }
.story-flow-sheet .flow-ref-bad { color: #b43e42; font-weight: 700; }
.story-fine { font-size: 11px; color: #8a97ad; line-height: 1.45; margin: 10px 0 4px; }
@keyframes story-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .story-flow-sheet .flow-spinner { animation: none; } }
html.dark .story-card, body.theme-dark .story-card {
  background: linear-gradient(135deg, rgba(36, 79, 219, 0.28), rgba(113, 52, 190, 0.22));
  border-color: rgba(147, 197, 253, 0.28);
}
html.dark .story-card b, body.theme-dark .story-card b { color: #dbe7ff; }
html.dark .story-card small, body.theme-dark .story-card small { color: #a8b8d8; }
html.dark .story-hero, body.theme-dark .story-hero {
  background: rgba(47, 93, 227, 0.18); border-color: rgba(147, 197, 253, 0.22);
}
.bonus-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center;
}
.bonus-stats b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.bonus-stats span { font-size: 11px; color: var(--muted); }
.bonus-stats > div + div { border-left: 0.5px solid var(--line); }
.bonus-hist-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 0.5px solid var(--line); font-size: 14px;
}
.bonus-hist-item:last-child { border-bottom: 0; }
.bonus-hist-item .t { font-weight: 600; }
.bonus-hist-item .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bonus-hist-item .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bonus-hist-item .amt.plus { color: var(--ok-fg); }
.bonus-box {
  background: #eef3ff; border: 1px solid #dce6ff; border-radius: 18px;
  padding: 14px 14px 10px; margin: 0 0 10px;
}
html.dark .bonus-box, body.theme-dark .bonus-box {
  background: #0a2540; border-color: rgba(10,132,255,0.28);
}
.bonus-box.is-blocked { opacity: 0.55; }
.bonus-box .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.bonus-title { font-weight: 700; font-size: 15px; }
.bonus-available { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bonus-amount {
  color: #234fc9; background: #fff; border-radius: 10px; padding: 7px 9px;
  white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px;
}
html.dark .bonus-amount, body.theme-dark .bonus-amount {
  background: #1c1c1e; color: #7dcfff;
}
.bonus-box input[type=range] {
  display: block; width: 100%; height: 32px; margin: 4px 0 0;
  accent-color: var(--accent); cursor: pointer;
}
.pay-cashback {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 0 0 4px;
  background: #e8f8ee; color: #17613a; border-radius: 12px; font-size: 14px; font-weight: 600;
}
html.dark .pay-cashback, body.theme-dark .pay-cashback {
  background: #0f2918; color: #7dff9a;
}
.pay-cashback strong { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.tabbar.hidden { display: none !important; }
.tabbar button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 500; padding: 4px 2px; cursor: pointer;
  line-height: 1.2;
}
.tabbar button .ico {
  display: grid; place-items: center; height: 26px; margin-bottom: 2px; line-height: 1;
}
.tabbar button .ico svg { display: block; width: 24px; height: 24px; }
.tabbar button.on { color: var(--accent); font-weight: 600; }
.tabbar button.on .ico svg { stroke-width: 2.1; }

.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.sheet-sticky-pay {
  display: flex; flex-direction: column;
  padding-bottom: 0; overflow: hidden;
}
.sheet.sheet-sticky-pay .sheet-scroll {
  overflow: auto; flex: 1; min-height: 0;
  padding-bottom: 8px;
}
.sheet.sheet-sticky-pay .sheet-sticky {
  flex-shrink: 0;
  padding: 10px 0 calc(16px + var(--safe-bottom));
  background: var(--sheet-bg);
  border-top: 0.5px solid var(--line);
}
.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,
.flow-acc .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; flex-shrink: 0; padding: 0;
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.qr-btn:disabled { opacity: .45; cursor: default; }
.qr-btn svg { display: block; width: 24px; height: 24px; }
.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); } }

/* Cold-start catalog / order skeleton (same tokens as shop UI) */
@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.sk {
  background: linear-gradient(90deg, var(--fill) 20%, var(--fill-press) 50%, var(--fill) 80%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.15s ease-in-out infinite;
  border-radius: 12px;
}
.sk-search { height: 44px; border-radius: 14px; margin-bottom: 14px; }
.sk-banner {
  aspect-ratio: 2.2 / 1;
  border-radius: 20px;
  margin: 0 0 16px;
}
.sk-chips {
  display: flex; gap: 8px; height: 38px; overflow: hidden;
  margin: 0 0 16px;
}
.sk-chip { width: 72px; height: 38px; border-radius: 20px; flex: none; }
.sk-ico { width: 64px; height: 64px; border-radius: 15px; }
.sk-lab { width: 56px; height: 10px; margin: 4px auto 0; border-radius: 6px; }
.sk-order-card {
  pointer-events: none;
  cursor: default;
}
.sk-order-card .order-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.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-methods {
  background: var(--soft); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px;
}
.pay-methods-title {
  font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 8px;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.pay-methods-compact {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 12px 0 8px; padding: 0;
}
.pay-logos {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px;
}
.pay-logos-sm {
  flex-wrap: nowrap; gap: 4px; margin: 0; justify-content: center;
  overflow-x: auto; max-width: 100%;
}
.pay-logos-sm .pay-logo { padding: 2px 4px; border-radius: 6px; }
.pay-logos-sm .pay-logo svg { width: 40px; height: 18px; }
.pay-logos-sm .pay-bank-logo { width: 40px; height: 22px; }
.pay-tbank-link-sm {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-decoration: none;
}
.pay-tbank-link-sm:active { color: var(--green); }
.pay-sheet-sub {
  margin: -4px 0 12px; font-size: 14px; font-weight: 600; color: var(--muted);
}
.sheet-title.pay-sheet-price {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 0;
}
.pay-promo-slim {
  padding: 10px 12px; margin: 0 0 10px;
}
.pay-promo-slim .pay-promo-top { display: none; }
.pay-promo-slim .pay-promo-row { margin: 0; }
.pay-promo-slim .pay-promo-sub {
  margin: 6px 0 0; font-size: 12px; font-weight: 600;
}
.pay-promo-slim .pay-promo-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 800;
  padding: 4px 8px; border-radius: 8px; background: var(--green-soft); color: var(--green);
}
.pay-sum-cta {
  margin: 0 0 4px; padding: 12px 14px 14px;
}
.pay-sum-cta .pay-sum-row { font-size: 17px; margin: 2px 0; }
.pay-sum-cta .pay-disc { color: var(--green); margin: 2px 0 10px; min-height: 0; }
.pay-cta {
  width: 100% !important; margin: 8px 0 0 !important;
  padding: 14px 16px !important; font-size: 16px !important; border-radius: 14px !important;
}
.pay-sheet-foot {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 4px 2px; margin: 4px 0 0; text-align: center;
}
.pay-sheet-dot { color: var(--muted); font-size: 12px; opacity: .6; }
.link-muted {
  border: 0; background: none; padding: 4px 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted); font: inherit;
}
.link-muted:active { color: var(--green); }
.pay-warn-inline {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; line-height: 1.4;
}
.pay-warn-inline ul { margin: 0; padding-left: 18px; }
.pay-logo {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 8px; padding: 4px 6px;
  border: 0.5px solid var(--line); line-height: 0;
  text-decoration: none;
}
.pay-logo-bank { padding: 2px 4px; }
.pay-bank-logo {
  display: block; width: 52px; height: 28px; object-fit: contain;
  border-radius: 6px;
}
html.dark .pay-logo, body.theme-dark .pay-logo { background: #2c2c2e; }
.pay-tbank-link {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--green);
  text-decoration: underline; text-underline-offset: 2px; line-height: 1.35;
}
.pay-goods-meta { margin: 8px 0 0; line-height: 1.35; }
.legal-tbank-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-top: 12px;
}
.legal-tbank-logo { display: inline-flex; line-height: 0; }
.doc-req {
  background: var(--soft); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px;
  font-size: 13px; line-height: 1.45;
}
.doc-req a { color: var(--green); font-weight: 600; }
/* Catalog Connect CTA — Glass indigo + longer orbit arc */
@property --connect-cta-ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
button.connect-cta {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  display: block;
  margin: 16px 0 12px;
  padding: 1.5px;
  border-radius: 18px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  background: conic-gradient(
    from var(--connect-cta-ang, 0deg),
    transparent 0 55%,
    #5b8cff 62%,
    #a78bfa 70%,
    #7dd3fc 78%,
    transparent 86% 100%
  );
  animation: connectCtaOrbit 4.2s linear infinite;
  box-shadow: 0 10px 28px rgba(70, 90, 160, 0.1);
}
.connect-cta-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 13px 13px 15px;
  border-radius: 16.5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(232, 240, 255, 0.58)),
    linear-gradient(160deg, #eef3ff 0%, #f7f9ff 55%, #ebe7ff 100%);
}
.connect-cta-ico {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(160deg, #5b8cff, #3a63f0);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(58, 99, 240, 0.28);
}
.connect-cta-copy { flex: 1; min-width: 0; }
.connect-cta-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d7ea3;
  margin-bottom: 2px;
}
.connect-cta-main {
  display: block;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.connect-cta .hi { color: #2f62ef; font-weight: 780; }
.connect-cta-chev {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #3a63f0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  border: 0.5px solid rgba(90, 120, 200, 0.18);
}
.connect-cta:active { opacity: 0.92; transform: scale(0.995); }
@keyframes connectCtaOrbit {
  to { --connect-cta-ang: 360deg; }
}
@supports not (background: conic-gradient(from var(--connect-cta-ang), red, blue)) {
  button.connect-cta {
    background: linear-gradient(135deg, #9bb8ff, #c4b5ff, #7ec8ff, #9bb8ff);
    background-size: 220% 220%;
    animation: connectCtaBorderShift 5s ease infinite;
  }
  @keyframes connectCtaBorderShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  button.connect-cta { animation: none; }
}
html.dark button.connect-cta,
body.theme-dark button.connect-cta {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  background: conic-gradient(
    from var(--connect-cta-ang, 0deg),
    transparent 0 55%,
    #6ea2ff 62%,
    #b39af8 70%,
    #67c8f5 78%,
    transparent 86% 100%
  );
}
html.dark .connect-cta-inner,
body.theme-dark .connect-cta-inner {
  background:
    linear-gradient(135deg, rgba(40, 48, 72, 0.92), rgba(28, 34, 56, 0.88)),
    linear-gradient(160deg, #1c2238 0%, #232a44 100%);
}
html.dark .connect-cta-kicker,
body.theme-dark .connect-cta-kicker { color: #93a0c0; }
html.dark .connect-cta .hi,
body.theme-dark .connect-cta .hi { color: #8eb6ff; }
html.dark .connect-cta-chev,
body.theme-dark .connect-cta-chev {
  background: rgba(255, 255, 255, 0.08);
  color: #9ec5ff;
  border-color: rgba(255, 255, 255, 0.12);
}

.shop-legal-footer {
  margin: 16px 0 8px;
  padding: 14px 12px 12px;
  background: var(--soft);
  border-radius: 14px;
  border: 0.5px solid var(--line);
  text-align: center;
}
.shop-legal-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin: 0 0 10px;
}
.shop-legal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shop-legal-footer .legal-link,
button.legal-link {
  appearance: none;
  border: 0.5px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.shop-legal-footer .legal-link:active { opacity: 0.75; }
.legal-tbank {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  line-height: 1.35;
}
.legal-tbank:active { opacity: 0.8; }
.shop-legal-disclaimer {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}
.pay-promo {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(52, 199, 89, 0.10), rgba(52, 199, 89, 0.02) 55%, transparent),
    var(--soft);
  border: 1px solid rgba(52, 199, 89, 0.18);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pay-promo.is-ok {
  background:
    linear-gradient(135deg, rgba(52, 199, 89, 0.18), rgba(52, 199, 89, 0.05) 60%, transparent),
    var(--green-soft);
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.08);
}
.pay-promo.is-test {
  background:
    linear-gradient(135deg, rgba(255, 159, 10, 0.16), rgba(255, 159, 10, 0.04) 60%, transparent),
    var(--soft);
  border-color: rgba(255, 159, 10, 0.35);
  box-shadow: none;
}
.pay-promo.is-err {
  background:
    linear-gradient(135deg, rgba(255, 59, 48, 0.10), transparent 60%),
    var(--soft);
  border-color: rgba(255, 59, 48, 0.28);
}
.pay-promo-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pay-promo-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #34c759, #248a3d);
  letter-spacing: -0.02em;
}
.pay-promo.is-test .pay-promo-ico {
  background: linear-gradient(145deg, #ff9f0a, #c77700);
}
.pay-promo.is-err .pay-promo-ico {
  background: linear-gradient(145deg, #ff6961, #c41e3a);
}
.pay-promo-copy { min-width: 0; flex: 1; }
.pay-promo-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.pay-promo-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.pay-promo.is-ok .pay-promo-sub { color: var(--green-dark); }
.pay-promo.is-test .pay-promo-sub { color: #a15c00; }
.pay-promo.is-err .pay-promo-sub { color: var(--danger-fg); }
html.dark .pay-promo.is-ok .pay-promo-sub,
body.theme-dark .pay-promo.is-ok .pay-promo-sub { color: #7dff9a; }
html.dark .pay-promo.is-test .pay-promo-sub,
body.theme-dark .pay-promo.is-test .pay-promo-sub { color: #ffd60a; }
.pay-promo-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  line-height: 1;
}
.pay-promo.is-test .pay-promo-badge {
  background: #ff9f0a;
  color: #1c1c1e;
}
.pay-promo-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.pay-promo-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.pay-promo-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--input-fg);
  border-radius: 12px;
  padding: 11px 38px 11px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pay-promo-input::placeholder {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}
.pay-promo-input:focus {
  border-color: rgba(52, 199, 89, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}
.pay-promo.is-err .pay-promo-input:focus {
  border-color: rgba(255, 59, 48, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}
.pay-promo-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--btn-secondary-bg);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.pay-promo-clear:active { opacity: 0.75; }
.pay-promo-apply {
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  min-width: 96px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.pay-promo-apply:active { transform: scale(0.97); }
.pay-promo.is-ok .pay-promo-apply {
  background: var(--green);
  color: #fff;
  min-width: 48px;
}
.pay-promo.is-test .pay-promo-apply {
  background: #ff9f0a;
  color: #1c1c1e;
}

.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; }

.pay-fail-card {
  background: #fff1f0; border-radius: 16px; padding: 16px;
  text-align: center; margin: 0 0 12px;
}
.pay-fail-title { font-size: 18px; font-weight: 800; margin: 0 0 6px; color: #c41e3a; }
.pay-fail-msg { margin: 0; font-size: 14px; line-height: 1.4; color: #8a1f2b; }
html.dark .pay-fail-card, body.theme-dark .pay-fail-card {
  background: #3a1416; color: #ff8a80;
}
html.dark .pay-fail-title, body.theme-dark .pay-fail-title { color: #ff8a80; }
html.dark .pay-fail-msg, body.theme-dark .pay-fail-msg { color: #ffcdd2; }

.pay-refund-card {
  background: var(--fill); border-radius: 16px; padding: 16px;
  text-align: center; margin: 0 0 12px;
}
.pay-refund-title { font-size: 18px; font-weight: 800; margin: 0 0 6px; color: var(--text); }
.pay-refund-msg { margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.orders-h1 { margin: 4px 0 14px !important; font-size: 28px !important; }
.orders-sec {
  font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em;
  text-transform: uppercase; margin: 4px 0 10px;
}
.orders-sec-hist { margin-top: 22px; }
.orders-empty {
  text-align: center; background: var(--fill); border-radius: 20px;
  padding: 36px 20px 24px; margin-top: 12px;
}
.orders-empty-ico {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 16px;
  background: var(--panel); color: var(--text); display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.orders-empty h2 { margin: 0 0 8px; font-size: 20px; }
.orders-empty .muted { margin: 0 0 18px; font-size: 14px; line-height: 1.4; }
.orders-empty .flow-primary { max-width: 280px; margin: 0 auto !important; }

.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: var(--fill); border-radius: 18px; padding: 16px;
  font: inherit; color: inherit;
  transition: transform .12s ease, background .12s ease;
}
.order-card:active { transform: scale(0.985); background: var(--fill-press); }
.order-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 12px;
}
.order-no { font-size: 12px; color: var(--muted); font-weight: 600; }
.order-top-right {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  flex-shrink: 0;
}
.ttl-chip {
  font-size: 11px; font-weight: 750; padding: 5px 9px; border-radius: 99px;
  background: rgba(142, 142, 147, 0.16); color: #636366; white-space: nowrap;
}
.ttl-chip.warn {
  background: rgba(255, 149, 0, 0.18); color: #9a5b00;
}
.install-ttl-chip {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 750; padding: 5px 10px; border-radius: 99px;
  background: rgba(142, 142, 147, 0.16); color: #636366;
  margin: 0 0 10px;
}
.install-ttl-chip.warn {
  background: rgba(255, 149, 0, 0.18); color: #9a5b00;
}
.install-ttl-chip + .flow-h1 { margin-top: 0 !important; }
html.dark .ttl-chip, body.theme-dark .ttl-chip {
  background: rgba(142, 142, 147, 0.28); color: #aeaeb2;
}
html.dark .ttl-chip.warn, body.theme-dark .ttl-chip.warn {
  background: rgba(255, 149, 0, 0.22); color: #ffd60a;
}
html.dark .install-ttl-chip, body.theme-dark .install-ttl-chip {
  background: rgba(142, 142, 147, 0.28); color: #aeaeb2;
}
html.dark .install-ttl-chip.warn, body.theme-dark .install-ttl-chip.warn {
  background: rgba(255, 149, 0, 0.22); color: #ffd60a;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .ttl-chip { background: rgba(142, 142, 147, 0.28); color: #aeaeb2; }
  html:not(.light) .ttl-chip.warn { background: rgba(255, 149, 0, 0.22); color: #ffd60a; }
  html:not(.light) .install-ttl-chip { background: rgba(142, 142, 147, 0.28); color: #aeaeb2; }
  html:not(.light) .install-ttl-chip.warn { background: rgba(255, 149, 0, 0.22); color: #ffd60a; }
}
.order-st {
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 99px;
  background: var(--btn-secondary-bg); color: var(--muted); white-space: nowrap; flex-shrink: 0;
}
.order-st.st-pay { background: var(--st-pay-bg); color: var(--st-pay-fg); }
.order-st.st-active { background: var(--st-active-bg); color: var(--st-active-fg); }
.order-st.st-done { background: var(--st-done-bg); color: var(--st-done-fg); }
.order-st.st-dead { background: var(--st-dead-bg); color: var(--st-dead-fg); }
.order-card-body {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.order-card-body.is-single .oc-text { min-width: 0; }
.oc-ico-lg, img.oc-ico-lg {
  width: 44px; height: 44px; border-radius: 11px; object-fit: cover;
  flex-shrink: 0; background: var(--panel);
}
.oc-icons { display: flex; align-items: center; flex-shrink: 0; }
.oc-ico, img.oc-ico {
  width: 36px; height: 36px; border-radius: 10px; object-fit: cover;
  background: var(--panel); box-shadow: 0 0 0 2px var(--fill); margin-left: -8px;
}
.oc-icons .oc-ico:first-child, .oc-icons img.oc-ico:first-child { margin-left: 0; }
.oc-more {
  margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.order-card-title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.25; }
.oc-sub {
  margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.order-card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.oc-sum { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.oc-action {
  font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 12px;
  white-space: nowrap;
}
.oc-action.oa-go { background: var(--inverse-bg); color: var(--inverse-fg); }
.oc-action.oa-pay { background: #22c55e; color: #fff; }
.oc-action.oa-open {
  background: var(--panel); color: var(--text);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.oc-ico.icon-fallback, .oc-ico-lg.icon-fallback {
  color: var(--text); background: var(--btn-secondary-bg);
}

.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; }

/* --- 3-step install / activation flow (mockup) --- */
.flow-screen { padding-bottom: 8px; }
.flow-h1 {
  font-size: 24px !important; margin: 10px 0 12px !important; line-height: 1.2;
  letter-spacing: -0.02em; font-weight: 700;
}
.flow-watch {
  appearance: none; width: 100%; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px; padding: 12px 14px;
  border-radius: 16px;
  background: var(--accent, #007aff);
  color: #fff;
  text-align: left;
}
.flow-watch:active { background: var(--accent-dark, #0062cc); }
.flow-watch-ico {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.22);
}
.flow-watch-ico svg { display: block; margin-left: 2px; }
.flow-watch-txt { flex: 1; min-width: 0; }
.flow-watch-txt strong {
  display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.02em;
}
.flow-watch-txt span {
  display: block; margin-top: 2px; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.78);
}
.flow-watch-chev { opacity: .7; font-size: 20px; line-height: 1; }
.flow-top { display: flex; align-items: center; margin-bottom: 2px; }
.flow-top .back-link { margin: 0; font-size: 15px; padding-bottom: 4px; }

.flow-progress {
  display: flex; align-items: center; gap: 6px; margin: 6px 0 14px; flex-wrap: nowrap;
}
.flow-progress .pill {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; font-size: 12px; font-weight: 700; padding: 8px 8px;
  border-radius: 999px; background: var(--soft); color: var(--muted);
}
.flow-progress .pill .flow-lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-progress .pill .flow-n {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--btn-secondary-bg); color: var(--muted);
}
.flow-progress .pill.on {
  background: var(--inverse-bg); color: var(--inverse-fg);
}
.flow-progress .pill.on .flow-n {
  background: var(--inverse-fg); color: var(--inverse-bg);
}
.flow-progress .pill.done {
  background: transparent; color: #16a34a; padding-left: 2px; padding-right: 2px; flex: 0 1 auto;
}
.flow-progress .pill.done .flow-n.check {
  background: #16a34a; color: #fff; font-size: 11px;
}
.flow-progress .pill.soon { background: var(--soft); color: var(--muted); }
.flow-conn {
  width: 10px; height: 2px; background: #16a34a; border-radius: 2px; flex-shrink: 0;
}

.flow-lead { margin: 0 0 12px; line-height: 1.4; font-size: 14px; color: var(--muted); }
.flow-parts-line {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}
.flow-parts-line b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Split set: N этапов · sizes per Apple ID (install / activation) */
.flow-stages-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}
.flow-stages-badge b {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.flow-stages-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: #fff;
  padding: 3px 6px;
  border-radius: 7px;
}
.flow-stages-split {
  flex-basis: 100%;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.flow-stages-split b {
  color: var(--accent);
}

.flow-apps {
  background: var(--fill); border-radius: 18px; padding: 12px 14px; margin: 0 0 12px;
  border: 0; box-shadow: none;
}
.flow-screen > .flow-h1 + .flow-apps { margin-top: 0; }
.flow-app-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 0.5px solid var(--hairline);
}
.flow-app-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.flow-app-ico, img.flow-app-ico {
  width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--btn-secondary-bg);
}
.flow-app-row .meta { flex: 1; min-width: 0; }
.flow-app-row .name { font-weight: 700; font-size: 15px; line-height: 1.2; color: var(--text); }
.flow-app-row .st { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.flow-app-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.flow-inst-pill {
  appearance: none; border: 0; cursor: pointer;
  background: var(--inverse-bg); color: var(--inverse-fg); font-weight: 700; font-size: 13px;
  padding: 10px 14px; border-radius: 12px; white-space: nowrap;
}
.flow-inst-pill:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.flow-inst-pill.flow-inst-confirm {
  background: #16a34a;
  color: #fff;
}
.flow-app-row .st.st-wait { color: #ca8a04; font-weight: 600; }
.flow-qr-sq {
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--text); display: grid; place-items: center;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.flow-qr-sq svg { display: block; }

.flow-acc {
  background: var(--fill); border-radius: 18px; margin: 0 0 12px; padding: 0 16px;
}
.flow-acc summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 15px;
  padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  line-height: 1.3;
}
.flow-acc summary::-webkit-details-marker { display: none; }
.flow-acc summary::after {
  content: ""; width: 10px; height: 10px; flex-shrink: 0;
  border-right: 2px solid #8e8e93; border-bottom: 2px solid #8e8e93;
  transform: rotate(45deg); margin-top: -4px;
  transition: transform .15s ease;
}
.flow-acc[open] summary::after {
  transform: rotate(-135deg); margin-top: 4px;
}
.flow-acc-body { padding: 0 0 14px; }
.flow-help-body .btn { margin-top: 4px; }

.guide-mini-row {
  display: flex; align-items: flex-start; justify-content: center; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 0 4px;
}
.guide-mini-arrow {
  color: #8e8e93; font-size: 16px; font-weight: 700; padding-top: 42px; flex-shrink: 0;
}
.guide-mini {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  width: 96px; flex-shrink: 0; text-align: center; position: relative;
}
.guide-mini img {
  width: 96px; height: 170px; object-fit: cover; border-radius: 14px;
  background: var(--panel); box-shadow: 0 2px 10px rgba(0,0,0,.08);
  display: block;
}
.guide-mini-num {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  width: 22px; height: 22px; border-radius: 50%;
  background: #16a34a; color: #fff; font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.guide-mini-cap {
  display: block; margin-top: 8px; font-size: 11px; font-weight: 600;
  line-height: 1.3; color: var(--text); text-align: center; opacity: 0.85;
}

.guide-steps {
  display: flex; flex-direction: column; gap: 10px;
}
.guide-step {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 28px 72px 1fr; gap: 10px; align-items: center;
  background: var(--panel); border-radius: 14px; padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.guide-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #16a34a; color: #fff; font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}
.guide-step-img {
  width: 72px; height: 128px; object-fit: cover; border-radius: 10px;
  background: var(--soft); display: block;
}
.guide-step-cap {
  font-size: 14px; font-weight: 650; line-height: 1.3; color: var(--text);
}

.flow-info {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--info-bg); color: var(--info-fg); border-radius: 14px;
  padding: 12px 14px; margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 1.35;
}
.flow-info-i {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--info-fg); color: #fff; font-size: 13px; font-weight: 800;
  font-style: italic; display: grid; place-items: center; margin-top: 1px;
}
.flow-info-warn {
  background: var(--warn-bg); color: var(--warn-fg);
}
.flow-info-warn .flow-info-i {
  background: var(--warn-fg);
}

.flow-appstore-hint {
  border: 1px solid rgba(29, 78, 216, 0.18);
}
.flow-appstore-hint b {
  font-weight: 800;
}
.flow-support-btn {
  width: 100%;
  margin-top: 8px;
}

.flow-stage-banner {
  background: var(--info-bg); color: var(--info-fg); border-radius: 14px;
  padding: 12px 14px; margin: 0 0 12px;
}
.flow-stage-lead { font-size: 14px; font-weight: 700; line-height: 1.3; }
.flow-stage-meta { font-size: 13px; font-weight: 600; margin-top: 4px; opacity: .85; }

.flow-app-row .st.st-warn { color: #c00; font-weight: 700; }
.flow-apps-preview .flow-app-actions { display: none; }
.flow-apps-preview { margin-bottom: 12px; }

.flow-act-hint {
  font-size: 14px; line-height: 1.35; color: var(--muted, #8e8e93);
  margin: 0 0 12px;
}
.flow-act-hint-warn {
  color: #b45309; font-weight: 600; margin-top: -4px;
}
.flow-act-creds { margin: 0 0 14px; }

.flow-apps-compact {
  margin: 0 0 12px;
  border-radius: 14px;
  background: var(--fill);
  padding: 0;
}
.flow-apps-compact > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.flow-apps-compact > summary::-webkit-details-marker { display: none; }
.flow-apps-compact-icos {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.flow-apps-compact-icos .flow-app-ico-sm {
  width: 28px; height: 28px; border-radius: 7px;
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--fill);
}
.flow-apps-compact-icos .flow-app-ico-sm:first-child { margin-left: 0; }
.flow-apps-compact-txt {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flow-apps-compact-list {
  list-style: none; margin: 0; padding: 0 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.flow-apps-compact-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
}
.flow-app-ico-sm {
  width: 28px; height: 28px; border-radius: 7px; object-fit: cover; flex-shrink: 0;
  display: block;
}

.flow-route {
  background: var(--fill); border-radius: 18px; padding: 14px; margin: 0 0 12px;
}
.flow-route-lab { font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.flow-route-path {
  font-size: 14px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; color: var(--text);
}

.flow-cred-card {
  background: var(--fill); border-radius: 16px; padding: 12px 14px; margin: 0 0 10px;
}
.flow-cred-card .lab { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.flow-cred-card .valrow { display: flex; align-items: center; gap: 10px; }
.flow-cred-card code {
  flex: 1; font-size: 16px; font-weight: 700; word-break: break-all; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.flow-cred-card .copy-btn {
  border: 0; background: #22c55e; color: #fff; font-weight: 700;
  font-size: 13px; padding: 9px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap;
}

.flow-code-vpn {
  margin: 0 0 10px;
}
.flow-code-card {
  background: var(--panel); border: 0.5px solid var(--hairline);
  border-radius: 16px; padding: 16px 14px; margin: 0 0 8px;
}
.flow-code-card.has-code {
  background: var(--ok-bg); border-color: transparent;
}
.flow-code-lab { font-size: 13px; font-weight: 700; color: var(--ok-fg); margin-bottom: 4px; text-align: center; }
.flow-code-card .code-box {
  background: var(--surface); margin: 6px 0 8px; font-size: 34px; padding: 14px; border-radius: 14px;
}
.flow-code-card .wait-box { padding: 18px 10px; margin: 0; background: transparent; }
.flow-link-btn {
  display: block; width: 100%; border: 0; background: none; cursor: pointer;
  color: var(--info-fg); font-weight: 700; font-size: 14px; padding: 8px; text-align: center;
}
.flow-code-next {
  display: block; width: 100%; margin: 4px 0 0; cursor: pointer;
  appearance: none; border: 0.5px solid var(--hairline);
  background: var(--fill); color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.2;
  padding: 12px 14px; border-radius: 14px; text-align: center;
}
.flow-code-next:disabled { opacity: 0.45; cursor: default; }
.flow-code-next:active:not(:disabled) { background: var(--fill-press); }

.flow-codes-exhausted {
  margin: 10px 0 0;
}
.flow-exhausted-msg {
  margin: 0 0 10px; font-size: 14px; font-weight: 600; line-height: 1.35;
  color: var(--text); text-align: center;
}
.flow-codes-exhausted .flow-primary { margin: 0 !important; }

.flow-wait-card {
  background: var(--warn-bg); color: var(--warn-fg); border-radius: 16px; padding: 18px 16px;
  text-align: center; margin: 0 0 12px;
}
.flow-wait-title {
  font-size: 18px; font-weight: 800; margin: 0 0 6px;
}
.flow-wait-msg {
  margin: 0; font-size: 14px; line-height: 1.4; color: inherit; opacity: 0.92;
}
.flow-wait-timer {
  font-size: 40px; font-weight: 800; letter-spacing: .04em;
  margin: 10px 0 8px; font-variant-numeric: tabular-nums;
}
.flow-wait-note {
  margin: 0 0 12px; font-size: 13px; line-height: 1.35; opacity: 0.85;
}

.consent-gate {
  min-height: 70vh; display: flex; flex-direction: column;
  justify-content: center; padding: 24px 8px 40px; text-align: center;
}
.consent-title {
  font-size: 28px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em;
}
.consent-msg {
  margin: 0 0 20px; font-size: 15px; line-height: 1.45; color: var(--muted);
}
.consent-links {
  display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px;
}
.consent-checks { margin: 0 0 6px; }
.consent-check {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left; margin: 0 0 14px; font-size: 14px; line-height: 1.4;
  font-weight: 600;
}
.consent-check.consent-muted,
.consent-check.consent-opt {
  font-weight: 550; color: var(--muted);
}
.consent-check .consent-opt-txt { color: var(--muted); font-weight: 550; }
.consent-check input {
  width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0;
  accent-color: #8e8e93;
}
.consent-doc-link {
  border: 0; background: none; padding: 0; margin: 0;
  color: var(--muted); font: inherit; font-weight: 550; cursor: pointer;
  text-align: left; text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: rgba(142, 142, 147, 0.55);
}
html.dark .consent-gate .btn.secondary,
body.theme-dark .consent-gate .btn.secondary {
  background: var(--soft); color: var(--text);
}

.faq-list {
  background: var(--soft); border-radius: 18px; overflow: hidden;
  margin: 0 0 4px;
}
.faq-item { border-bottom: 0.5px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 16px; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 650; line-height: 1.3;
}
.faq-q-text { flex: 1; min-width: 0; }
.faq-q .chev {
  width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}
.faq-item.open .faq-q .chev { transform: rotate(-135deg); margin-top: 4px; }
.faq-a {
  display: none; padding: 0 16px 16px;
  font-size: 15px; line-height: 1.45; color: var(--muted);
}
.faq-item.open .faq-a { display: block; color: var(--text); }
.faq-support {
  display: grid; place-items: center;
  width: 100%; height: 54px; margin: 18px 0 8px;
  border: 0; border-radius: 16px; cursor: pointer;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 17px; font-weight: 700;
}
.faq-support:active { opacity: 0.85; }
html.dark .faq-support, body.theme-dark .faq-support {
  background: var(--green-soft); color: var(--green);
}
html.dark .faq-list, body.theme-dark .faq-list { background: var(--soft); }

.flow-cta {
  position: static;
  transform: none;
  width: 100%;
  margin: 14px 0 0;
  padding: 0 0 8px;
  background: none;
  z-index: auto;
}
.flow-primary {
  height: 54px; padding: 0 16px !important; border-radius: 16px !important;
  background: var(--inverse-bg) !important; color: var(--inverse-fg) !important;
  font-size: 17px !important; font-weight: 700 !important;
  display: grid !important; place-items: center; margin: 0 !important;
}
.flow-acc#help-dl-acc {
  background: var(--panel);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  margin-bottom: 12px;
}

.flow-success {
  position: relative; text-align: center; background: var(--ok-bg); color: var(--text);
  border-radius: 20px; padding: 28px 16px 20px; margin: 8px 0 14px; overflow: hidden;
}
.flow-confetti { position: absolute; inset: 0; pointer-events: none; }
.flow-confetti i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; opacity: .85;
}
.flow-confetti i:nth-child(1) { top: 18%; left: 14%; background: #3b82f6; }
.flow-confetti i:nth-child(2) { top: 22%; right: 18%; background: #f97316; width: 5px; height: 5px; }
.flow-confetti i:nth-child(3) { top: 42%; left: 10%; background: #ef4444; width: 4px; height: 4px; }
.flow-confetti i:nth-child(4) { top: 38%; right: 12%; background: #22c55e; }
.flow-confetti i:nth-child(5) { bottom: 28%; left: 20%; background: #a855f7; width: 5px; height: 5px; }
.flow-confetti i:nth-child(6) { bottom: 22%; right: 22%; background: #eab308; }
.flow-confetti i:nth-child(7) { top: 12%; left: 48%; background: #06b6d4; width: 4px; height: 4px; }
.flow-confetti i:nth-child(8) { bottom: 16%; left: 46%; background: #f43f5e; width: 5px; height: 5px; }
.flow-success-check {
  width: 64px; height: 64px; border-radius: 50%; background: #16a34a; color: #fff;
  display: grid; place-items: center; margin: 0 auto 14px; font-size: 32px; font-weight: 700;
  position: relative; z-index: 1;
}
.flow-success .flow-h1 { position: relative; z-index: 1; margin: 0 0 14px !important; }
.flow-success-apps {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  position: relative; z-index: 1;
}
.flow-success-app {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px;
}
.flow-success-ico, img.flow-success-ico {
  width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: var(--panel);
}

.flow-return {
  background: var(--fill); border-radius: 18px; padding: 16px; margin: 0 0 12px;
}
.flow-return h2 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.flow-steps-list {
  margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.45;
}
.flow-steps-list li { margin: 0 0 8px; }
.flow-return .flow-info { margin: 0; }

/* Dark leftovers that still need stronger contrast than tokens alone */
html.dark .flow-act-hint-warn,
body.theme-dark .flow-act-hint-warn { color: #fbbf24; }
html.dark .flow-app-row .st.st-warn,
body.theme-dark .flow-app-row .st.st-warn { color: #ff6b6b; }
html.dark .flow-app-row .st.st-wait,
body.theme-dark .flow-app-row .st.st-wait { color: #fbbf24; }
html.dark .flow-inst-pill.flow-inst-confirm,
body.theme-dark .flow-inst-pill.flow-inst-confirm { background: #16a34a; color: #fff; }
html.dark .flow-code-card .code-box,
body.theme-dark .flow-code-card .code-box {
  background: #000; color: var(--text);
}
html.dark .flow-info .flow-info-i,
body.theme-dark .flow-info .flow-info-i { color: #04101f; }
html.dark .flow-info-warn .flow-info-i,
body.theme-dark .flow-info-warn .flow-info-i { color: #1a1200; }
html.dark .flow-appstore-hint,
body.theme-dark .flow-appstore-hint {
  border-color: rgba(147, 197, 253, 0.22);
}
html.dark .flow-acc summary::after,
body.theme-dark .flow-acc summary::after {
  border-color: var(--muted);
}
html.dark .search,
body.theme-dark .search {
  background: var(--soft);
}
html.dark .card.white,
body.theme-dark .card.white {
  background: var(--panel);
}
html.dark .list-row,
body.theme-dark .list-row {
  background: var(--card);
}
html.dark .profile-foot,
body.theme-dark .profile-foot,
html.dark .profile-head .name,
body.theme-dark .profile-head .name {
  color: var(--text);
}
html.dark .shop-legal-footer .legal-link,
html.dark button.legal-link,
body.theme-dark .shop-legal-footer .legal-link,
body.theme-dark button.legal-link {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
html.dark .banner-dot,
body.theme-dark .banner-dot {
  background: rgba(255, 255, 255, 0.28);
}
html.dark .banner-dot.on,
body.theme-dark .banner-dot.on {
  background: var(--accent);
}

/* Partner white-label shop shell */
.partner-shop-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--shop-accent, var(--accent)) 12%, var(--soft));
  border: 1px solid color-mix(in srgb, var(--shop-accent, var(--accent)) 28%, transparent);
}
.partner-shop-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.partner-shop-tag {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}
body.partner-shop {
  --accent: var(--shop-accent, #007aff);
  --accent-dark: var(--shop-accent, #007aff);
  --chip-on-bg: var(--shop-accent, #007aff);
  --green: var(--shop-accent, #007aff);
  --green-dark: var(--shop-accent, #007aff);
}
body.partner-shop .chip.on,
body.partner-shop .tabbar button.on {
  color: var(--shop-accent, var(--accent));
}
body.partner-shop .chip.on {
  background: var(--shop-accent, var(--accent));
  color: #fff;
}
body.partner-shop .btn.flow-primary,
body.partner-shop .btn-primary {
  background: var(--shop-accent, var(--accent));
}

/* Active promo from startapp=p_CODE / autopush — E blue */
.promo-active-chip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  background: rgba(52, 199, 89, 0.14);
  border-radius: 14px; font-size: 13px; font-weight: 650;
}
.promo-active-chip .ok {
  width: 22px; height: 22px; border-radius: 50%;
  background: #34c759; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.promo-active-chip b { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.promo-active-chip .link-muted { margin-left: auto; font-size: 12px; }

.promo-chip-e {
  flex-wrap: nowrap;
  gap: 10px;
  background: linear-gradient(90deg, #eef4ff, #f5f8ff);
  border: 1px solid #c7d7ff;
  color: var(--text, #111827);
}
.promo-chip-e .promo-chip-mark {
  width: 28px; height: 28px; border-radius: 10px;
  background: var(--accent, #2f6bff); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.promo-chip-e .promo-chip-txt {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.promo-chip-e .promo-chip-txt strong {
  font-size: 13px; font-weight: 750; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.promo-chip-e .promo-chip-txt small {
  font-size: 11.5px; font-weight: 600; color: var(--muted, #6b7280);
}
.promo-chip-e .promo-chip-off {
  font-size: 12px; font-weight: 800; color: #1d4ed8;
  background: #dbe7ff; padding: 5px 8px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.promo-chip-e .link-muted { margin-left: 0; flex-shrink: 0; }

.cart-price .off {
  font-size: 10px; font-weight: 800;
  background: var(--accent, #2f6bff); color: #fff;
  padding: 2px 6px; border-radius: 999px;
  transform: translateY(-1px);
}
.cart-price .off-muted { background: #6b7280; }

html.dark .promo-chip-e, body.theme-dark .promo-chip-e {
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.18), rgba(47, 107, 255, 0.08));
  border-color: rgba(47, 107, 255, 0.35);
}
html.dark .promo-chip-e .promo-chip-off, body.theme-dark .promo-chip-e .promo-chip-off {
  background: rgba(47, 107, 255, 0.35); color: #dbe7ff;
}

/* ── IAppki (@IAppki_bot / Platega) New Year theme ── */
/* Variant C: solid shop bg, no wallpaper/rings — light+dark with smooth crossfade */
body.iappki-ny {
  --bg: #ffffff;
  --soft: #f2f4f8;
  --card: #ffffff;
  --fill: #f2f4f8;
  --panel: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --chip-on-bg: #007aff;
  --chip-on-fg: #ffffff;
  --accent: #007aff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --tabbar-bg: #ffffff;
  --icon-ring: #ffffff;
  --ny-search-bg: #f4f6fb;
  --ny-chip-off: #eef1f6;
  --ny-chip-off-fg: #111111;
  --ny-line: rgba(127, 127, 127, 0.18);
  background-color: var(--bg);
  background-image: none;
  transition: background-color 0.38s ease, color 0.38s ease;
}
html.dark body.iappki-ny,
body.theme-dark.iappki-ny {
  --bg: #000000;
  --soft: #1c1c1e;
  --card: #1c1c1e;
  --fill: #1c1c1e;
  --panel: #1c1c1e;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --chip-on-bg: #0a84ff;
  --chip-on-fg: #ffffff;
  --accent: #0a84ff;
  --header-bg: rgba(0, 0, 0, 0.92);
  --tabbar-bg: rgba(0, 0, 0, 0.94);
  --icon-ring: #000000;
  --ny-search-bg: #1c1c1e;
  --ny-chip-off: #2c2c2e;
  --ny-chip-off-fg: #f5f5f7;
  --ny-line: rgba(255, 255, 255, 0.12);
}
body.iappki-ny .content {
  background: transparent;
  transition: background-color 0.38s ease;
}
body.iappki-ny .search.ny-search {
  position: relative;
  z-index: 3;
  height: 52px;
  border-radius: 16px;
  background: var(--ny-search-bg);
  border: 0;
  box-shadow: none;
  overflow: visible;
  margin-bottom: 18px;
  transition: background-color 0.38s ease;
}
body.iappki-ny .ny-garland {
  position: absolute;
  right: 6px;
  height: 46px;
  width: auto;
  max-width: 42%;
  pointer-events: none;
  z-index: 4;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
  transition: opacity 0.38s ease;
}
/* Light: trees sit on the search floor */
body.iappki-ny .ny-decor-light {
  bottom: 2px;
  top: auto;
  object-position: right bottom;
  opacity: 1;
}
/* Dark: gold baubles hang from the top edge (HQ asset) */
body.iappki-ny .ny-decor-dark {
  top: 1px;
  bottom: auto;
  height: 50px;
  right: 8px;
  object-position: right top;
  opacity: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}
html.dark body.iappki-ny .ny-decor-light,
body.theme-dark.iappki-ny .ny-decor-light { opacity: 0; }
html.dark body.iappki-ny .ny-decor-dark,
body.theme-dark.iappki-ny .ny-decor-dark { opacity: 1; }
body.iappki-ny .search.ny-search input {
  padding-right: min(42%, 150px);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.38s ease;
}
body.iappki-ny .banner-slide-static,
body.iappki-ny .banner-slide.banner-slide-static {
  cursor: default;
  pointer-events: none;
  position: relative;
}
body.iappki-ny .banner-carousel.ny-banners .banner-track {
  pointer-events: auto; /* allow swipe */
}
body.iappki-ny .banner-carousel.ny-banners .banner-slide-static {
  pointer-events: none;
}
body.iappki-ny .ny-ban {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.38s ease;
}
body.iappki-ny .ny-ban-light { opacity: 1; }
body.iappki-ny .ny-ban-dark {
  position: absolute;
  inset: 0;
  opacity: 0;
}
html.dark body.iappki-ny .ny-ban-light,
body.theme-dark.iappki-ny .ny-ban-light { opacity: 0; }
html.dark body.iappki-ny .ny-ban-dark,
body.theme-dark.iappki-ny .ny-ban-dark { opacity: 1; }
body.iappki-ny .banner-dots .banner-dot {
  pointer-events: auto;
  cursor: pointer;
}
body.iappki-ny .ny-chips.chips-wrap {
  height: 44px;
  margin-bottom: 14px;
}
body.iappki-ny .ny-chips .chips {
  height: 68px;
  gap: 10px;
}
body.iappki-ny .ny-chips .chip {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ny-chip-off);
  color: var(--ny-chip-off-fg);
  border: 0;
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: background-color 0.38s ease, color 0.38s ease;
}
body.iappki-ny .ny-chips .chip.on {
  background: var(--chip-on-bg, #007aff);
  color: var(--chip-on-fg, #ffffff);
  border: 0;
  box-shadow: none;
}
html[data-chip-scale="s"] body.iappki-ny .ny-chips .chip,
html[data-chip-scale="m"] body.iappki-ny .ny-chips .chip,
html[data-chip-scale="l"] body.iappki-ny .ny-chips .chip {
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
}
body.iappki-ny .app-grid {
  /* snow hangs past icon corners */
  padding: 12px 8px 16px;
  gap: 18px 10px;
}
body.iappki-ny .app-cell .icon-wrap {
  overflow: visible;
}
body.iappki-ny .app-cell .grid-label {
  color: var(--text);
  transition: color 0.38s ease;
}
/* Icon stays rounded; snow paints on top and overflows evenly */
body.iappki-ny .app-cell .grid-icon,
body.iappki-ny .app-cell .icon-fallback.grid-icon {
  position: relative;
  z-index: 1;
}
body.iappki-ny .ny-snow {
  position: absolute;
  left: 50%;
  top: 50%;
  /* slight overhang so caps sit on icon edge */
  width: 112%;
  height: 112%;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  z-index: 2;
  border-radius: 0;
  filter: drop-shadow(0 1px 1px rgba(20, 50, 90, 0.12));
}
html.dark body.iappki-ny .ny-snow,
body.theme-dark.iappki-ny .ny-snow {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
@media (max-width: 340px) {
  body.iappki-ny .ny-snow {
    width: 114%;
    height: 114%;
  }
}
body.iappki-ny .tabbar {
  background: var(--tabbar-bg, #ffffff);
  border-top: 1px solid var(--ny-line);
  transition: background-color 0.38s ease, border-color 0.38s ease;
}
body.iappki-ny .cart-bar {
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid var(--ny-line);
  transition: background-color 0.38s ease, border-color 0.38s ease, color 0.38s ease;
}
/* Prefer reduced motion: snap, no fade */
@media (prefers-reduced-motion: reduce) {
  body.iappki-ny,
  body.iappki-ny .search.ny-search,
  body.iappki-ny .ny-garland,
  body.iappki-ny .ny-ban,
  body.iappki-ny .ny-chips .chip,
  body.iappki-ny .tabbar,
  body.iappki-ny .cart-bar,
  body.iappki-ny .app-cell .grid-label,
  body.iappki-ny .search.ny-search input {
    transition: none !important;
  }
}

/* Partner dual banners (own image_dark) — no NY snow / no body.iappki-ny */
.banner-carousel[data-dual="1"] .banner-slide,
.banner-carousel[data-dual="1"] .banner-slide-static {
  position: relative;
}
.banner-carousel[data-dual="1"] .ny-ban {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.38s ease;
}
.banner-carousel[data-dual="1"] .ny-ban-light { opacity: 1; }
.banner-carousel[data-dual="1"] .ny-ban-dark {
  position: absolute;
  inset: 0;
  opacity: 0;
}
html.dark .banner-carousel[data-dual="1"] .ny-ban-light,
body.theme-dark .banner-carousel[data-dual="1"] .ny-ban-light { opacity: 0; }
html.dark .banner-carousel[data-dual="1"] .ny-ban-dark,
body.theme-dark .banner-carousel[data-dual="1"] .ny-ban-dark { opacity: 1; }

/* Hard stop: partner storefronts never show NY snow / HQ NY chrome */
body.partner-shop .ny-snow,
body.partner-shop .ny-garland {
  display: none !important;
}
body.partner-shop.iappki-ny {
  /* if class leaked before storefront resolve — neutralize NY tokens */
  background-image: none;
}
