/* webapp.css — стили мини-приложения «Сказочная студия»
   Участвует: webapp.html, webapp.js. Брейкпоинты: >1024 компьютер, 768–1024 планшет (иконки), <768 телефон (нижние вкладки) */

:root {
  --bg: #0b0918;
  --bg-2: #14102a;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-2: rgba(255, 255, 255, 0.18);
  --text: #f6f3ff;
  --muted: #a9a3c4;
  --accent: #ff7a3d;
  --accent-2: #ff4f8b;
  --violet: #8b5cf6;
  --teal: #2dd4bf;
  --gold: #ffc65c;
  --ok: #3ddc97;
  --danger: #ff5d6c;
  --grad: linear-gradient(135deg, #ff8a3d 0%, #ff4f8b 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 138, 61, .18), rgba(168, 85, 247, .18));
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --glow: 0 10px 40px rgba(255, 95, 120, .35);
  --side-w: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-h: "Unbounded", "Nunito", system-ui, sans-serif;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: var(--text); }
h1, h2, h3 { font-family: var(--font-h); margin: 0; letter-spacing: -.01em; }

/* ---------- [WEBAPP] небо ---------- */
.sky-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 700px at 80% -10%, #2a1650 0%, transparent 60%), radial-gradient(900px 600px at -10% 30%, #1a1240 0%, transparent 60%), var(--bg); }
.sky-aurora { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; animation: sky-aurora-drift 22s ease-in-out infinite alternate; }
.sky-aurora-a { width: 520px; height: 520px; background: #ff6a3d; top: -160px; right: -120px; opacity: .28; }
.sky-aurora-b { width: 600px; height: 600px; background: #7c3aed; bottom: -260px; left: -180px; animation-duration: 28s; }
.sky-aurora-c { width: 380px; height: 380px; background: #0ea5a4; top: 40%; right: 20%; opacity: .16; animation-duration: 34s; }
@keyframes sky-aurora-drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(-60px, 50px) scale(1.15); } }
.sky-stars { position: absolute; inset: 0; }
.sky-star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .6; animation: sky-twinkle 3s ease-in-out infinite; }
@keyframes sky-twinkle { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .9; transform: scale(1.2); } }

/* ---------- [WEBAPP] каркас ---------- */
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.side-nav { position: sticky; top: 0; height: 100vh; width: var(--side-w); flex-shrink: 0; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid var(--stroke); background: rgba(11, 9, 24, .55); backdrop-filter: blur(18px); }
.brand-logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.brand-logo-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--grad); box-shadow: var(--glow); flex-shrink: 0; }
.brand-logo-text { font-family: var(--font-h); font-size: 14px; line-height: 1.15; font-weight: 600; }
.brand-logo-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-nav-links { display: flex; flex-direction: column; gap: 4px; }
.side-nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; color: var(--muted); font-weight: 700; transition: .2s; }
.side-nav-link .nav-ico { font-size: 20px; width: 24px; text-align: center; }
.side-nav-link:hover { background: var(--card); color: var(--text); }
.side-nav-link.is-active { background: var(--card-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav-footer { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }
.top-bar { display: none; }
.screen-root { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1180px; margin: 0 auto; width: 100%; }
.tab-bar { display: none; }

.screen-enter { animation: screen-enter .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes screen-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- [WEBAPP] базовые элементы ---------- */
.card-glass { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(14px); }
.section-title { font-size: 22px; margin: 30px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 700; }
.text-muted { color: var(--muted); }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 30px; line-height: 1.1; }
.page-head p { color: var(--muted); margin: 8px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; min-height: 44px; margin-bottom: 6px; }

.btn-primary, .btn-secondary, .btn-ghost { min-height: 52px; padding: 0 24px; border-radius: 999px; font-weight: 800; font-size: 16px; display: inline-flex;
  align-items: center; justify-content: center; gap: 10px; transition: transform .15s, box-shadow .2s, opacity .2s; user-select: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-100%); animation: btn-shine 3.2s ease-in-out infinite; }
@keyframes btn-shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.btn-secondary { background: var(--card-2); border: 1px solid var(--stroke-2); }
.btn-ghost { background: transparent; border: 1px dashed var(--stroke-2); color: var(--muted); }
.btn-primary:active, .btn-secondary:active, .btn-ghost:active { transform: scale(.97); }
.btn-primary[disabled], .btn-secondary[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option { min-height: 46px; min-width: 46px; padding: 0 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--stroke); font-weight: 800; transition: .15s; }
.chip-option:hover { border-color: var(--stroke-2); }
.chip-option.is-selected { background: var(--grad); border-color: transparent; box-shadow: var(--glow); }
.chip-grid-age { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--stroke); font-size: 13px; color: var(--muted); font-weight: 700; }
.badge-price { position: absolute; top: 12px; left: 12px; padding: 6px 12px; border-radius: 999px; background: var(--grad); font-weight: 800; font-size: 13px; box-shadow: var(--glow); z-index: 2; }
.badge-tag { position: absolute; top: 12px; right: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); border: 1px solid var(--stroke-2); font-size: 12px; font-weight: 800; z-index: 2; }

.field-group { margin-bottom: 18px; }
.field-label { display: block; color: var(--muted); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.field-input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke); outline: none; transition: .15s; }
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 122, 61, .2); }
textarea.field-input { min-height: 130px; resize: vertical; line-height: 1.5; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.seg-control { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg-option { min-height: 54px; border-radius: 16px; background: var(--card); border: 1px solid var(--stroke); font-weight: 800; transition: .15s; }
.seg-option.is-selected { background: var(--card-2); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 8px 24px rgba(255, 122, 61, .2); }

/* ---------- [WEBAPP] главная ---------- */
.home-hero { position: relative; border-radius: 30px; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; padding: 34px;
  background: radial-gradient(600px 300px at 70% 20%, rgba(255, 122, 61, .35), transparent 70%), linear-gradient(160deg, #2a1854 0%, #120c27 70%); border: 1px solid var(--stroke); }
.home-hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .55; }
.home-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 9, 24, .1) 0%, rgba(11, 9, 24, .85) 75%); }
.home-hero-content { position: relative; z-index: 2; max-width: 620px; }
.home-hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid var(--stroke-2); font-weight: 800; font-size: 14px; backdrop-filter: blur(8px); }
.home-hero h1 { font-size: 48px; line-height: 1.02; margin: 16px 0 12px; text-transform: uppercase; }
.home-hero p { font-size: 18px; color: #ddd6f3; margin: 0 0 22px; line-height: 1.5; }
.home-hero-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.home-float { position: absolute; font-size: 42px; z-index: 1; animation: home-float 6s ease-in-out infinite; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .5)); }
@keyframes home-float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-18px) rotate(6deg); } }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card { position: relative; padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--stroke); }
.step-card-num { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--stroke-2); font-size: 22px; margin-bottom: 12px; }
.step-card h3 { font-size: 16px; margin-bottom: 6px; }
.step-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.promo-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; padding: 26px; border-radius: 28px; margin-top: 18px;
  background: linear-gradient(135deg, rgba(139, 92, 246, .25), rgba(45, 212, 191, .12)); border: 1px solid var(--stroke-2); overflow: hidden; position: relative; }
.promo-card h2 { font-size: 26px; margin-bottom: 10px; }
.promo-card p { color: #d9d2f0; line-height: 1.55; margin: 0 0 18px; }
.promo-book-mock { aspect-ratio: 9 / 14; max-height: 300px; margin: 0 auto; border-radius: 22px; background: #fff; padding: 14px; box-shadow: var(--shadow); transform: rotate(4deg); display: flex; flex-direction: column; gap: 10px; }
.promo-book-mock-frame { flex: 1.4; border-radius: 14px; border: 3px solid #e0aa3e; background: linear-gradient(160deg, #ffb37a, #c084fc 60%, #60a5fa); display: grid; place-items: center; font-size: 54px; animation: promo-breathe 4s ease-in-out infinite; }
@keyframes promo-breathe { 0%, 100% { filter: saturate(1) brightness(1); transform: scale(1); } 50% { filter: saturate(1.3) brightness(1.1); transform: scale(1.03); } }
.promo-book-mock-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 4px 6px; }
.promo-book-mock-lines i { height: 7px; border-radius: 4px; background: #d8d4e6; }

/* ---------- [WEBAPP] карточки мультфильмов ---------- */
.cartoon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cartoon-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 31%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.cartoon-scroll::-webkit-scrollbar { display: none; }
.cartoon-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--stroke); aspect-ratio: 4 / 5; scroll-snap-align: start;
  transition: transform .25s, box-shadow .25s; display: block; }
.cartoon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cartoon-card-cover { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .6s; }
.cartoon-card:hover .cartoon-card-cover { transform: scale(1.06); }
.cartoon-card-cover.is-placeholder { display: grid; place-items: center; font-size: 72px; }
.cartoon-card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 16px; background: linear-gradient(180deg, transparent, rgba(8, 6, 20, .92) 55%); }
.cartoon-card-info h3 { font-size: 17px; line-height: 1.2; margin-bottom: 6px; }
.cartoon-card-info p { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; }

/* ---------- [WEBAPP] экран мультфильма ---------- */
.detail-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: start; }
.detail-media { position: sticky; top: 20px; border-radius: 26px; overflow: hidden; background: #000; border: 1px solid var(--stroke); aspect-ratio: 16 / 10; }
.detail-media video, .detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .cartoon-card-cover { position: absolute; inset: 0; }
.detail-title { font-size: 34px; text-transform: uppercase; line-height: 1.05; margin: 4px 0 12px; }
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.price-card { text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); min-height: 76px; transition: .15s; }
.price-card b { display: block; font-family: var(--font-h); font-size: 22px; }
.price-card span { font-size: 13px; color: var(--muted); font-weight: 700; }
.price-card.is-selected { border-color: var(--accent); background: var(--grad-soft); box-shadow: 0 8px 26px rgba(255, 122, 61, .22); }
.about-card { margin: 16px 0; }
.about-card h3 { font-size: 15px; text-transform: uppercase; margin-bottom: 10px; }
.about-card p { margin: 0; color: #d9d3ee; line-height: 1.6; white-space: pre-line; }
.about-card.is-collapsed p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.about-toggle { margin-top: 8px; color: var(--accent); font-weight: 800; min-height: 44px; }

.photo-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 190px; padding: 22px;
  border-radius: 20px; border: 2px dashed rgba(255, 122, 61, .55); background: rgba(255, 122, 61, .05); cursor: pointer; transition: .2s; overflow: hidden; }
.photo-drop:hover { background: rgba(255, 122, 61, .1); }
.photo-drop-ico { font-size: 34px; }
.photo-drop b { font-size: 16px; }
.photo-drop small { color: var(--muted); line-height: 1.45; }
.photo-drop.has-photo { padding: 0; border-style: solid; }
.photo-drop.has-photo img { width: 100%; max-height: 340px; object-fit: contain; background: #000; }
.photo-drop-change { position: absolute; bottom: 10px; right: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .65); font-weight: 800; font-size: 13px; }
.photo-tips { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 14px; font-weight: 700; }
.photo-tips button { color: var(--accent); min-height: 44px; }
.privacy-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

.hero-cta-card { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 24px; background: linear-gradient(135deg, rgba(255, 122, 61, .14), rgba(255, 79, 139, .08)); border: 1px solid rgba(255, 122, 61, .35); margin: 10px 0 16px; }
.hero-cta-ico { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; background: var(--grad); font-size: 24px; box-shadow: var(--glow); }
.hero-cta-card h3 { font-size: 17px; text-transform: uppercase; margin-bottom: 6px; }
.hero-cta-card p { margin: 0 0 10px; color: #ddd5f2; line-height: 1.5; font-size: 14px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: #ddd5f2; }
.check-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 900; }

/* ---------- [WEBAPP] генерация героя ---------- */
.magic-stage { text-align: center; padding: 40px 10px; }
.magic-orb { width: 140px; height: 140px; margin: 0 auto 24px; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, #ff8a3d, #ff4f8b, #a855f7, #2dd4bf, #ff8a3d); animation: magic-spin 3s linear infinite; filter: blur(.5px); box-shadow: 0 0 80px rgba(255, 95, 140, .5); }
.magic-orb::after { content: "✨"; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 44px; animation: magic-spin 3s linear infinite reverse; }
@keyframes magic-spin { to { transform: rotate(360deg); } }
.magic-stage h2 { font-size: 22px; margin-bottom: 8px; }
.magic-tip { color: var(--muted); min-height: 48px; transition: opacity .4s; max-width: 420px; margin: 0 auto; line-height: 1.5; }
.fake-progress { height: 8px; border-radius: 8px; background: var(--card-2); max-width: 360px; margin: 22px auto 0; overflow: hidden; }
.fake-progress i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 8px; transition: width 1s ease; }

.variant-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.variant-card { position: relative; border-radius: 20px; overflow: hidden; border: 2px solid transparent; background: var(--bg-2); aspect-ratio: 3 / 4; transition: .2s; }
.variant-card img { width: 100%; height: 100%; object-fit: cover; }
.variant-card-num { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-weight: 800; }
.variant-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 122, 61, .25), var(--glow); transform: translateY(-3px); }
.variant-card.is-selected::after { content: "✓"; position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 900; }
.variant-zoom { position: absolute; bottom: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.sticky-cta { position: sticky; bottom: 16px; z-index: 5; margin-top: 18px; }

/* ---------- [WEBAPP] мастер книжки ---------- */
.wizard-progress { height: 8px; border-radius: 8px; background: var(--card-2); overflow: hidden; margin: 6px 0 20px; }
.wizard-progress i { display: block; height: 100%; background: var(--grad); transition: width .4s; }
.wizard-question { font-size: 24px; line-height: 1.25; margin: 0 0 18px; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.option-card { min-height: 64px; padding: 14px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); text-align: left; font-weight: 800; font-size: 16px; transition: .15s; display: flex; align-items: center; gap: 10px; }
.option-card:hover { border-color: var(--stroke-2); transform: translateY(-1px); }
.option-card.is-selected { border-color: var(--accent); background: var(--grad-soft); }
.option-grid-1 { grid-template-columns: 1fr; }
.summary-list { display: grid; gap: 8px; margin: 0 0 18px; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.summary-row span { color: var(--muted); font-weight: 700; }
.summary-row b { text-align: right; }

/* ---------- [WEBAPP] мои работы / заказ ---------- */
.tabs-row { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab-pill { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--stroke); font-weight: 800; white-space: nowrap; }
.tab-pill.is-active { background: var(--text); color: var(--bg); }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.work-card { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--stroke); display: flex; flex-direction: column; transition: .2s; }
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.work-card-cover { aspect-ratio: 16 / 10; background: var(--grad-soft); background-size: cover; background-position: center; display: grid; place-items: center; font-size: 48px; position: relative; }
.work-card-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.work-card-body h3 { font-size: 15px; line-height: 1.25; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--card-2); width: fit-content; }
.status-pill.st-done { background: rgba(61, 220, 151, .16); color: var(--ok); }
.status-pill.st-generating, .status-pill.st-queued { background: rgba(139, 92, 246, .2); color: #c4b5fd; }
.status-pill.st-awaiting_payment { background: rgba(255, 198, 92, .16); color: var(--gold); }
.status-pill.st-failed, .status-pill.st-refunded { background: rgba(255, 93, 108, .16); color: var(--danger); }
.mini-progress { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--grad); }
.order-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.result-player { border-radius: 24px; overflow: hidden; background: #000; border: 1px solid var(--stroke); }
.result-player video { width: 100%; max-height: 72vh; background: #000; }
.result-player img { width: 100%; }
.progress-ring { width: 180px; height: 180px; margin: 10px auto 18px; position: relative; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-h); font-size: 34px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state-ico { font-size: 56px; margin-bottom: 10px; }

/* ---------- [WEBAPP] профиль ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.balance-card { padding: 26px; border-radius: 26px; background: var(--grad); box-shadow: var(--glow); position: relative; overflow: hidden; }
.balance-card::after { content: "✦"; position: absolute; right: -10px; top: -30px; font-size: 160px; opacity: .15; }
.balance-card small { font-weight: 800; opacity: .85; }
.balance-card b { display: block; font-family: var(--font-h); font-size: 40px; margin: 6px 0 16px; }
.balance-card .btn-secondary { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .4); }
.history-list { display: grid; gap: 2px; }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.history-row .plus { color: var(--ok); font-weight: 800; }
.history-row .minus { color: var(--muted); font-weight: 800; }
.ref-code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px dashed var(--stroke-2); font-family: var(--font-h); font-size: 22px; letter-spacing: .1em; margin: 10px 0; }
.link-list { display: grid; gap: 6px; }
.link-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--stroke); font-weight: 700; width: 100%; text-align: left; }

/* ---------- [WEBAPP] шторка, тосты, загрузка ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(4, 3, 12, .6); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: .25s; }
.sheet-panel { position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%); max-height: 88vh; overflow-y: auto; transform: translate(-50%, 105%);
  background: #16122c; border: 1px solid var(--stroke-2); border-radius: 28px 28px 0 0; padding: 10px 22px calc(24px + var(--safe-b)); transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility .32s; box-shadow: var(--shadow); visibility: hidden; }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet-panel { transform: translate(-50%, 0); visibility: visible; }
.sheet-grip { width: 44px; height: 5px; border-radius: 5px; background: var(--stroke-2); margin: 4px auto 16px; }
.sheet-body h2 { font-size: 20px; margin-bottom: 6px; }
.pay-method { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 10px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); margin-bottom: 8px; text-align: left; font-weight: 800; transition: .15s; }
.pay-method:hover { border-color: var(--accent); }
.pay-method[disabled] { opacity: .4; pointer-events: none; }
.pay-method-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); font-size: 20px; }
.pay-method small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; margin-bottom: 10px; border-bottom: 1px solid var(--stroke); }
.pay-total b { font-family: var(--font-h); font-size: 26px; }
.card-requisites { padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); display: grid; gap: 10px; margin: 12px 0; }
.copy-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; }
.copy-line button { min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--card-2); }

.toast-stack { position: fixed; z-index: 60; left: 50%; top: 16px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); }
.toast-item { padding: 14px 18px; border-radius: 16px; background: rgba(28, 23, 52, .96); border: 1px solid var(--stroke-2); box-shadow: var(--shadow); font-weight: 700; animation: toast-in .3s; }
.toast-item.is-error { border-color: rgba(255, 93, 108, .6); }
.toast-item.is-ok { border-color: rgba(61, 220, 151, .6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 70; width: 100%; height: 100%; }
.boot-loader { min-height: 60vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: skeleton-shine 1.4s infinite; border-radius: var(--radius); }
@keyframes skeleton-shine { to { background-position: -200% 0; } }
.footer-note { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--stroke); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-note a { text-decoration: underline; text-underline-offset: 3px; }
.img-zoom { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 20px; }
.img-zoom img { max-height: 90vh; border-radius: 18px; }
.img-zoom button { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .15); font-size: 22px; }

/* ================= [WEBAPP] ПЛАНШЕТ 768–1024: меню — только иконки ================= */
@media (max-width: 1024px) {
  :root { --side-w: 84px; }
  .side-nav { padding: 18px 10px; align-items: center; }
  .brand-logo-text, .side-nav-link .nav-text, .side-nav-footer { display: none; }
  .side-nav-link { justify-content: center; padding: 0; width: 56px; height: 56px; }
  .side-nav-link .nav-ico { font-size: 22px; }
  .screen-root { padding: 24px 24px 50px; }
  .cartoon-grid, .work-grid { grid-template-columns: repeat(2, 1fr); }
  .cartoon-scroll { grid-auto-columns: minmax(240px, 45%); }
  .detail-layout, .order-layout { grid-template-columns: 1fr; }
  .detail-media { position: relative; top: 0; }
  .variant-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero h1 { font-size: 40px; }
}

/* ================= [WEBAPP] ТЕЛЕФОН <768: нижние вкладки, одна колонка ================= */
@media (max-width: 768px) {
  .side-nav { display: none; }
  .app-shell { flex-direction: column; }
  .top-bar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; padding: 10px 14px; min-height: 60px;
    background: rgba(11, 9, 24, .78); backdrop-filter: blur(16px); border-bottom: 1px solid var(--stroke); }
  .brand-logo-small .brand-logo-mark { width: 36px; height: 36px; font-size: 18px; border-radius: 12px; }
  .brand-logo-small .brand-logo-text { display: inline; font-size: 13px; }
  .top-bar-balance { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--stroke); font-weight: 800; font-size: 14px; }
  .screen-root { padding: 16px 14px calc(96px + var(--safe-b)); }
  .tab-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b));
    border-radius: 24px; background: rgba(22, 18, 44, .88); backdrop-filter: blur(18px); border: 1px solid var(--stroke-2); box-shadow: var(--shadow); padding: 6px; }
  .tab-bar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 800; transition: .2s; }
  .tab-bar-item .nav-ico { font-size: 21px; }
  .tab-bar-item.is-active { color: var(--text); background: var(--card-2); }
  .tab-bar-item.is-active .nav-ico { transform: translateY(-1px) scale(1.08); }
  .home-hero { min-height: 520px; padding: 22px; border-radius: 24px; }
  .home-hero h1 { font-size: 32px; }
  .home-hero p { font-size: 16px; }
  .home-float { font-size: 30px; }
  .steps-grid, .profile-grid { grid-template-columns: 1fr; }
  .promo-card { grid-template-columns: 1fr; padding: 22px; }
  .promo-book-mock { max-height: 230px; }
  .cartoon-grid, .work-grid { grid-template-columns: 1fr; }
  .cartoon-scroll { grid-auto-columns: 78%; }
  .cartoon-card { aspect-ratio: 4 / 4.4; }
  .page-head h1, .detail-title { font-size: 26px; }
  .chip-grid-age { grid-template-columns: repeat(6, 1fr); }
  .option-grid { grid-template-columns: 1fr; }
  .wizard-question { font-size: 20px; }
  .price-cards { grid-template-columns: 1fr 1fr; }
  .sticky-cta { bottom: calc(86px + var(--safe-b)); }
  .sheet-panel { border-radius: 24px 24px 0 0; }
  .section-title { font-size: 19px; }
}
