/* «Кадрим» — дизайн «Стикерпак»: наклейки, скотч, полароиды, рукописные заметки */

/* ---------- Шрифты (локально, без Google CDN) ---------- */
@font-face { font-family: 'Rubik'; font-weight: 300 900; font-display: swap; src: url(/fonts/Rubik-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 300 900; font-display: swap; src: url(/fonts/Rubik-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2190-2193, U+2212, U+2215, U+2248, U+2260, U+2264-2265, U+FEFF, U+FFFD; }
@font-face { font-family: 'Caveat'; font-weight: 400 700; font-display: swap; src: url(/fonts/Caveat-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Caveat'; font-weight: 400 700; font-display: swap; src: url(/fonts/Caveat-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20BD, U+2190-2193, U+2248; }
/* Шрифты субтитров — для живых превью стилей */
@font-face { font-family: 'Cap Montserrat'; font-weight: 800; font-display: swap; src: url(/render-fonts/Montserrat-800.ttf) format('truetype'); }
@font-face { font-family: 'Cap Montserrat'; font-weight: 900; font-display: swap; src: url(/render-fonts/Montserrat-900.ttf) format('truetype'); }
@font-face { font-family: 'Cap Rubik'; font-weight: 800; font-display: swap; src: url(/render-fonts/Rubik-800.ttf) format('truetype'); }

/* ---------- Токены ---------- */
:root {
  --bg: #fff4e0;
  --paper: #ffffff;
  --paper-2: #fffaf1;
  --sand: #ece2cf;
  --ink: #1e1b16;
  --ink-2: #3a352c;
  --ink-3: #6f665a;
  --dash: rgba(30, 27, 22, 0.22);
  --tomato: #ff5a36;
  --tomato-2: #e9472a;
  --blue: #2f5bff;
  --yellow: #ffd43b;
  --sticky: #ffe76a;
  --mint: #3ddc97;
  --mint-ink: #157a4c;
  --pink: #ff8ad8;
  --sky: #9ec1ff;
  --peach: #ffb38a;
  --tape: rgba(255, 212, 59, 0.78);
  --tape-pink: rgba(255, 138, 216, 0.62);
  --tape-blue: rgba(158, 193, 255, 0.7);
  --r: 18px;
  --r-sm: 12px;
  --pop: 0 3px 0 var(--ink);
  --pop-lg: 0 4px 0 var(--ink);
  --soft: 0 8px 18px rgba(60, 40, 10, 0.16);
  --stk-shadow: 0 3px 8px rgba(60, 40, 10, 0.22);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.5, 1);
  --ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Comic Sans MS', cursive;
  --gutter: 20px;
  --top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(rgba(30, 27, 22, 0.12) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--bg);
  font: 400 16px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, video { display: block; max-width: 100%; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 18px; height: 18px; }
.ic.lg { width: 30px; height: 30px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.tnum { font-variant-numeric: tabular-nums; }
.hand { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }

/* скотч */
.tape { position: absolute; z-index: 3; width: 76px; height: 24px; background: var(--tape); pointer-events: none;
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent calc(100% - 2px)), repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 4px);
  -webkit-mask-composite: source-over; mask-composite: add; }
.tape.pink { background: var(--tape-pink); }
.tape.blue { background: var(--tape-blue); }

/* ---------- Каркас ---------- */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { padding: calc(var(--top) + 8px) var(--gutter) calc(var(--bottom) + 40px); animation: screenIn 0.42s var(--ease) both; }
.screen.back { animation-name: screenBack; }
.screen.has-bar { padding-bottom: calc(var(--bottom) + 124px); }
@keyframes screenIn { from { opacity: 0; transform: translateX(26px) rotate(0.6deg); } to { opacity: 1; transform: none; } }
@keyframes screenBack { from { opacity: 0; transform: translateX(-26px) rotate(-0.6deg); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 10px; height: 60px; margin: 0 -4px 6px; }
.topbar .title { flex: 1; min-width: 0; text-align: center; font: 900 19px/1.1 var(--ui); letter-spacing: -0.02em; text-transform: lowercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { width: 44px; flex: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); transition: transform 0.15s var(--ease), box-shadow 0.15s; flex: none; }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }

.logo { display: inline-flex; align-items: center; background: var(--tomato); color: #fff; padding: 9px 13px 8px; border-radius: 13px; border: 3px solid #fff; box-shadow: var(--stk-shadow); rotate: -4deg; font: 900 18px/1 var(--ui); letter-spacing: -0.02em; animation: logoIn 0.7s var(--spring) both 0.05s; }
.logo b { color: var(--yellow); font-weight: 900; }
@keyframes logoIn { 0% { opacity: 0; transform: scale(1.5) rotate(-12deg); } 60% { opacity: 1; transform: scale(0.94) rotate(2deg); } 100% { transform: none; } }
.grow { flex: 1; }

.chip-btn { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px 0 10px; border-radius: 999px; background: var(--yellow); border: 3px solid #fff; box-shadow: var(--stk-shadow); rotate: 3deg; font: 800 15px/1 var(--ui); transition: transform 0.2s var(--spring); }
.chip-btn .ic { width: 18px; height: 18px; stroke-width: 2.3; }
.chip-btn:active { transform: scale(0.92) rotate(-3deg); }
.chip-btn.bump { animation: bump 0.5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18) rotate(-4deg); } }

/* ---------- Типографика ---------- */
.overline { display: inline-block; margin: 2px 0 6px; font: 700 24px/1 var(--hand); color: var(--tomato); rotate: -2deg; transform-origin: left; }
.h1 { font: 900 clamp(34px, 10.6vw, 44px)/1.02 var(--ui); letter-spacing: -0.035em; margin: 4px 0 14px; }
.hl { position: relative; z-index: 0; display: inline-block; }
.hl::before { content: ''; position: absolute; left: -6px; right: -8px; top: 52%; height: 44%; background: var(--yellow); z-index: -1; border-radius: 4px; transform-origin: left center; transform: rotate(-2deg) skewX(-12deg); animation: marker 0.55s var(--ease) both 0.75s; }
@keyframes marker { from { transform: rotate(-2deg) skewX(-12deg) scaleX(0); } to { transform: rotate(-2deg) skewX(-12deg) scaleX(1); } }
.h2 { font: 900 clamp(23px, 6.6vw, 27px)/1.1 var(--ui); letter-spacing: -0.025em; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.lead { font: 500 15.5px/1.45 var(--ui); color: var(--ink-2); margin: 0; max-width: 36ch; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h3 { margin: 0; font: 800 17px/1.2 var(--ui); letter-spacing: -0.01em; text-transform: lowercase; }
.section-head span { font: 700 20px/1.1 var(--hand); color: var(--tomato); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; rotate: -1deg; padding: 0 4px 2px 2px; margin-right: -4px; }
.hint { font-size: 14px; color: var(--ink-3); margin: 10px 0 0; }

.word { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 0.02em 0.06em; margin-bottom: -0.06em; }
.word > span { display: inline-block; animation: wordIn 0.6s var(--spring) both; animation-delay: calc(var(--i) * 75ms + 80ms); }
@keyframes wordIn { from { transform: translateY(110%) rotate(8deg); } to { transform: none; } }

/* наклейка «шлёп»: появление с лёгким перелётом */
/* backwards, а не both: после появления :active и inline-transform снова работают */
.reveal { animation: slap 0.6s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 65ms + 90ms); }
@keyframes slap { 0% { opacity: 0; transform: translateY(16px) scale(1.04) rotate(-1.5deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.write { animation: write 0.8s cubic-bezier(0.45, 0, 0.55, 1) both 0.35s; }
@keyframes write { from { clip-path: inset(-10% 100% -20% 0); } to { clip-path: inset(-10% -4% -20% 0); } }

/* ---------- Главная: загрузка-полароид ---------- */
.upload { position: relative; display: block; width: calc(100% - 28px); margin: 44px 14px 0; padding: 10px 10px 12px; text-align: center; background: var(--paper); border-radius: 6px; box-shadow: 0 8px 18px rgba(60, 40, 10, 0.18); rotate: -1.5deg; transition: transform 0.25s var(--spring), box-shadow 0.25s; }
.upload .float { display: block; }
.upload:active { transform: scale(0.97) rotate(1deg); }
.upload.drag { transform: scale(1.03) rotate(1deg); box-shadow: 0 16px 30px rgba(60, 40, 10, 0.25); }
.upload .tape.tl { left: -16px; top: -10px; rotate: -30deg; }
.upload .tape.tr { right: -16px; top: -10px; rotate: 28deg; }
.pol-in { height: 172px; border: 2.5px dashed var(--ink); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--paper-2); padding: 0 12px; }
.pol-plus { position: relative; width: 60px; height: 60px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: var(--stk-shadow); margin-bottom: 6px; animation: plusBob 2.8s ease-in-out infinite; }
.pol-plus .ic { width: 28px; height: 28px; stroke-width: 2.8; }
.pol-plus::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2.5px solid var(--blue); animation: ring 2.4s var(--ease) infinite 0.6s; pointer-events: none; }
@keyframes plusBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 75%, 100% { transform: scale(1.6); opacity: 0; } }
.u-t { font: 800 18px/1.15 var(--ui); }
.u-h { font: 500 13px/1.2 var(--ui); color: var(--ink-3); }
.upload .note { position: absolute; right: 64px; top: -42px; font: 700 26px/1 var(--hand); color: var(--tomato); rotate: 7deg; }
.upload .arr { position: absolute; right: 204px; top: -34px; width: 40px; height: 40px; rotate: 18deg; scale: -1 1; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.upload .arr path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 0.7s var(--ease) forwards 0.9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Карточки ---------- */
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--pop); position: relative; }
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 2px dashed var(--dash); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; }
.row-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); flex: none; rotate: -4deg; }
.row:nth-child(4n + 2) .row-ic { background: var(--pink); rotate: 3deg; }
.row:nth-child(4n + 3) .row-ic { background: var(--mint); rotate: -2deg; }
.row:nth-child(4n + 4) .row-ic { background: var(--sky); rotate: 4deg; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 700; line-height: 1.3; }
.row-sub { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }

/* Веер демо-обложек — полароиды на скотче */
.fan { position: relative; height: 244px; margin: 0 0 18px; }
.fan figure { position: absolute; top: 16px; left: 50%; width: 112px; margin: 0; padding: 5px 5px 16px; background: var(--paper); border-radius: 4px; box-shadow: var(--soft); }
.fan figure::before { content: ''; position: absolute; z-index: 2; top: -9px; left: 50%; width: 52px; height: 20px; margin-left: -26px; background: var(--tape); rotate: -5deg; }
.fan figure:nth-child(1)::before { background: var(--tape-pink); rotate: 6deg; }
.fan figure:nth-child(3)::before { background: var(--tape-blue); }
.fan figure img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 2px; background: var(--sand); }
.fan figure:nth-child(1) { translate: -140% 16px; rotate: -9deg; }
.fan figure:nth-child(2) { translate: -50% 0; z-index: 2; rotate: 1.5deg; }
.fan figure:nth-child(3) { translate: 40% 16px; rotate: 8deg; }
.fan.in figure { animation: fanIn 0.8s var(--spring) both; }
.fan.in figure:nth-child(1) { animation-delay: 0.25s; }
.fan.in figure:nth-child(2) { animation-delay: 0.12s; }
.fan.in figure:nth-child(3) { animation-delay: 0.38s; }
@keyframes fanIn { from { opacity: 0; transform: translateY(26px) scale(1.12) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* Проекты */
.proj { display: flex; align-items: center; gap: 14px; padding: 12px 14px; width: 100%; text-align: left; transition: background 0.2s; }
.proj:first-child { border-radius: 16px 16px 0 0; }
.proj:last-child { border-radius: 0 0 16px 16px; }
.proj:only-child { border-radius: 16px; }
.proj:active { background: var(--paper-2); }
.proj-thumb { width: 44px; aspect-ratio: 9 / 16; border-radius: 8px; background: var(--sand) center / cover; flex: none; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); display: grid; place-items: center; color: var(--ink-3); rotate: -3deg; }
.proj:nth-child(even) .proj-thumb { rotate: 3deg; }
.proj-thumb .ic { width: 18px; height: 18px; }
.st-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--mint); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(60, 40, 10, 0.2); font: 700 13px/1 var(--ui); color: var(--ink); rotate: -3deg; white-space: nowrap; }
.st-chip.live { background: var(--yellow); }
.st-chip.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--tomato); animation: blink 1.1s steps(1) infinite; }
.st-chip.wait { background: var(--pink); }
.st-chip.bad { background: var(--tomato); color: #fff; }
.st-chip.idle { background: var(--paper); border-color: var(--sand); box-shadow: none; color: var(--ink-3); }
@keyframes blink { 50% { opacity: 0.15; } }

/* ---------- Кнопки ---------- */
.btn { position: relative; height: 54px; padding: 0 20px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 800 17px/1 var(--ui); letter-spacing: -0.01em; border: 2.5px solid var(--ink); box-shadow: var(--pop-lg); transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.2s, opacity 0.2s; overflow: hidden; white-space: nowrap; min-width: 0; text-transform: lowercase; text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn > span { overflow: hidden; text-overflow: ellipsis; }
.btn .ic { stroke-width: 2.4; }
.btn-primary { background: var(--tomato); color: #fff; }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { cursor: default; }
.btn-primary[disabled] { background: var(--sand); color: var(--ink-3); }
.btn .fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: rgba(30, 27, 22, 0.16); transition: transform 0.3s linear; }
.btn .lbl { position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.btn .side { font-weight: 600; opacity: 0.75; font-size: 14px; text-transform: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-row > .btn { padding: 0 12px; gap: 8px; }
.btn-row.wide1 { grid-template-columns: 1.4fr 1fr; }
.btn-row.wide2 { grid-template-columns: 1.22fr 1fr; }
.btn-sm { height: 46px; font-size: 15px; padding: 0 14px; border-radius: 13px; box-shadow: var(--pop); }
.link-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.link-btn .ic { color: var(--blue); }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 22px var(--gutter) calc(var(--bottom) + 14px); background: linear-gradient(to top, var(--bg) 70%, rgba(255, 244, 224, 0)); }
.bar > * { max-width: 480px; margin: 0 auto; display: flex; }

/* ---------- Настройка ---------- */
.source { display: flex; gap: 16px; padding: 14px; align-items: stretch; rotate: -0.6deg; }
.source-media { width: 86px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: var(--sand); flex: none; position: relative; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22); rotate: -2deg; }
.source-media video { width: 100%; height: 100%; object-fit: cover; }
.source-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.source-name { font-weight: 700; line-height: 1.3; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; color: var(--ink-3); }
.meta-line span + span::before { content: '·'; margin-right: 10px; }
.fit { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--mint-ink); font-weight: 500; line-height: 1.35; }
.fit .ic { width: 16px; height: 16px; margin-top: 2px; stroke-width: 2.6; }
.up { margin-top: auto; }
.up-track { height: 7px; border-radius: 6px; background: var(--sand); overflow: hidden; border: 1.5px solid var(--ink); }
.up-track i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, var(--mint) 0 8px, #5fe6ab 8px 16px); background-size: 22px 100%; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.25s linear; animation: stripes 0.8s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }
.up-label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); font-weight: 600; margin-top: 8px; }
.up-label .ic { width: 16px; height: 16px; color: var(--mint-ink); stroke-width: 2.8; }
.up.err .up-label { color: var(--tomato-2); }
.up.err .up-label .ic { color: var(--tomato-2); }

/* количество версий — кружки-наклейки */
.vers { display: flex; justify-content: space-between; gap: 6px; padding: 2px 2px 6px; }
.vers button { flex: 1; display: grid; place-items: center; height: 62px; }
.vers b { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); font: 900 22px/1 var(--ui); color: var(--ink); transition: background 0.2s, color 0.2s, box-shadow 0.2s, rotate 0.35s var(--spring), scale 0.35s var(--spring); }
.vers button:active b { scale: 0.9; }
.vers button[aria-checked='true'] b { background: var(--tomato); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), 0 5px 10px rgba(0, 0, 0, 0.2); rotate: -8deg; scale: 1.08; animation: pick 0.45s var(--spring); }
@keyframes pick { 0% { transform: scale(0.8); } 60% { transform: scale(1.08); } 100% { transform: none; } }
@media (max-width: 350px) { .vers b { width: 48px; height: 48px; font-size: 20px; } }
.kinds { display: flex; flex-wrap: wrap; gap: 8px 6px; margin-top: 12px; min-height: 30px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; background: var(--paper); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(60, 40, 10, 0.18); font-size: 13.5px; font-weight: 700; color: var(--ink); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag i { font-style: normal; font-weight: 800; font-size: 12px; color: rgba(30, 27, 22, 0.55); }
.kinds .tag { animation: slap 0.45s var(--spring) both; }
.kinds .tag:nth-child(1) { background: var(--yellow); rotate: -2deg; }
.kinds .tag:nth-child(2) { background: var(--pink); rotate: 1.5deg; }
.kinds .tag:nth-child(3) { background: var(--mint); rotate: -1deg; }
.kinds .tag:nth-child(4) { background: var(--sky); rotate: 1.5deg; }
.kinds .tag:nth-child(5) { background: var(--peach); rotate: -2deg; }
.tag.acc { background: var(--yellow); }
.tag .ic { width: 16px; height: 16px; }

/* стили субтитров — фото на скотче */
.styles { display: grid; grid-auto-flow: column; grid-auto-columns: 108px; gap: 14px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter) 10px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.styles::-webkit-scrollbar { display: none; }
.style { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; text-align: center; position: relative; }
.style-prev { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 4px 10px rgba(60, 40, 10, 0.22); background: var(--frame, linear-gradient(160deg, #c9b69a, #6d5f4c)) center / cover; transition: border-color 0.2s, box-shadow 0.2s, rotate 0.35s var(--spring), scale 0.35s var(--spring); }
.style:nth-child(odd) .style-prev { rotate: -2deg; }
.style:nth-child(even) .style-prev { rotate: 2deg; }
.style-prev::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.3)); }
.style[aria-checked='true'] .style-prev { border-color: var(--tomato); box-shadow: 0 6px 14px rgba(255, 90, 54, 0.35); rotate: 0deg; scale: 1.04; }
.style-cap { position: absolute; left: 6px; right: 6px; top: 57%; z-index: 1; text-align: center; color: #fff; line-height: 1.05; overflow-wrap: normal; word-break: keep-all; }
.style-cap em { font-style: normal; color: var(--pick, var(--yellow)); }
.styles.mono .style-cap:not(.cap-none) { color: #b6b9bd; }
.styles.mono .cap-box { color: #a1a4a8; }
.styles.mono .style-cap em { color: #fff; }
.cap-clean { font: 800 13px/1.1 'Cap Montserrat', var(--ui); -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.cap-bold { font: 900 14px/1.05 'Cap Montserrat', var(--ui); text-transform: uppercase; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.cap-pop { font: 800 16px/1.02 'Cap Rubik', var(--ui); text-transform: uppercase; -webkit-text-stroke: 3.5px #000; paint-order: stroke fill; }
.cap-box span { font: 700 10.5px/1.5 var(--ui); background: rgba(0, 0, 0, 0.78); padding: 3px 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.cap-none { top: 50%; transform: translateY(-50%); color: #fff; font: 700 13px/1.3 var(--ui); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.style-check { position: absolute; top: -6px; right: -6px; z-index: 4; width: 26px; height: 26px; border-radius: 50%; background: var(--tomato); color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); display: grid; place-items: center; transform: scale(0) rotate(-40deg); transition: transform 0.35s var(--spring); }
.style-check .ic { width: 14px; height: 14px; stroke-width: 3.4; }
.style[aria-checked='true'] .style-check { transform: none; }
.style-name { font: 700 19px/1 var(--hand); color: var(--ink-2); transition: color 0.2s; }
.style[aria-checked='true'] .style-name { color: var(--tomato); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0; }
.swatch { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.swatch i { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.35s var(--spring), box-shadow 0.2s; }
.swatch[aria-checked='true'] i { transform: scale(1.12) rotate(-8deg); box-shadow: 0 0 0 2.5px var(--ink), 0 3px 8px rgba(0, 0, 0, 0.25); }
.swatch.silver i { background: linear-gradient(135deg, #ffffff 0%, #e8e8ea 50%, #b9b9c0 100%); }

.field { display: block; padding: 12px 16px 14px; }
.field[hidden] { display: none; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.field input { width: 100%; height: 48px; padding: 0 14px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 12px; outline: 0; font-size: 16px; font-weight: 600; color: var(--ink); text-overflow: ellipsis; transition: box-shadow 0.2s, background 0.2s; }
.field input::placeholder { color: rgba(30, 27, 22, 0.38); font-weight: 500; }
.field input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.25); }
.field:focus-within label { color: var(--ink); }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; min-height: 68px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--sand); border: 2px solid var(--ink); position: relative; flex: none; transition: background 0.25s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--ink); transition: transform 0.4s var(--spring); }
[aria-checked='true'] > .switch { background: var(--mint); }
[aria-checked='true'] > .switch::after { transform: translateX(20px) rotate(180deg); }

/* ---------- Монтаж (прогресс) ---------- */
.proc { position: relative; margin: 26px 2px 0; }
.proc-big { position: relative; display: inline-block; font: 900 96px/0.9 var(--ui); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.proc-big small { font-size: 0.62em; letter-spacing: -0.04em; margin-left: 2px; }
.squig { position: absolute; left: 0; bottom: -18px; width: 100%; height: 16px; fill: none; stroke: var(--tomato); stroke-width: 5; stroke-linecap: round; }
.squig path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 0.9s var(--ease) forwards 0.3s; }
.proc-note { margin-top: 26px; min-height: 28px; font: 700 27px/1 var(--hand); color: var(--blue); rotate: -1.5deg; transform-origin: left; }
.cutline { position: relative; height: 36px; margin-top: 20px; }
.cutline::before { content: ''; position: absolute; left: 0; right: 0; top: 16px; border-top: 2.5px dashed var(--ink); }
.cutline .done { position: absolute; left: 0; top: 14px; height: 7px; width: 0; background: var(--tomato); border-radius: 4px; transition: width 0.8s var(--ease); }
.cutline .sc { position: absolute; top: 0; left: 0; width: 36px; height: 36px; margin-left: -18px; background: var(--paper); border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; transition: left 0.8s var(--ease); box-shadow: 0 2px 0 var(--ink); }
.cutline .sc .ic { width: 19px; height: 19px; stroke-width: 2.3; rotate: -90deg; animation: snipper 0.5s ease-in-out infinite; }
.cutline.idle .sc .ic { animation: none; }
@keyframes snipper { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.72); } }
.proc-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font: 600 13.5px/1.2 var(--ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.proc-meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stages { margin-top: 30px; rotate: 0.6deg; }
.stages .tape { left: 50%; margin-left: -38px; top: -13px; rotate: -3deg; }
.stages > .tape + .row { border-top: 0; }
.stages .row { min-height: 54px; padding: 10px 16px; gap: 12px; }
.st-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; border: 2px solid var(--ink); background: var(--paper); transition: background 0.3s; }
.st-ic .ic { width: 16px; height: 16px; stroke-width: 3.2; color: var(--ink); transform: scale(0); }
.st-done .st-ic { background: var(--mint); }
.st-done .st-ic .ic { animation: stamp 0.5s var(--spring) both; }
@keyframes stamp { 0% { transform: scale(2) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.st-live .st-ic { background: var(--yellow); }
.st-live .st-ic::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: blink 0.9s steps(1) infinite; }
.st-live .st-ic .ic { display: none; }
.st-name { flex: 1; min-width: 0; font-weight: 500; color: var(--ink-3); transition: color 0.3s; }
.st-done .st-name { color: var(--ink); }
.st-live .st-name { color: var(--ink); font-weight: 700; }
.st-note { font: 700 20px/1 var(--hand); color: var(--tomato); flex: none; font-variant-numeric: tabular-nums; }
.sticky { position: relative; z-index: 2; margin: 22px 30px 0; padding: 14px 16px 16px; background: var(--sticky); font: 700 21px/1.1 var(--hand); color: var(--ink); rotate: -1.8deg; box-shadow: 0 8px 14px rgba(60, 40, 10, 0.16); transform-origin: top center; animation: sway 6s ease-in-out infinite 1.2s; }
.sticky::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: linear-gradient(135deg, #f0d34f 50%, var(--bg) 50%); }
@keyframes sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(0.8deg); } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-top: 14px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.notice .ic { color: var(--blue); margin-top: 1px; }
.notice.warn { background: #ffe9d6; }
.notice.warn .ic { color: var(--tomato-2); }

/* ---------- Результаты ---------- */
.summary { margin: 4px 0 20px; }
.summary .overline { font-size: 23px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags .tag:nth-child(odd) { rotate: -1.5deg; }
.tags .tag:nth-child(even) { rotate: 1.5deg; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 14px; margin-top: 30px; padding: 0 2px; }
.pg { position: relative; background: var(--paper); padding: 7px 7px 10px; border-radius: 4px; box-shadow: 0 6px 14px rgba(60, 40, 10, 0.17); min-width: 0; }
.pg.r0 { rotate: -1.8deg; }
.pg.r1 { rotate: 1.8deg; }
.pg .tape { left: 50%; margin-left: -30px; width: 60px; top: -11px; rotate: -4deg; }
.pg.r1 .tape { background: var(--tape-pink); rotate: 5deg; }
.pg-ph { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; background: var(--sand) center / cover; border-radius: 2px; overflow: hidden; transition: transform 0.2s var(--ease); }
.pg-ph:active { transform: scale(0.97); }
.pg-ph .dur { position: absolute; right: 6px; bottom: 11px; padding: 3px 6px; border-radius: 6px; background: rgba(30, 27, 22, 0.78); color: #fff; font: 700 12px/1 var(--ui); font-variant-numeric: tabular-nums; }
.pg-ph .play { position: absolute; left: 6px; bottom: 6px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--tomato); color: #fff; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); opacity: 0.94; transition: transform 0.25s var(--spring); }
.pg-ph:active .play { transform: scale(0.88); }
.pg-ph .play .ic { width: 15px; height: 15px; margin-left: 2px; }
.pg-ph .ai { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--yellow); border: 2px solid #fff; font: 700 11px/1 var(--ui); color: var(--ink); rotate: -4deg; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.pg-ph .ai .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.pg-cap { margin-top: 8px; font: 700 22px/0.95 var(--hand); display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.pg-cap span:last-child { min-width: 0; overflow-wrap: anywhere; text-transform: lowercase; }
@media (max-width: 370px) { .pg-cap { font-size: 20px; } }
.pg-n { color: var(--tomato); flex: none; }
.pg-h { font: 600 13px/1.28 var(--ui); color: var(--ink-2); margin-top: 3px; min-height: 2.56em; }
.pg-act { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 9px; }
.pg-act button { height: 38px; display: grid; place-items: center; border-radius: 11px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 0 2px 0 var(--ink); color: var(--ink); transition: transform 0.12s, box-shadow 0.12s; }
.pg-act button:active { transform: translateY(2px); box-shadow: none; }
.pg-act button:nth-child(2) { background: var(--yellow); }
.pg-act button:nth-child(3) { background: var(--mint); }
.pg-act .ic { width: 18px; height: 18px; stroke-width: 2.3; }
.pg.flash .pg-ph { animation: flash 0.6s var(--spring); }
/* нечётная последняя карточка — по центру */
.pgrid > .pg:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
@keyframes flash { 0% { transform: scale(0.9) rotate(-3deg); filter: brightness(1.4); } 100% { transform: none; filter: none; } }

/* ---------- Шторки ---------- */
.backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(30, 27, 22, 0.42); animation: fade 0.3s var(--ease) both; }
.backdrop.out { animation: fadeOut 0.25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; max-width: 520px; margin: 0 auto; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(rgba(30, 27, 22, 0.09) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--bg); border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 10px var(--gutter) calc(var(--bottom) + 22px); animation: sheetIn 0.5s var(--spring) backwards; }
.sheet.out { animation: sheetOut 0.26s var(--ease) both; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.grabber { width: 44px; height: 5px; border-radius: 5px; background: var(--ink); opacity: 0.8; margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h3 { flex: 1; min-width: 0; margin: 0; font: 900 21px/1.15 var(--ui); letter-spacing: -0.02em; text-transform: lowercase; }
.sheet-note { margin: -6px 0 16px; font: 700 21px/1.1 var(--hand); color: var(--blue); rotate: -1deg; }
.copy-block { padding: 14px 16px; }
.copy-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.copy-head span { font: 700 19px/1 var(--hand); color: var(--tomato); }
.copy-head button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; margin-right: -6px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 0 2px 0 var(--ink); font-size: 14px; font-weight: 700; }
.copy-head button:active { transform: translateY(2px); box-shadow: none; }
.copy-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }

/* выбор обложки */
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 4px; }
.covers.n2 { grid-template-columns: repeat(2, 1fr); padding: 0 12%; }
.sheet-note + .covers { margin-top: 24px; }
.cv { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 5px 5px 8px; background: var(--paper); border-radius: 4px; box-shadow: var(--soft); text-align: center; transition: rotate 0.35s var(--spring), scale 0.35s var(--spring), box-shadow 0.2s; min-width: 0; }
.cv:nth-child(1) { rotate: -2deg; }
.cv:nth-child(2) { rotate: 1.5deg; }
.cv:nth-child(3) { rotate: -1deg; }
.cv img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 2px; background: var(--sand); }
.cv .cv-cap { font: 700 16px/1.05 var(--hand); color: var(--ink-2); min-height: 2.1em; overflow-wrap: anywhere; }
.cv[aria-checked='true'] { rotate: 0deg; scale: 1.05; box-shadow: 0 0 0 3px var(--tomato), 0 10px 20px rgba(255, 90, 54, 0.3); }
.cv .best { position: absolute; z-index: 2; top: -12px; left: 50%; translate: -50% 0; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--yellow); border: 2.5px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); font: 800 11.5px/19px var(--ui); white-space: nowrap; rotate: -4deg; }
.cv-img { position: relative; display: block; }
.cv .check { position: absolute; z-index: 2; right: 5px; bottom: 5px; width: 28px; height: 28px; border-radius: 50%; background: var(--tomato); color: #fff; border: 2.5px solid #fff; display: grid; place-items: center; transform: scale(0); transition: transform 0.35s var(--spring); }
.cv .check .ic { width: 15px; height: 15px; stroke-width: 3.4; }
.cv[aria-checked='true'] .check { transform: none; }

/* ---------- Плеер: видео в полароиде ---------- */
.player { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; padding: calc(var(--top) + 10px) var(--gutter) calc(var(--bottom) + 16px); background: radial-gradient(rgba(30, 27, 22, 0.12) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--bg); animation: fade 0.25s var(--ease) both; }
.player.out { animation: fadeOut 0.2s var(--ease) both; }
.player-head { display: flex; align-items: center; gap: 12px; min-height: 52px; max-width: 480px; width: 100%; margin: 0 auto; }
.player-head .ttl { flex: 1; min-width: 0; }
.player-head .ttl b { display: block; font: 700 25px/1 var(--hand); }
.player-head .ttl b i { font-style: normal; color: var(--tomato); }
.player-head .ttl span { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.player-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 0 14px; }
.player-frame { position: relative; height: 100%; max-height: 72vh; aspect-ratio: 9 / 16; max-width: 100%; padding: 8px 8px 30px; background: var(--paper); border-radius: 5px; box-shadow: 0 14px 30px rgba(60, 40, 10, 0.25); rotate: -1deg; animation: polIn 0.55s var(--spring) both; }
.player-frame .tape { left: 50%; margin-left: -40px; width: 80px; top: -12px; rotate: -3deg; }
@keyframes polIn { from { opacity: 0; transform: translateY(40px) scale(0.9) rotate(4deg); } }
.player-frame video { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; background: #000; }
.player-tap { position: absolute; inset: 8px 8px 30px; display: grid; place-items: center; }
.player-tap .big { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--tomato); color: #fff; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); transition: opacity 0.25s, transform 0.35s var(--spring); }
.player-tap .big .ic { width: 30px; height: 30px; }
.playing .player-tap .big { opacity: 0; transform: scale(0.6) rotate(-20deg); }
.scrub { position: absolute; left: 8px; right: 8px; bottom: 12px; height: 6px; border-radius: 4px; background: var(--sand); overflow: hidden; }
.scrub i { display: block; height: 100%; background: var(--tomato); transform-origin: left; transform: scaleX(var(--p, 0)); }
.player-foot { max-width: 480px; width: 100%; margin: 0 auto; }

/* ---------- Оплата ---------- */
.balance { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.balance b { position: relative; z-index: 0; font: 900 52px/1 var(--ui); letter-spacing: -0.04em; }
.balance b::before { content: ''; position: absolute; left: -6px; right: -6px; bottom: 4px; height: 38%; background: var(--yellow); z-index: -1; border-radius: 4px; rotate: -2deg; }
.balance span { color: var(--ink-2); font-weight: 600; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--pop); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: var(--yellow); border: 2px solid var(--ink); transition: transform 0.45s var(--spring); }
.seg button { position: relative; height: 46px; font-weight: 700; color: var(--ink-3); transition: color 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.seg button[aria-checked='true'] { color: var(--ink); }
.seg.two { margin-bottom: 16px; }
.seg.two button { font-size: 15.5px; }
.seg.two button small { font-weight: 500; font-size: 13px; opacity: 0.8; }
.packs { display: flex; flex-direction: column; gap: 14px; }
.pack { display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%; text-align: left; transition: transform 0.12s var(--ease), box-shadow 0.12s, opacity 0.2s; }
.pack:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.pack[disabled] { opacity: 0.5; }
.pack.sbp-only { background: var(--paper-2); box-shadow: none; border-style: dashed; }
.pack.sbp-only .pack-n, .pack.sbp-only .row-title { color: var(--ink-3); }
.pack.sbp-only .pack-price { background: transparent; color: var(--ink-2); border: 2px dashed var(--ink-3); }
.pack.best { background: var(--yellow); rotate: -0.8deg; }
.pack-n { font: 900 30px/1 var(--ui); letter-spacing: -0.03em; width: 66px; flex: none; }
.pack-n small { display: block; font: 600 12px/1.2 var(--ui); color: var(--ink-3); margin-top: 4px; letter-spacing: 0; }
.pack.best .pack-n small { color: var(--ink-2); }
.pack .row-sub { color: var(--ink-3); }
.pack.best .row-sub { color: var(--ink-2); }
.pack-price { display: inline-flex; align-items: center; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pack-price small { font-size: 11px; font-weight: 700; margin-left: 4px; opacity: 0.75; }
.pack.best .pack-price { background: var(--tomato); }
@media (max-width: 370px) { .pack { gap: 12px; padding: 14px; } .pack-n { width: 56px; font-size: 27px; } .pack-price { padding: 0 11px; } }
.best-tag { position: absolute; top: -13px; right: 18px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--tomato); color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); font: 800 12px/21px var(--ui); letter-spacing: 0.02em; text-transform: lowercase; rotate: 5deg; }
.pay-head { text-align: center; padding: 4px 0 2px; }
.pay-sum { font: 900 44px/1.05 var(--ui); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 6px 0 4px; overflow-wrap: anywhere; }
.pay-sub { color: var(--ink-3); font-size: 14.5px; font-weight: 500; }
.pay-state { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 4px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-align: left; }
.pay-state.bad { color: var(--tomato-2); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(30, 27, 22, 0.2); border-top-color: var(--ink); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.ok-badge { position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 16px; background: var(--mint); color: var(--ink); border: 4px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), 0 6px 14px rgba(0, 0, 0, 0.2); rotate: -8deg; animation: badgeIn 0.6s var(--spring) both; }
.ok-badge .ic { width: 34px; height: 34px; stroke-width: 3; }
@keyframes badgeIn { 0% { transform: scale(0) rotate(-60deg); } 100% { transform: none; } }
.kv { padding: 12px 16px; }
.kv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kv-head span { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.kv-head button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; margin-right: -6px; border-radius: 10px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 0 2px 0 var(--ink); font-size: 13.5px; font-weight: 700; }
.kv-head button:active { transform: translateY(2px); box-shadow: none; }
.kv-val { margin-top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv-val.big { font: 900 26px/1.15 var(--ui); letter-spacing: -0.02em; }
.kv-val.mono { font: 600 14px/1.45 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; word-break: break-all; }
.pay-note { font-size: 14px; color: var(--ink-3); line-height: 1.45; margin: 12px 2px 0; }
.pay-note b { color: var(--ink); font-weight: 700; }
.pay-actions { display: grid; gap: 12px; margin-top: 18px; }
.timer { font-variant-numeric: tabular-nums; }

/* ---------- Промокоды и приглашения ---------- */
.notice.promo-on { margin: 0 0 16px; background: var(--mint); }
.notice.promo-on .ic { color: var(--ink); }
.pack-price.disc { flex-direction: column; align-items: flex-end; justify-content: center; height: 48px; line-height: 1.1; }
.pack-price.disc s { font-weight: 600; font-size: 11.5px; opacity: 0.6; }
.bill-extra { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; margin-top: 10px; }
.promo-form { display: flex; gap: 8px; margin-top: 4px; animation: slap 0.4s var(--spring) both; }
.promo-form input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 13px; background: var(--paper); border: 2px solid var(--ink); color: var(--ink); font: 800 16px/1 var(--ui); letter-spacing: 0.05em; text-transform: uppercase; outline: 0; }
.promo-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-3); }
.promo-form .btn { flex: none; }
.invite { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 14px 15px 16px; margin-top: 18px; text-align: left; background: var(--mint); rotate: 0.8deg; transition: transform 0.12s var(--ease), box-shadow 0.12s; }
.invite:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.invite .row-ic { background: var(--paper); rotate: -6deg; }
.invite .row-title { font-weight: 800; }
.invite .row-sub { color: #1e3b2c; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.ref-stats div { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--pop); padding: 12px 6px; text-align: center; min-width: 0; }
.ref-stats div:nth-child(1) { rotate: -2deg; background: var(--yellow); }
.ref-stats div:nth-child(2) { rotate: 1.5deg; background: var(--pink); }
.ref-stats div:nth-child(3) { rotate: -1deg; background: var(--mint); }
.ref-stats b { display: block; font: 900 24px/1.1 var(--ui); }
.ref-stats span { display: block; font-size: 12.5px; line-height: 1.25; color: var(--ink-2); margin-top: 4px; font-weight: 600; }

/* ---------- Правка перед сборкой ---------- */
.versions { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.rv { transition: opacity 0.3s, rotate 0.4s var(--spring); }
.rv:nth-child(odd) { rotate: -0.4deg; }
.rv:nth-child(even) { rotate: 0.4deg; }
.rv-head { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 6px 8px 14px; }
.ver-num { flex: none; display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 999px; background: var(--tomato); color: #fff; border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--ink); font: 800 13px/1 var(--ui); rotate: -6deg; }
.rv-title { flex: 1; font: 700 23px/1 var(--hand); text-transform: lowercase; }
.rv-dur { font-size: 13.5px; font-weight: 600; color: var(--ink-3); flex: none; }
.rv-inc { width: 62px; height: 44px; display: grid; place-items: center; flex: none; }
.rv-body { padding: 2px 16px 10px; border-top: 2px dashed var(--dash); }
.rv-field { display: block; padding-top: 12px; }
.rv-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.rv-field textarea, .rv-field input { display: block; width: 100%; padding: 11px 13px; border-radius: 12px; background: var(--paper-2); border: 2px solid var(--ink); color: var(--ink); font: 500 16px/1.4 var(--ui); outline: 0; resize: none; transition: box-shadow 0.2s, background 0.2s; }
.rv-field textarea::placeholder, .rv-field input::placeholder { color: rgba(30, 27, 22, 0.38); }
.rv-field textarea:focus, .rv-field input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.25); }
.rv-hook textarea { font: 800 18px/1.3 var(--ui); letter-spacing: -0.01em; overflow: hidden; background: var(--sticky); }
.rv-hook textarea:focus { background: #fff1a6; }
.rv-alts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rv-alts:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 38px; padding: 7px 12px; border-radius: 12px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink-2); text-align: left; transition: transform 0.12s, box-shadow 0.12s, background 0.2s; animation: slap 0.4s var(--spring) backwards; }
.chip:active { transform: translateY(2px); box-shadow: none; }
.chip.on { background: var(--yellow); color: var(--ink); }
.chip.more { background: var(--blue); color: #fff; font-weight: 700; }
.chip.more .ic { color: #fff; }
.chip[disabled] { opacity: 0.8; }
.spin.sm { width: 14px; height: 14px; }
.chip.more .spin { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.ver-why { font: 700 19px/1.15 var(--hand); color: var(--blue); margin: 0; }
.rv .ver-why { margin-top: 12px; rotate: -0.6deg; }
.rv-more { margin-top: 12px; border-top: 2px dashed var(--dash); }
.rv-more summary { display: flex; align-items: center; gap: 8px; min-height: 48px; list-style: none; font-size: 14.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.rv-more summary::-webkit-details-marker { display: none; }
.rv-more summary .ic { color: var(--tomato); transition: transform 0.3s var(--spring); }
.rv-more[open] summary .ic { transform: rotate(90deg); }
.rv-more[open] { padding-bottom: 6px; }
.rv-more[open] > summary { margin-bottom: -4px; }
.rv-src { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--paper-2); border: 2px dashed var(--dash); }
.rv-src span { display: block; font: 700 18px/1 var(--hand); color: var(--tomato); margin-bottom: 6px; }
.rv-src p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.rv-offnote { display: none; margin: 0; padding: 0 16px 14px; font: 700 19px/1.1 var(--hand); color: var(--ink-3); }
.rv.off { opacity: 0.62; rotate: -1.2deg; box-shadow: 0 1px 0 var(--ink); }
.rv.off .rv-body { display: none; }
.rv.off .rv-offnote { display: block; }
.rv.off .ver-num { background: var(--sand); color: var(--ink-3); }
.rv.off .rv-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-3); }

/* ---------- Статистика ---------- */
.seg.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.seg.four .seg-ind { width: calc((100% - 8px) / 4); }
.seg.four button { height: 42px; font-size: 14px; }
#adm { transition: opacity 0.2s; }
#adm.loading { opacity: 0.45; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; border-radius: 16px; background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--pop); }
.kpi:nth-child(1) { background: var(--yellow); }
.kpi:nth-child(2) { background: var(--mint); }
.kpi-l { font: 700 18px/1 var(--hand); color: var(--ink-2); }
.kpi-v { font: 900 24px/1.1 var(--ui); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpi-s { font-size: 12.5px; line-height: 1.35; color: var(--ink-3); font-weight: 500; }
.kpi:nth-child(-n + 2) .kpi-s { color: var(--ink-2); }
.chart { padding: 14px 14px 10px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 100px; }
.bars i { flex: 1; min-width: 2px; height: max(3px, calc(var(--h) * 100%)); border-radius: 4px 4px 1px 1px; background: var(--tomato); transform-origin: bottom; animation: grow 0.7s var(--spring) both; }
.bars i:nth-child(3n + 2) { background: var(--blue); }
.bars i:nth-child(3n) { background: var(--mint); }
@keyframes grow { from { transform: scaleY(0); } }
.chart-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.lines > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.lines > div + div { border-top: 2px dashed var(--dash); }
.lines span { color: var(--ink-2); font-size: 15px; }
.lines b { font-weight: 700; text-align: right; }
.fn { padding: 12px 16px; }
.fn + .fn { border-top: 2px dashed var(--dash); }
.fn-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.fn-top span { color: var(--ink-2); }
.fn-top b { font-weight: 700; }
.fn-bar { height: 10px; margin-top: 8px; border-radius: 6px; background: var(--sand); border: 1.5px solid var(--ink); overflow: hidden; }
.fn-bar i { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--mint); transform-origin: left; animation: growX 0.8s var(--ease) both 0.2s; }
@keyframes growX { from { transform: scaleX(0); } }
.promo-row { display: flex; align-items: center; gap: 2px; min-height: 64px; padding: 8px 4px 8px 16px; }
.promo-row .icon-btn { border: 0; box-shadow: none; background: none; }
.promo-code { font: 700 15px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.03em; }
.promo-row.off .promo-code { color: var(--ink-3); text-decoration: line-through; }
.mini-switch { width: 62px; height: 44px; display: grid; place-items: center; flex: none; }
.field input[type='number']::-webkit-inner-spin-button, .field input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
.row .tag { flex: none; }

/* ---------- Пустые и ошибки ---------- */
.empty { text-align: center; padding: 40px 12px; }
.empty .ic-wrap { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--tomato); color: #fff; border: 4px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), 0 6px 14px rgba(0, 0, 0, 0.2); margin: 0 auto 22px; rotate: -8deg; animation: badgeIn 0.6s var(--spring) both; }
.empty p { color: var(--ink-2); margin: 10px auto 26px; max-width: 32ch; }
.empty .logo { font-size: 26px; padding: 12px 18px 11px; border-radius: 16px; margin-bottom: 30px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 100px); z-index: 60; transform: translate(-50%, 24px) rotate(-3deg) scale(0.9); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 40px); width: max-content; padding: 12px 16px; border-radius: 14px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: var(--pop-lg); font-size: 15px; font-weight: 700; line-height: 1.3; transition: opacity 0.2s, transform 0.45s var(--spring); }
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }
.toast .ic { width: 20px; height: 20px; flex: none; stroke-width: 2.6; color: var(--mint-ink); }
.toast.err { background: var(--tomato); color: #fff; }
.toast.err .ic { color: #fff; }

.skeleton { background: linear-gradient(90deg, var(--paper-2), var(--sand), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* конфетти-наклейки на «готово» */
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: var(--s); height: var(--s); background: var(--c); border: 2px solid #fff; border-radius: var(--br); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); animation: fall var(--d) cubic-bezier(0.25, 0.6, 0.4, 1) both var(--dl); }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: 0; } }

@media (min-width: 560px) { :root { --gutter: 28px; } }
/* ---------- Технические работы ---------- */
.mt { text-align: center; padding: 6vh 4px 36px; }
.mt .logo { font-size: 26px; padding: 12px 18px 11px; border-radius: 16px; margin-bottom: 4px; }
.mt-art { position: relative; display: block; width: 290px; max-width: 100%; height: 238px; margin: 0 auto; }
.mt-gear { position: absolute; display: block; filter: drop-shadow(0 3px 0 var(--ink)); }
.mt-gear > span { display: block; width: 100%; height: 100%; animation: mt-spin 10s linear infinite; }
.mt-gear svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mt-gear path { fill: currentColor; stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.mt-gear circle { fill: var(--bg); stroke: var(--ink); stroke-width: 3.5; }
.mt-gear.g1 { width: 132px; height: 132px; left: 24px; top: 4px; color: var(--yellow); }
.mt-gear.g2 { width: 98px; height: 98px; left: 130px; top: 14px; color: var(--mint); }
.mt-gear.g2 > span { animation-duration: 8s; animation-direction: reverse; }
.mt-art.kick .mt-gear svg { animation: mt-kick 0.9s var(--ease); }
.mt-art.kick .mt-gear.g2 svg { animation-name: mt-kick-r; }
.mt-tape { left: 50%; bottom: 98px; margin-left: -38px; rotate: 4deg; z-index: 4; }
.mt-sign { position: absolute; z-index: 3; left: 50%; bottom: 10px; width: 252px; margin-left: -126px; padding: 23px 12px 21px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); rotate: -3.5deg; overflow: hidden; }
.mt-sign::before, .mt-sign::after { content: ''; position: absolute; left: 0; right: 0; height: 11px; background: repeating-linear-gradient(-45deg, var(--ink) 0 9px, var(--yellow) 9px 18px); }
.mt-sign::before { top: 0; }
.mt-sign::after { bottom: 0; }
.mt-sign b { display: block; font: 900 27px/0.98 var(--ui); letter-spacing: -0.03em; text-transform: uppercase; color: var(--ink); }
.mt-wrench { position: absolute; z-index: 4; right: 0; bottom: 96px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--tomato); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), 0 5px 10px rgba(60, 40, 10, 0.25); animation: mt-wrench 2.4s var(--ease) infinite; }
.mt-wrench .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.mt-art.kick .mt-wrench { animation: mt-wrench 0.45s var(--ease) 2; }
.mt .overline { margin-top: 18px; }
.mt-text { color: var(--ink-2); margin: 10px auto 0; max-width: 32ch; }
.mt-note { display: inline-block; margin: 26px auto 0; padding: 12px 24px 14px; }
@keyframes mt-spin { to { transform: rotate(360deg); } }
@keyframes mt-kick { to { transform: rotate(180deg); } }
@keyframes mt-kick-r { to { transform: rotate(-225deg); } }
@keyframes mt-wrench { 0%, 100% { rotate: 8deg; } 45% { rotate: -24deg; } 62% { rotate: -14deg; } }

/* Доступ в статистике */
.mt-banner { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 2px 0 18px; padding: 13px 14px 13px 20px; text-align: left; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; transition: transform 0.12s, box-shadow 0.12s; }
.mt-banner::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: repeating-linear-gradient(-45deg, var(--ink) 0 7px, var(--yellow) 7px 14px); }
.mt-banner:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.mt-banner-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tomato); color: #fff; border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--ink); }
.mt-banner-ic .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.mt-banner > .ic { flex: none; width: 18px; height: 18px; color: var(--ink-2); }
#acc, #payb, #budb { margin-bottom: 18px; }
#acc:empty, #payb:empty, #budb:empty { display: none; }
.bud-row { width: 100%; text-align: left; }
.bud-bar { display: block; height: 8px; margin-top: 9px; }
.bud-bar.warn i { background: var(--yellow); }
.bud-bar.bad i { background: var(--tomato); }
.tag.warn { background: var(--yellow); }
.tag.bad { background: var(--tomato); color: #fff; }
.bud-links { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
/* оплата в админке: статусы способов и комиссия СБП */
.tag.on { background: var(--mint); }
.tag.off { background: var(--sand); color: var(--ink-3); }
.mono-s { font: 600 13px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-2); }
.fee-row { gap: 10px; }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper b { min-width: 52px; text-align: center; font: 900 20px/1 var(--ui); letter-spacing: -0.02em; }
.stepper .icon-btn { width: 38px; height: 38px; }
.seg-tag { position: absolute; top: -14px; right: -4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--tomato); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); font: 800 11px/18px var(--ui); letter-spacing: 0.02em; text-transform: lowercase; rotate: 6deg; pointer-events: none; z-index: 1; }
.acc-h { margin: 18px 2px 8px; font: 700 21px/1 var(--hand); color: var(--tomato); rotate: -1deg; transform-origin: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .confetti { display: none; }
}
