:root {
  --bg: #f5f0e8; --bg2: #fbf8f3; --card: #ffffff; --card2: #f3ede4; --line: #e6ddd0; --line2: #d6cab9;
  --text: #1f1a15; --text2: #4a4239; --muted: #7a6f63; --dim: #a39888;
  --acc: #ef4f2b; --acc2: #d9431f; --acc-soft: rgba(239, 79, 43, .09); --vio: #5a4bff; --ok: #12935f; --bad: #d92d4a; --warn: #b7791f;
  --ink: #1f1a15; --sh: 0 1px 2px rgba(60, 40, 20, .05), 0 6px 20px rgba(60, 40, 20, .06);
  --r: 14px; --r2: 22px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --disp: "Onest", "Manrope", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; } .mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; padding: 12px 24px; background: rgba(245, 240, 232, .86);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.logo svg { width: 32px; height: 32px; flex: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 13px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.on { color: var(--text); background: var(--card2); }
.top .sp { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.chip:hover { border-color: var(--line2); }
.chip.gift { background: linear-gradient(90deg, rgba(239, 79, 43, .18), rgba(90, 75, 255, .18)); border-color: rgba(239, 79, 43, .35); }
.chip b { color: var(--acc2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); border: 1px solid var(--line2); font-weight: 700;
  text-decoration: none; font-size: 14px; }

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--card2); font-weight: 650; cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--acc); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 8px 22px rgba(239, 79, 43, .28); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.big { padding: 15px 22px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.inp { width: 100%; padding: 11px 13px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.inp:focus { border-color: var(--acc); }
textarea.inp { resize: vertical; min-height: 120px; line-height: 1.5; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 10px 0 16px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--acc); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--acc-soft); border-color: rgba(239, 79, 43, .55); color: var(--text); }
.tabs { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 13px; gap: 2px; }
.tabs > * { flex-shrink: 0; white-space: nowrap; }
.tabs button { padding: 8px 16px; border: 0; background: none; border-radius: 10px; color: var(--muted); font-weight: 650; cursor: pointer; }
.tabs button.on { background: var(--card2); color: var(--text); }

/* ---------- раскладка ---------- */
main { min-height: calc(100vh - 140px); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.narrow { max-width: 560px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > * { min-width: 0; }
.grid2.wl { grid-template-columns: 1.25fr 1fr; align-items: start; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h1 { font-size: 30px; margin: 0; }

/* ---------- студия ---------- */
.studio { display: grid; grid-template-columns: 420px 1fr; gap: 22px; align-items: start; }
.panel { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; max-height: calc(100vh - 92px); overflow: auto; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.panel h3:first-of-type { margin-top: 16px; }
.mpick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; text-align: left; }
.mpick:hover { border-color: var(--dim); }
.mpick .ic { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.mpick .t { flex: 1; min-width: 0; }
.mpick .t b { display: block; }
.mpick .t span { font-size: 12px; color: var(--muted); }
.mlist { display: grid; gap: 6px; margin-top: 8px; }
.mlist button { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; }
.mlist button:hover { background: var(--bg2); }
.mlist button.on { border-color: rgba(239, 79, 43, .5); background: var(--acc-soft); }
.mlist .ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; }
.mlist .t { flex: 1; min-width: 0; }
.mlist .t b { display: block; font-size: 14px; }
.mlist .t span { display: block; font-size: 12px; color: var(--muted); }
.mlist .pr { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--card2); color: var(--acc2); margin-left: 6px; vertical-align: 1px; }
.drop { display: block; border: 1.5px dashed var(--line2); border-radius: 14px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--acc); color: var(--text); background: var(--acc-soft); }
.refs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.refs .r { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.refs .r img { width: 100%; height: 100%; object-fit: cover; }
.refs .r em { position: absolute; left: 4px; bottom: 3px; font-style: normal; font-size: 10px; font-weight: 700; background: rgba(0, 0, 0, .65); padding: 0 4px; border-radius: 4px; }
.refs .r button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.opt { margin-bottom: 12px; }
.opt > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.go { position: sticky; bottom: -18px; margin: 18px -18px -18px; padding: 14px 18px 18px; background: linear-gradient(transparent, var(--card) 22%); }
.go .note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }
.counter { font-size: 12px; color: var(--dim); text-align: right; margin-top: 4px; }

/* ---------- карточки генераций ---------- */
.feedhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.feed { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: .15s; display: flex; flex-direction: column; }
.gcard:hover { border-color: var(--line2); transform: translateY(-2px); }
.gmedia { position: relative; aspect-ratio: 1 / 1; background: var(--bg2); overflow: hidden; }
.gmedia img, .gmedia video { width: 100%; height: 100%; object-fit: cover; }
.gmedia .badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.gmedia .cnt { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: rgba(0, 0, 0, .6); }
.gmedia .play { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.gmedia .play::after { content: ""; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.gwait { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px;
  background: radial-gradient(120% 90% at 30% 20%, rgba(239, 79, 43, .22), transparent 60%), radial-gradient(100% 80% at 80% 90%, rgba(90, 75, 255, .22), transparent 60%), var(--bg2); }
.gwait::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); background-size: 250% 100%; animation: sh 1.8s linear infinite; }
@keyframes sh { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.gwait b { font-size: 26px; display: block; }
.gwait span { font-size: 12px; color: var(--muted); }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; width: 140px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--vio)); transition: width .6s; }
.gfail { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; font-size: 13px; color: var(--muted); background: repeating-linear-gradient(135deg, var(--bg2), var(--bg2) 10px, var(--card2) 10px, var(--card2) 20px); }
.gfail b { color: var(--bad); display: block; margin-bottom: 4px; }
.ginfo { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ginfo .p { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.ginfo .m { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 8px; }
.gid { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); cursor: copy; white-space: nowrap; }
.gid:hover { color: var(--text); border-color: var(--line2); }
.empty { text-align: center; padding: 60px 20px; border: 1.5px dashed var(--line); border-radius: var(--r2); color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- фильтры истории ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .inp { width: 260px; padding: 9px 12px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }

/* ---------- просмотр ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(40, 30, 20, .38); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.mbox { background: var(--card); border: 1px solid var(--line2); border-radius: 22px; width: min(1180px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-columns: 1fr 380px; overflow: hidden; position: relative; }
.mbox.small { width: min(460px, 100%); display: block; padding: 26px; overflow: auto; }
.mclose { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; font-size: 18px; line-height: 1; }
.vmedia { background: #000; display: flex; flex-direction: column; min-height: 0; }
.vmedia .main { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; }
.vmedia .main img, .vmedia .main video { max-height: calc(100vh - 140px); width: auto; max-width: 100%; object-fit: contain; border-radius: 8px; }
.vmedia .thumbs { display: flex; gap: 8px; padding: 10px; justify-content: center; }
.vmedia .thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; opacity: .6; }
.vmedia .thumbs img.on { border-color: var(--acc); opacity: 1; }
.vside { padding: 22px; overflow: auto; border-left: 1px solid var(--line); }
.vside .idrow { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.vside .idrow .gid { font-size: 14px; padding: 5px 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.prompt { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-done { color: var(--ok); background: rgba(18, 147, 95, .1); } .st-run, .st-queued { color: var(--warn); background: rgba(183, 121, 31, .1); }
.st-failed, .st-blocked { color: var(--bad); background: rgba(217, 45, 74, .1); }

/* ---------- кредиты ---------- */
.bal { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat b { display: block; font-size: 30px; letter-spacing: -.02em; margin-top: 6px; }
.stat.main { background: linear-gradient(135deg, rgba(239, 79, 43, .2), rgba(90, 75, 255, .14)); border-color: rgba(239, 79, 43, .3); }
.stat small { color: var(--muted); font-size: 12px; }
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pack { padding: 16px 14px; border-radius: 16px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; text-align: left; position: relative; }
.pack:hover { border-color: var(--dim); }
.pack.on { border-color: var(--acc); background: var(--acc-soft); }
.pack b { display: block; font-size: 22px; }
.pack span { font-size: 13px; color: var(--muted); }
.pack em { position: absolute; top: -9px; right: 10px; font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ok); color: #fff; }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.method { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-weight: 650; }
.method.on { border-color: var(--acc); background: var(--acc-soft); }
.method small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.method .mi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plus { color: var(--ok); font-weight: 700; } .minus { color: var(--text); font-weight: 700; } .zero { color: var(--muted); }
.tblwrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); overflow: auto; }
.bars { display: grid; gap: 10px; }
.bars div { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bars i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--vio)); min-width: 3px; }
.banner { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.banner.ok { border-color: rgba(18, 147, 95, .4); background: rgba(18, 147, 95, .08); }
.banner.wait { border-color: rgba(183, 121, 31, .4); background: rgba(183, 121, 31, .08); }
.banner.bad { border-color: rgba(217, 45, 74, .4); background: rgba(217, 45, 74, .08); }

/* ---------- вход ---------- */
.auth { max-width: 440px; margin: 30px auto; }
.oauth { display: grid; gap: 10px; margin-bottom: 18px; }
.oauth .btn { justify-content: flex-start; padding: 13px 16px; }
.oauth .btn i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; color: #fff; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code { font-size: 30px; letter-spacing: 12px; text-align: center; font-family: var(--mono); }
.giftbox { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: linear-gradient(90deg, rgba(239, 79, 43, .14), rgba(90, 75, 255, .14)); border: 1px solid rgba(239, 79, 43, .3); margin-bottom: 18px; font-size: 14px; }
.giftbox .gi { font-size: 26px; }

/* ---------- главная ---------- */
.hero { position: relative; padding: 80px 24px 70px; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(40% 50% at 30% 40%, rgba(239, 79, 43, .25), transparent 70%), radial-gradient(40% 50% at 70% 50%, rgba(90, 75, 255, .22), transparent 70%); pointer-events: none; }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(36px, 6vw, 68px); max-width: 900px; margin: 0 auto 18px; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--acc), var(--acc2), var(--vio)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.hero .row { justify-content: center; }
.facts { display: flex; gap: 28px; justify-content: center; margin-top: 40px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.facts b { color: var(--text); }
.sect { max-width: 1240px; margin: 0 auto; padding: 50px 24px; }
.sect > h2 { font-size: 34px; margin-bottom: 8px; }
.sect > p.lead { color: var(--muted); margin: 0 0 28px; font-size: 16px; }
.demo { margin-bottom: 26px; }
.demo-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.demo-h b { font-size: 20px; }
.demo-h .btn { margin-left: auto; }
.demo-row { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.demo-row::-webkit-scrollbar { display: none; }
.demo-row a { scroll-snap-align: start; text-decoration: none; color: var(--muted); font-size: 13px; }
.demo-row img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 402; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 6px; transition: transform .2s; }
.demo-row a:hover img { transform: translateY(-3px); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.mcard { padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: .15s; }
.mcard:hover { border-color: var(--line2); transform: translateY(-2px); }
.mcard .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; margin-bottom: 14px; }
.mcard b { font-size: 17px; }
.mcard p { color: var(--muted); font-size: 14px; margin: 6px 0 12px; min-height: 42px; }
.mcard .pr { font-size: 13px; font-weight: 700; color: var(--acc2); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps div { padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.steps i { font-style: normal; font-size: 13px; font-weight: 800; color: var(--acc); }
.steps b { display: block; font-size: 18px; margin: 8px 0 6px; }
.steps p { color: var(--muted); margin: 0; font-size: 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 16px; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
.doc { max-width: 820px; }
.doc h2 { font-size: 20px; margin-top: 28px; }
.doc p, .doc li { color: var(--text2); }

footer { border-top: 1px solid var(--line); padding: 26px 24px; color: var(--muted); font-size: 13px; }
footer .in { max-width: 1240px; margin: 0 auto; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--muted); }

/* ---------- уведомления ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 13px; background: var(--card2); border: 1px solid var(--line2); box-shadow: 0 12px 34px rgba(60, 40, 20, .16); font-size: 14px; animation: tin .2s; }
.toast.bad { border-color: rgba(217, 45, 74, .55); }
.toast.ok { border-color: rgba(18, 147, 95, .5); }
.toast a { color: var(--acc2); font-weight: 650; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- телефоны ---------- */
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .mbox { grid-template-columns: 1fr; overflow: auto; }
  .vside { border-left: 0; border-top: 1px solid var(--line); }
  .bal { grid-template-columns: 1fr 1fr; }
  .packs { grid-template-columns: 1fr 1fr; }
  .steps, .grid2, .grid2.wl { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow: auto; }
  .logo { font-size: 16px; gap: 8px; }
  .logo svg { width: 28px; height: 28px; }
  .wrap { padding: 20px 14px 50px; }
  .feed { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters .inp { width: 100%; }
  .tbl .hm { display: none; }
  .bars div { grid-template-columns: 90px 1fr auto; }
}

/* инструкция «как сделать мультфильм» */
.guide { max-width: 1100px; }
.guide h1 { font-size: 38px; margin: 10px 0 10px; }
.guide .lead { color: var(--muted); font-size: 17px; max-width: 760px; margin: 0 0 26px; }
.gflow { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: none; }
.gflow li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 2px; position: relative; }
.gflow i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: #fff; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.gflow span { color: var(--muted); font-size: 13px; }
.gstep { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; padding: 34px 0; border-top: 1px solid var(--line); }
.gstep:has(> .gtext:only-child) { grid-template-columns: minmax(0, 760px); }
.gstep > * { min-width: 0; }
.gnum { color: var(--acc); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.gstep h2 { font-size: 26px; margin: 4px 0 12px; }
.gtext p, .gtext li { color: var(--text2); line-height: 1.6; }
.gtext ol, .gtext ul { padding-left: 20px; margin: 0 0 14px; }
.gtext li { margin-bottom: 4px; }
.gtip { background: rgba(239, 79, 43, .08); border: 1px solid rgba(239, 79, 43, .3); border-radius: 12px; padding: 12px 14px; margin: 14px 0; color: var(--text); line-height: 1.55; }
.gcard2 { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text2); }
.gcard2 span { flex: 1; }
.gshot { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(60, 40, 20, .15); }
.gshot img { display: block; width: 100%; height: auto; }
.gsub { font-size: 18px; margin: 0 0 12px; }
.gscenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.gsc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; align-content: start; }
.gsc-h { font-weight: 800; }
.gsc-p { background: var(--bg2); border-radius: 10px; padding: 10px 12px; }
.gsc-p em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--acc); text-transform: uppercase; letter-spacing: .05em; }
.gsc-p p { margin: 4px 0 8px; font-size: 13.5px; color: var(--text2); line-height: 1.5; }
.gcta { margin: 20px 0 10px; padding: 28px; border-radius: 18px; background: var(--card); border: 1px solid var(--line2); display: grid; justify-items: center; text-align: center; gap: 6px; }
.gcta b { font-size: 22px; }
.gcta span { color: var(--muted); margin-bottom: 10px; }
@media (max-width: 980px) {
  .gstep { grid-template-columns: 1fr; gap: 18px; }
  .gscenes { grid-template-columns: 1fr; }
  .gflow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .guide h1 { font-size: 28px; }
  .gstep { padding: 26px 0; }
  .gcard2 { flex-direction: column; }
}

/* партнёрская программа */
.ref { max-width: 1100px; }
.refhero { padding: 20px 0 10px; }
.refhero h1 { font-size: clamp(28px, 4.4vw, 44px); letter-spacing: -.03em; max-width: 860px; margin: 6px 0 12px; }
.refhero .lead { color: var(--muted); font-size: 17px; max-width: 720px; margin: 0 0 22px; }
.refnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 30px 0 36px; }
.refnums div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.refnums b { display: block; font-size: 30px; letter-spacing: -.02em; color: var(--acc2, var(--acc)); }
.refnums span { color: var(--muted); font-size: 13.5px; }
.refh { font-size: 22px; margin: 30px 0 14px; }
.doc-mini ul { padding-left: 18px; margin: 0; }
.doc-mini li { color: var(--text2); font-size: 14px; line-height: 1.55; margin-bottom: 8px; }
.refcopy { display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.refcopy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.refcopy code.big { font-size: 20px; font-weight: 800; letter-spacing: .06em; color: var(--acc); }
.refbal { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.paybadge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.paybadge.ok { color: var(--ok); border-color: rgba(18, 147, 95, .4); }
.paybadge.wait { color: var(--warn); border-color: rgba(183, 121, 31, .4); }
.paybadge.bad { color: var(--bad); border-color: rgba(217, 45, 74, .4); }
details.promo { margin: 4px 0 14px; }
details.promo summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.promo .row { margin-top: 8px; flex-wrap: nowrap; }
details.promo .inp { text-transform: uppercase; }
@media (max-width: 980px) { .refnums, .refbal { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .refnums b { font-size: 24px; } .refcopy code.big { font-size: 17px; } }

/* согласия при регистрации */
.consents { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.consents .check { margin: 0; font-size: 13.5px; line-height: 1.45; }
.consents.mini { padding: 12px 14px; }
.consents .check.need { animation: needpd .9s ease; }
.consents .check.need span { color: var(--bad); }
@keyframes needpd { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ---------- Аудиокот: аудиокарточки ---------- */
.afeed { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.acard { padding: 14px; gap: 10px; }
.acard:hover { transform: none; }
.ahead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ahead .ic { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; }
.ahead .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ahead .t b { font-size: 14px; }
.ahead .t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard > .p { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acard > .m { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.abody { display: flex; flex-direction: column; gap: 8px; }
.aplay { display: flex; flex-direction: column; gap: 4px; }
.aplay audio { width: 100%; height: 40px; border-radius: 10px; color-scheme: light; }
.await { position: relative; overflow: hidden; padding: 14px; border-radius: 12px; font-size: 13px; color: var(--muted);
  background: radial-gradient(120% 120% at 20% 0, rgba(239, 79, 43, .18), transparent 60%), radial-gradient(100% 100% at 90% 100%, rgba(90, 75, 255, .18), transparent 60%), var(--bg2); }
.await::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); background-size: 250% 100%; animation: sh 1.8s linear infinite; }
.await .bar { width: 100%; }
.afail { padding: 12px 14px; border-radius: 12px; font-size: 13px; color: var(--muted); background: repeating-linear-gradient(135deg, var(--bg2), var(--bg2) 10px, var(--card2) 10px, var(--card2) 20px); }
.afail b { color: var(--bad); }
.aview { display: flex; flex-direction: column; gap: 14px; }
.aview .prompt { max-height: 200px; overflow: auto; white-space: pre-wrap; }
.aview .acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- выбор голоса ---------- */
.vcur, .vrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg2); }
.vrow { border-color: var(--line); cursor: pointer; transition: .15s; }
.vrow:hover { border-color: var(--line2); }
.vrow.on { border-color: rgba(239, 79, 43, .55); background: var(--acc-soft); }
.vcur .t, .vrow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vcur .t b, .vrow .t b { font-size: 14px; }
.vcur .t span, .vrow .t span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vplay { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: var(--card2); color: var(--text); cursor: pointer; font-size: 12px; display: grid; place-items: center; transition: .15s; }
.vplay:hover { border-color: var(--acc); }
.vplay.on { background: var(--acc); border-color: transparent; color: #fff; }
.vfilters { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.vlist { display: flex; flex-direction: column; gap: 8px; max-height: min(58vh, 560px); overflow: auto; padding-right: 4px; }
.mbox.voices { width: min(640px, 100%); }
@media (max-width: 640px) { .afeed { grid-template-columns: 1fr; } .vrow .btn { padding: 8px 10px; } }

/* ---------- светлая тема: типографика и детали ---------- */
body { font-size: 15.5px; }
h1, h2, h3, .logo, .stat b, .pack b, .refnums b { font-family: var(--disp); font-weight: 600; letter-spacing: -.025em; }
h1 { font-weight: 700; }
.hero h1, .refhero h1 { letter-spacing: -.04em; line-height: 1.05; }
.hero h1 em { background: none; color: var(--acc); -webkit-text-fill-color: currentColor; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .14em; border-radius: 4px; background: var(--acc); opacity: .18; }
.hero::before { opacity: .55; }
.hero p { color: var(--text2); }
.logo { font-weight: 700; font-size: 17px; }
.top { border-bottom-color: var(--line); }
.nav a { font-weight: 600; }
.nav a.on { background: var(--ink); color: #fff; }
.card, .panel, .stat, .gcard, .mcard, .pack, .tbl, .mbox, .toast { box-shadow: var(--sh); }
.btn { font-weight: 700; background: var(--card); }
.btn:hover { border-color: var(--ink); }
.btn.pri:hover { background: var(--acc2); }
.inp { background: var(--card); border-color: var(--line2); }
.inp:focus { box-shadow: 0 0 0 4px var(--acc-soft); }
.tabs { background: var(--card2); border-color: var(--line); }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(60, 40, 20, .12); }
.seg button { background: var(--card); color: var(--text2); border-color: var(--line2); }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip { background: var(--card); box-shadow: var(--sh); }
.chip b { color: var(--acc); }
.avatar { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag { background: var(--acc-soft); color: var(--acc2); }
.gid { background: var(--card2); }
.stat.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.main span, .stat.main small { color: rgba(255, 255, 255, .65); }
.pack.on, .pack:hover { border-color: var(--acc); }
.pack em { background: var(--ok); }
.doc p, .doc li { color: var(--text2); }
.go { background: linear-gradient(rgba(255,255,255,0), var(--card) 22%); }
.aplay audio { color-scheme: light; }
.vplay { background: var(--card); }
.vplay.on, .vcur .vplay:hover { background: var(--acc); border-color: var(--acc); color: #fff; }
.vrow.on { border-color: var(--acc); }
.ahead .ic, .mcard .ic, .mpick .ic, .mlist .ic { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.modal { backdrop-filter: blur(4px); }
footer { background: var(--card2); }
::selection { background: rgba(239, 79, 43, .22); }
.hero h1 { font-size: clamp(30px, 5.4vw, 62px); }
.hero h1 em { white-space: normal; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero h1 em::after { display: none; }
.hero h1 em { background: linear-gradient(transparent 72%, rgba(239, 79, 43, .16) 72%, rgba(239, 79, 43, .16) 92%, transparent 92%); }
@media (max-width: 640px) { h1 { word-break: normal; overflow-wrap: anywhere; } .hero { padding: 48px 18px 44px; } }
.panel h3, .stat span { font-family: var(--font); font-weight: 800; letter-spacing: .08em; }
/* логотип и слоган — Onest */
.logo, .hero h1 { font-family: "Onest", var(--font); }
.logo { font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.hero h1 { font-weight: 800; letter-spacing: -.045em; line-height: 1.02; font-size: clamp(34px, 6vw, 72px); }
h1, h2, h3, .stat b, .pack b, .refnums b { font-weight: 800; letter-spacing: -.035em; }
/* без маркерной подложки под акцентом заголовка: она резала буквы снизу */
.hero h1 em { background: none; }

/* кнопка видеоурока на главной */
.vlesson { display: inline-flex; align-items: center; gap: 14px; margin: 26px auto 0; padding: 8px 10px 8px 8px; border: 1px solid var(--line2); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 10px 30px rgba(31, 26, 21, .08); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.vlesson:hover { transform: translateY(-2px); border-color: var(--acc); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 16px 36px rgba(239, 79, 43, .18); }
.vlesson:focus-visible { outline: 3px solid rgba(239, 79, 43, .35); outline-offset: 3px; }
.vl-th { position: relative; width: 56px; height: 56px; flex: none; border-radius: 50%; background: #f5f0e8; }
.vl-th img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.vl-th i { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--acc); border: 2px solid var(--card); z-index: 2; box-shadow: 0 3px 8px rgba(239, 79, 43, .4); }
.vl-th i::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.vl-th::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(239, 79, 43, .45); animation: vlpulse 2.4s ease-out infinite; z-index: 1; pointer-events: none; }
@keyframes vlpulse { 0% { box-shadow: inset 0 0 0 0 rgba(239, 79, 43, .5); } 70%, 100% { box-shadow: inset 0 0 0 6px rgba(239, 79, 43, 0); } }
.vl-tx { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.vl-tx b { font-size: 15px; }
.vl-tx small { font-size: 13px; color: var(--muted); }
.vl-go { margin-left: 6px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; transition: background .2s ease; }
.vlesson:hover .vl-go { background: var(--acc); }
@media (prefers-reduced-motion: reduce) { .vl-th::before { animation: none; } .vlesson:hover { transform: none; } }
@media (max-width: 520px) { .vl-go { display: none; } .vlesson { padding-right: 18px; } }
.mbox.vbox { display: block; width: min(1100px, 100%); background: #000; border-color: #000; padding: 0; }
.mbox.vbox video { display: block; width: 100%; height: auto; max-height: calc(100vh - 48px); aspect-ratio: 16 / 9; background: #000; }
.mbox.vbox .mclose { background: rgba(255,255,255,.9); }
