/* Тёмная тема студии — в духе кабинета VeonGen: чёрный фон, тёмные карточки, фиолетовый акцент,
   золотые метки. Подключается после app.css и перекрывает его светлые цвета. */
:root {
  --bg: #06070b; --bg2: #10151f; --card: #161c29; --line: #282c42;
  --text: #ffffff; --muted: rgba(255, 255, 255, .62); --gold: #a855f7; --red: #a855f7; --ok: #34d399;
  --accent: #ffd700; --pri1: #b44dff; --pri2: #7c3aed; --r: 14px;
  color-scheme: dark;
}
body {
  color: var(--text);
  background: radial-gradient(1100px 520px at 60% -12%, rgba(168, 37, 255, .20), transparent 65%), var(--bg);
  background-attachment: fixed;
}
a { color: #c084fc; }
::selection { background: rgba(168, 85, 247, .45); }
* { scrollbar-color: #2b3048 transparent; }

/* каркас */
.side { background: #0a0c13; border-right: 1px solid var(--line); backdrop-filter: none; }
.side nav a { color: rgba(255, 255, 255, .78); border-radius: 10px; }
.side nav a:hover { background: var(--bg2); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, rgba(168, 37, 255, .26), rgba(168, 37, 255, .06)); color: #fff; box-shadow: inset 2px 0 0 #b44dff; }
.side nav a i { color: rgba(255, 255, 255, .55); }
.side nav a:hover i, .side nav a.on i { color: #d8b4fe; }
.side nav a small { color: var(--accent); background: rgba(255, 215, 0, .1); padding: 1px 7px; border-radius: 99px; font-size: 10.5px; }
.navsep { color: rgba(255, 255, 255, .4); border-color: var(--line); }
.logo { color: #fff; }
.tabbar { background: rgba(8, 9, 14, .94); border-top: 1px solid var(--line); }
.tabbar a { color: rgba(255, 255, 255, .6); }
.tabbar a.on { color: #fff; }
.foot { color: rgba(255, 255, 255, .42); border-color: var(--line); }
.foot a { color: rgba(255, 255, 255, .6); }

/* кнопки и чипсы */
.btn, .pill, .chip.on { background: linear-gradient(120deg, var(--pri1), var(--pri2)); color: #fff; }
.btn { border-radius: 12px; box-shadow: 0 10px 24px -14px rgba(168, 37, 255, .9); }
.btn:hover, .pill:hover { filter: brightness(1.12); }
.btn.ghost, .pill.ghost { background: var(--bg2); color: #fff; border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover, .pill.ghost:hover { border-color: #4a4f72; }
.pill { border-radius: 12px; }
.chip { background: var(--bg2); border: 1px solid var(--line); color: rgba(255, 255, 255, .85); border-radius: 10px; }
.chip:hover { border-color: #4a4f72; }
.chip.on { border-color: transparent; }
.pub { background: var(--bg2); color: #d8b4fe; border: 1px solid var(--line); }
.pub.on { color: var(--ok); }

/* карточки образов: название поверх фото, значок и золотая метка */
.thumb { background: linear-gradient(160deg, #1a2030, #0e121b); border: 1px solid var(--line); border-radius: var(--r); }
.thumb .emoji { opacity: .9; }
a.tcard[data-cat] { position: relative; display: block; border-radius: var(--r); overflow: hidden; transition: transform .2s; }
a.tcard[data-cat]:hover { transform: translateY(-3px); }
a.tcard[data-cat] .thumb, a.tcard[data-cat]:hover .thumb { transform: none; }
a.tcard[data-cat] .thumb img { transition: transform .5s; }
a.tcard[data-cat]:hover .thumb img { transform: scale(1.05); }
a.tcard[data-cat] .tname { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 10px 10px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88)); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 1.25; letter-spacing: .5px; text-transform: uppercase; }
a.tcard[data-cat] .tname small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .6); font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.tcard .kind { position: absolute; z-index: 1; top: 8px; left: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); color: #fff; }
.tcard .kind svg { width: 15px; height: 15px; }
.tcard .hot { position: absolute; z-index: 1; top: 8px; right: 8px; padding: 3px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  color: #1a1400; background: var(--accent); }
.tname { color: #fff; }
.colhead a { color: #c084fc; }
.col > .muted, .muted { color: var(--muted); }

/* главная студии: блок «Создавай» */
.create { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin: 8px 0 34px; }
.createbox { position: relative; overflow: hidden; padding: 30px; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(600px 260px at 12% 0, rgba(168, 37, 255, .28), transparent 70%), var(--bg2); }
.createbox h1 { margin: 0 0 6px; font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -.6px; }
.createbox p { margin: 0 0 20px; color: var(--muted); }
.ctabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ctabs button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: rgba(255, 255, 255, .75); font: 600 13.5px inherit; font-family: inherit; cursor: pointer; }
.ctabs button.on { background: #fff; color: #0b0c12; border-color: #fff; }
.cline { display: flex; gap: 10px; padding: 8px; border-radius: 14px; background: #0a0c13; border: 1px solid var(--line); }
.cline:focus-within { border-color: #7c3aed; }
.cline input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; padding: 8px 10px; }
.cline input::placeholder { color: rgba(255, 255, 255, .4); }
.cline .btn { padding: 12px 22px; white-space: nowrap; }
.chint { margin: 12px 0 0 !important; font-size: 13px; }
.waterbox { position: relative; min-height: 220px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #02080e; cursor: crosshair; touch-action: none; }
.waterbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.waterbox span { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: rgba(232, 244, 255, .5); pointer-events: none; }
.waterbox.nofx { background: radial-gradient(circle at 50% 45%, #0e3a52, #02080e 70%); }
.trendgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 900px) { .create { grid-template-columns: 1fr; } .waterbox { display: none; } .createbox { padding: 20px; } .cline { flex-direction: column; } .trendgrid { grid-template-columns: repeat(2, 1fr); } }

/* инструменты */
.tool { background: var(--bg2); border: 1px solid var(--line); }
.tool:hover { background: var(--card); }
.tool .d { color: var(--muted); }
.tool .tag { background: rgba(255, 255, 255, .08); color: #e9d5ff; }
.tool.soon .tag { color: var(--accent); background: rgba(255, 215, 0, .1); }
.tool.soon .ic { color: rgba(255, 255, 255, .5); background: #1b2130; }
.tool:not(.soon)::before { opacity: .45; }
.toolart { color: #d8b4fe; background: radial-gradient(circle at 50% 45%, rgba(168, 37, 255, .35) 0 18%, transparent 62%), linear-gradient(160deg, #161c29, #0c1018); }
.soonart { color: rgba(255, 255, 255, .5); }
.soontag { background: var(--bg2); color: var(--accent) !important; border: 1px solid var(--line); }

/* формы и панели */
.prompt, .copyrow input, .payform input, .payform textarea, .emaillogin input, .subform input[type=email], .email input,
textarea, input[type=text], input[type=email], input[type=number], select {
  background: #0a0c13; color: #fff; border: 1px solid var(--line); border-radius: 12px; }
.prompt:focus, textarea:focus, input:focus { outline: 0; border-color: #7c3aed; }
::placeholder { color: rgba(255, 255, 255, .38); }
.drop { background: #0a0c13; border-color: #3a3f5c; border-radius: 14px; color: rgba(255, 255, 255, .7); }
.drop:hover { border-color: #7c3aed; }
.drop.has, .result { border-color: #a855f7; }
.pic button, .thumb .del { background: rgba(0, 0, 0, .7); }
.panel > p, .tips, .field, .consent { color: var(--muted); }
.consent a, .tips a { color: #c084fc; }
.status { color: #d8b4fe; }
.err { color: #ff7b8e; }
.modal { background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.modal .card { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; color: #fff; }
.modal .x { color: rgba(255, 255, 255, .6); }
.pack { background: #0a0c13; border: 1px solid var(--line); color: #fff; border-radius: 14px; }
.pack:hover { background: var(--card); border-color: #7c3aed; }
.pack .price { color: #d8b4fe; }
.tabs { border-color: var(--line); }
.tabs a { color: var(--muted); }
.tabs a.on { color: #fff; border-bottom-color: #a855f7; }
.ticket .tag { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .7); }
table { color: #fff; }
th { color: var(--muted); }
td, th { border-color: var(--line); }
.legal, .legal p, .legal li { color: rgba(255, 255, 255, .82); }
audio { filter: invert(.9) hue-rotate(180deg); border-radius: 99px; }
.steps b { background: var(--bg2); color: #d8b4fe; }
.empty { color: var(--muted); }
.fprompt { color: var(--muted); }
h2.sub, .colhead h2, .panel h1, .mebox h1 { color: #fff; }
.side nav a.dot::after { background: var(--accent); }

/* страница входа /auth */
body.authpage { margin: 0; min-height: 100vh; display: grid; padding: 40px; background: #000; }
.authcard { display: grid; grid-template-columns: 380px 1fr; border-radius: 16px; overflow: hidden; background: #0b0d14; border: 1px solid var(--line); min-height: calc(100vh - 80px); }
.authside { display: flex; flex-direction: column; align-items: stretch; padding: 40px; gap: 26px; }
.authside .logo { justify-content: center; font-size: 22px; }
#login { display: grid; gap: 10px; margin-top: 10px; }
.authlabel { margin: 0 0 6px; text-align: center; font-size: 13px; color: var(--muted); }
.authside .logins { margin: 0; }
.authside .btn { display: block; width: 100%; padding: 14px 20px; border-radius: 8px; text-align: center; font-size: 15px; font-weight: 500; text-decoration: none; }
.authside .btn.ghost { text-align: left; }
.authside .emaillogin { display: grid; gap: 8px; }
.authhelp { margin-top: 14px; text-align: center; font-size: 13px; color: #c084fc; text-decoration: none; }
.authlegal { margin-top: auto; display: grid; gap: 8px; text-align: center; }
.authlegal a { font-size: 12px; color: rgba(255, 255, 255, .45); text-decoration: none; }
.authlegal a:hover { color: #fff; }
.authwall { position: relative; overflow: hidden; background: #000; }
.authgrid { position: absolute; inset: -20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 12px; opacity: .55; }
.authgrid figure { position: relative; margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; }
.authgrid img { width: 100%; height: 100%; object-fit: cover; }
.authgrid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 8px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.authglass { position: absolute; top: 0; bottom: 0; right: 14%; width: min(420px, 60%); display: grid; align-content: center; padding: 30px; text-align: center;
  background: rgba(10, 10, 14, .55); backdrop-filter: blur(22px); }
.authglass h1 { margin: 0 0 16px; font-size: clamp(30px, 3.6vw, 50px); line-height: 1.12; font-weight: 700; text-transform: uppercase; hyphens: manual; }
.authglass p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 17px; }
@media (max-width: 860px) {
  body.authpage { padding: 0; }
  .authcard { grid-template-columns: 1fr; border-radius: 0; border: 0; min-height: 100vh; }
  .authwall { order: -1; min-height: 240px; }
  .authglass { right: 0; width: 100%; }
  .authglass h1 { font-size: 26px; }
  .authside { padding: 26px 20px 30px; }
}

/* строка запроса в «Создавай»: поле в несколько строк, чтобы подсказка читалась целиком */
.cline { flex-direction: column; align-items: stretch; padding: 10px; }
.cline textarea { width: 100%; min-height: 76px; border: 0; outline: 0; resize: none; background: transparent; color: #fff; font: inherit; line-height: 1.45; padding: 6px 8px; border-radius: 0; }
.cline textarea:focus { border: 0; }
.cline textarea::placeholder { color: rgba(255, 255, 255, .45); white-space: normal; }
.cline .btn { align-self: flex-end; }
@media (max-width: 900px) { .cline .btn { align-self: stretch; } }

/* ===== Лента как в TikTok: работа на весь экран, свайп вверх-вниз ===== */
body.feedpage { overflow: hidden; }
body.feedpage main { padding: 0; max-width: none; }
body.feedpage .foot { display: none; }
.reels { height: calc(100dvh - 76px); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.reels::-webkit-scrollbar { display: none; }
.reel-item { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: grid; place-items: center; background: #000; }
.reel-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45); }
.reel-item > img, .reel-item > video { position: relative; max-width: 100%; max-height: 100%; height: 100%; object-fit: contain; }
.reel-info { position: absolute; left: 0; right: 76px; bottom: 0; padding: 60px 18px 20px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); pointer-events: none; }
.reel-info b { font-size: 17px; }
.reel-info p { margin: 6px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-info .btn { pointer-events: auto; margin-top: 12px; display: inline-block; text-decoration: none; }
.reel-acts { position: absolute; right: 10px; bottom: 22px; display: grid; gap: 16px; justify-items: center; }
.ra { display: grid; justify-items: center; gap: 4px; border: 0; background: none; color: #fff; font: 600 11px inherit; font-family: inherit; cursor: pointer; padding: 0; min-width: 56px; }
.ra svg { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.ra:active svg { transform: scale(.88); }
.ra.like.on svg { fill: #ff3b6b; stroke: #ff3b6b; }
.ra span { text-shadow: 0 1px 4px rgba(0, 0, 0, .8); min-height: 14px; }
.reel-heart { position: absolute; font-size: 110px; color: #ff3b6b; pointer-events: none; animation: heart .7s ease-out forwards; text-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
@keyframes heart { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1) translateY(-30px); opacity: 0; } }
@media (min-width: 961px) { .reel-item > img, .reel-item > video { border-radius: 18px; height: calc(100% - 32px); } .reel-acts { right: calc(50% - 300px); } .reel-info { left: calc(50% - 280px); right: auto; width: 440px; border-radius: 0 0 18px 18px; bottom: 16px; } }
@media (max-width: 960px) { .reels { height: calc(100dvh - 64px - 62px - env(safe-area-inset-bottom)); } }

/* окно «Поделиться» и подсказки */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; justify-items: center; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.sheet[hidden], .toast[hidden] { display: none; }
.sheet-in { width: min(520px, 100%); padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--bg2); border: 1px solid var(--line); border-bottom: 0; animation: sheet .25s ease-out; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-in { border-radius: 22px; border-bottom: 1px solid var(--line); } .sheet-grip { display: none; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #3a3f5c; margin: 0 auto 12px; }
.sheet h3 { margin: 6px 0 16px; font-size: 18px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }
.sn { display: grid; justify-items: center; gap: 7px; border: 0; background: none; color: #fff; font: 500 12px inherit; font-family: inherit; cursor: pointer; padding: 0; }
.sn[hidden] { display: none; }
.sn i { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-style: normal; font-weight: 700; font-size: 16px; color: #fff; }
.sn:hover i { filter: brightness(1.15); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 96px; translate: -50% 0; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: #1c2233; border: 1px solid var(--line); color: #fff; font-size: 14px; box-shadow: 0 20px 40px -15px #000; }
.pubrow { display: flex; gap: 6px; margin-top: 6px; }
.pubrow .pub { margin-top: 0; flex: 1; text-align: center; text-decoration: none; padding: 6px 4px; }
.sheet { z-index: 60; }

/* «горящая» кнопка на каждом образе: сразу к генерации по этому примеру */
a.tcard[data-cat] .tname { padding-top: 46px; }
.tcard .go { display: block; margin-top: 8px; padding: 8px 6px; border-radius: 10px; text-align: center; text-transform: none; letter-spacing: 0;
  font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(120deg, #c026d3, #7c3aed);
  box-shadow: 0 0 0 0 rgba(192, 38, 211, .7); animation: goglow 2.2s ease-in-out infinite; }
a.tcard[data-cat]:hover .go { filter: brightness(1.15); }
@keyframes goglow { 0%, 100% { box-shadow: 0 0 10px 0 rgba(192, 38, 211, .55); } 50% { box-shadow: 0 0 22px 4px rgba(192, 38, 211, .95); } }
@media (prefers-reduced-motion: reduce) { .tcard .go { animation: none; box-shadow: 0 0 14px rgba(192, 38, 211, .7); } }

/* лента: автор, озвучки, защита от сохранения чужих работ */
.reel-item > img, .reel-item > video { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.reel-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.reel-author i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-weight: 700; font-size: 14px; border: 2px solid rgba(255, 255, 255, .85); }
.reel-author em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.reel-info .go { animation: goglow 2.2s ease-in-out infinite; background: linear-gradient(120deg, #c026d3, #7c3aed); }
.reel-item.audio { background: radial-gradient(600px 500px at 50% 35%, rgba(168, 37, 255, .35), transparent 70%), #07080d; }
.reel-audio { position: relative; display: grid; justify-items: center; gap: 22px; width: min(440px, 100% - 110px); margin-right: 60px; text-align: center; cursor: pointer; }
.reel-audio p { margin: 0; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.45; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.reel-audio .playhint { font-size: 13px; color: rgba(255, 255, 255, .6); }
.reel-item.playing .playhint { visibility: hidden; }
.eq { display: flex; align-items: center; gap: 4px; height: 70px; }
.eq i { width: 5px; height: 14px; border-radius: 4px; background: linear-gradient(#e879f9, #7c3aed); }
.reel-item.playing .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(3n) { animation-delay: -.3s !important; } .eq i:nth-child(3n+1) { animation-delay: -.6s !important; } .eq i:nth-child(4n) { animation-duration: .7s !important; } .eq i:nth-child(5n) { animation-duration: 1.3s !important; }
@keyframes eq { 0%, 100% { height: 12px; } 50% { height: 64px; } }
.fcard .thumb.aud { display: grid; place-items: center; color: #d8b4fe; }
.fcard .thumb.aud svg { width: 44px; height: 44px; }
.reel-info b { display: block; }

/* примеры на странице инструмента */
.exbox { position: relative; aspect-ratio: 9 / 16; max-height: 78vh; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.exbox.wide { aspect-ratio: 1452 / 900; max-height: none; }
.exbox .ex { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.exbox.wide .ex { object-fit: contain; }
.exbox .ex.on { opacity: 1; }
.exlabel { position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #1a1400; background: var(--accent); }
.exdots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 7px; }
.exdots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .45); cursor: pointer; }
.exdots button.on { background: #fff; width: 22px; border-radius: 6px; }
.preview:has(.result:not([hidden])) .exbox { display: none; }

/* «живые» карточки: оживлённые превью шаблонов и видео-идеи */
.thumb video[data-live] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb video + .emoji { display: none; }
.tcard .hot.livebadge { color: #fff; background: linear-gradient(120deg, #f43f5e, #c026d3); }
.tcard.idea .thumb { aspect-ratio: 3 / 4; }
.colhead .muted { font-size: 13px; font-weight: 400; text-align: right; }


/* ===== Партнёрская программа: мотивационный блок, пример кабинета, калькулятор ===== */
.refhero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; padding: 30px; margin: 8px 0 22px; border-radius: 24px; border: 1px solid var(--line);
  background: radial-gradient(700px 320px at 0 0, rgba(168, 37, 255, .28), transparent 70%), radial-gradient(500px 300px at 100% 100%, rgba(34, 197, 94, .12), transparent 70%), var(--bg2); }
.refpill { display: inline-block; padding: 6px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: #1a1400; background: var(--accent); }
.refhero h1 { margin: 14px 0 12px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -.8px; }
.refhero-text > p { color: rgba(255, 255, 255, .78); font-size: 16px; }
.refhero-text > p b { color: #fff; }
.refpoints { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; gap: 10px; }
.refpoints li { display: grid; gap: 2px; padding-left: 30px; position: relative; }
.refpoints li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #052e1a; background: #4ade80; }
.refpoints span { color: var(--muted); font-size: 14px; }
.refdemo { position: relative; padding: 22px; border-radius: 22px; background: #0a0c13; border: 1px solid #2f3550; box-shadow: 0 40px 80px -40px rgba(34, 197, 94, .45); rotate: 1.5deg; }
.refdemo-tag { position: absolute; top: -12px; left: 18px; padding: 4px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #1a1400; background: var(--accent); }
.refdemo-top { padding: 8px 0 16px; border-bottom: 1px solid var(--line); }
.refdemo-top > span { font-size: 13px; color: var(--muted); }
.refdemo-top > b { display: block; margin: 2px 0 12px; font-size: 40px; font-weight: 700; letter-spacing: -1px; color: #4ade80; }
.refdemo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.refdemo-btns .btn { padding: 9px 14px; font-size: 13px; pointer-events: none; }
.refdemo-btns .btn:first-child { background: linear-gradient(120deg, #22c55e, #16a34a); box-shadow: none; }
.refdemo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.refdemo-stats b { display: block; font-size: 19px; } .refdemo-stats span { font-size: 12px; color: var(--muted); }
.refdemo-list { display: grid; gap: 8px; padding-top: 14px; }
.refdemo-list div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.refdemo-list i { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-weight: 700; color: #4ade80; background: rgba(74, 222, 128, .14); }
.refdemo-list span { flex: 1; color: rgba(255, 255, 255, .8); } .refdemo-list b { color: #4ade80; white-space: nowrap; }
.refdemo-note { margin: 14px 0 0; font-size: 12px; color: rgba(255, 255, 255, .5); }
.refcalc { padding: 24px 28px; margin-bottom: 24px; border-radius: 22px; background: var(--bg2); border: 1px solid var(--line); }
.refcalc h2 { margin: 0 0 16px; font-size: 20px; }
.refcalc-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 22px; align-items: end; }
.refcalc label { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.refcalc input[type=range] { width: 100%; accent-color: #a855f7; padding: 0; border: 0; background: none; }
.refcalc output { font-size: 22px; font-weight: 700; color: #fff; }
.refcalc select { padding: 11px 12px; font: inherit; }
.refcalc-out { padding: 14px 18px; border-radius: 16px; background: rgba(74, 222, 128, .09); border: 1px solid rgba(74, 222, 128, .3); }
.refcalc-out span { font-size: 13px; color: var(--muted); } .refcalc-out b { display: block; font-size: 30px; letter-spacing: -.6px; color: #4ade80; } .refcalc-out small { font-size: 11.5px; color: rgba(255, 255, 255, .5); }
@media (max-width: 900px) { .refhero { grid-template-columns: 1fr; padding: 20px; } .refdemo { rotate: none; } .refcalc-row { grid-template-columns: 1fr; } .refcalc { padding: 20px; } }

.whofield { width: 100%; margin-top: 14px; padding: 13px 14px; font: inherit; }
.whofield + .prompt { margin-top: 10px; min-height: 84px; }

.exbox.card { aspect-ratio: 3 / 4; }

/* лента: фото и открытки целиком — картинка стоит над подписью, а не под ней */
.reel-item.photo { align-items: start; }
.reel-item.photo > img { height: calc(100% - 150px); width: 100%; max-width: 100%; margin-top: 6px; object-fit: contain; object-position: 50% 0; }
.reel-item.photo .reel-info { background: linear-gradient(transparent, rgba(0, 0, 0, .55) 30%, rgba(0, 0, 0, .75)); }
@media (min-width: 961px) {
  .reel-item.photo > img { height: calc(100% - 170px); margin-top: 16px; border-radius: 18px; width: auto; }
  .reel-item.photo .reel-info { bottom: 16px; }
}
/* высота кадра — от высоты ленты (проценты внутри сетки на компьютере не срабатывают) */
.reel-item.photo > img { height: calc(100dvh - 76px - 170px); }
@media (max-width: 960px) { .reel-item.photo > img { height: calc(100dvh - 64px - 62px - 150px - env(safe-area-inset-bottom)); } }

.reel-author em.pick { color: #1a1400; background: var(--accent); }

/* личный кабинет */
.cab { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 6px; }
.cabcard { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); }
.cabcard.wide { grid-column: 1 / -1; }
.cablabel { font-size: 13px; color: var(--muted, #a59cc0); }
.cabbig { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.4px; }
.cabnote { margin: 0; font-size: 14px; color: #c9c1e0; line-height: 1.45; }
.cabnote.ok { color: #86efac; }
.cabcard .copyrow { width: 100%; max-width: none; margin: 4px 0; }
.cabstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.cabstats div { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.cabstats b { display: block; font-size: 18px; color: #fff; }
.cabstats span { font-size: 12.500px; color: #a59cc0; }
.cabcard .lnk { color: #c4b5fd; font-weight: 600; font-size: 14px; }
@media (max-width: 640px) { .cab { grid-template-columns: 1fr; } .cabstats { grid-template-columns: 1fr 1fr; } .cabcard .copyrow { flex-direction: column; } }

/* студия внутри Telegram */
.tgonly { display: none; }
body.tg .tgonly { display: inline-flex; }
body.tg .top .logo { pointer-events: none; }                 /* «домой» ведёт кнопка «Назад» Telegram */
body.tg #loginBtn, body.tg a[href="/auth"] { display: none !important; }
body.tg { overscroll-behavior: none; }
body.tg .tabbar { padding-bottom: max(8px, env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px)); }

/* телефон: образ не залипает поверх формы, картинка компактная, кнопка генерации сразу видна */
@media (max-width: 760px) {
  .preview { position: static; }
  /* пример целиком, без обрезки: картинка просто уменьшена по высоте и стоит по центру */
  .studio .thumb.big { aspect-ratio: auto; height: auto; max-height: none; width: 100%; display: flex; justify-content: center; background: none; border: 0; box-shadow: none; }
  .studio .thumb.big img { position: static; inset: auto; width: auto; max-width: 100%; height: auto; max-height: 46vh; object-fit: contain; border-radius: 18px; display: block; }
  .studio .result:not([hidden]) { max-height: 62vh; width: 100%; object-fit: contain; }
  .studio .panel h1 { font-size: 22px; margin-top: 4px; }
  .studio .panel > p { font-size: 14px; }
}

.nowm { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(124, 58, 237, .12); border: 1px solid rgba(167, 139, 250, .35); cursor: pointer; font-size: 14px; color: #e9e3ff; }
.nowm input { width: 18px; height: 18px; accent-color: #8b5cf6; }
.nowm[hidden] { display: none; }
