:root {
  --bg: #0a0b0f; --bg2: #101218; --panel: #14161d; --panel2: #1b1e27; --line: #242833;
  --text: #eef0f5; --muted: #8c93a4; --dim: #5d6474;
  --accent: #c6ff3d; --accent-ink: #10140a; --accent2: #7b8cff; --hot: #ff5c8a;
  --err: #ff6b6b; --ok: #4ade80; --r: 16px;
  --g-camera: linear-gradient(135deg, #2b1055 0%, #7597de 100%);
  --g-effects: linear-gradient(135deg, #41062b 0%, #ff5c8a 100%);
  --g-motion: linear-gradient(135deg, #3a1c00 0%, #ff9f1c 100%);
  --g-family: linear-gradient(135deg, #2d1e12 0%, #c8a27a 100%);
  --g-styles: linear-gradient(135deg, #1b0f3a 0%, #e05fd0 100%);
  --g-season: linear-gradient(135deg, #3a1400 0%, #ff7a1a 100%);
  --g-photo: linear-gradient(135deg, #0f2027 0%, #2c7a7b 100%);
  --g-product: linear-gradient(135deg, #1d1d1d 0%, #8a7a5a 100%);
  --g-product_video: linear-gradient(135deg, #0b3d2e 0%, #c6ff3d 140%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
img, video { max-width: 100%; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 80px; }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 36px 0 14px; letter-spacing: -.01em; }
h3 { margin: 4px 0; font-size: 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .dim { color: var(--dim); }

/* ── шапка ── */
.top { display: flex; align-items: center; gap: 24px; padding: 12px 20px; border-bottom: 1px solid var(--line);
       position: sticky; top: 0; background: rgba(10,11,15,.85); backdrop-filter: blur(12px); z-index: 20; }
.logo { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: .06em; }
.logo span { color: var(--accent); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: var(--muted); padding: 6px 12px; border-radius: 99px; font-weight: 500; }
.top nav a:hover, .top nav a.on { color: var(--text); background: var(--panel2); }
.top .right { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line);
        padding: 5px 12px; border-radius: 99px; color: var(--text); font-weight: 600; }
.pill b { color: var(--accent); }
.lang { color: var(--muted); font-size: 13px; font-weight: 600; }
.lang a { color: var(--dim); } .lang a.on { color: var(--text); }

.banner { background: #221e0c; color: #f5d565; text-align: center; padding: 7px 16px; font-size: 13px; }
.flash { max-width: 1280px; margin: 12px auto 0; padding: 10px 16px; background: #3a1a1a; border-radius: 10px; }
.flash.ok { background: #13301d; }

/* ── кнопки/поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent);
       color: var(--accent-ink) !important; border: 0; border-radius: 12px; padding: 10px 18px;
       font: 700 15px Inter, sans-serif; cursor: pointer; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.big { padding: 15px 26px; font-size: 16px; } .btn.wide { width: 100%; }
.btn.ghost { background: var(--panel2); color: var(--text) !important; border: 1px solid var(--line); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
label { display: block; margin: 14px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font: 15px Inter, sans-serif; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); }
textarea { resize: vertical; }
input[type=range] { accent-color: var(--accent); background: none; border: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.err { color: var(--err); min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }

/* ── лендинг ── */
.hero { text-align: center; padding: 64px 0 28px; }
.hero h1 { font-size: clamp(34px, 6vw, 68px); line-height: 1.02; letter-spacing: -.04em; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), #6ef3c5 50%, var(--accent2));
                -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 640px; margin: 18px auto 30px; font-size: 17px; }
.models-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; }
.models-strip span { border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.aud { padding: 28px; border-radius: 20px; min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end;
       color: #fff; position: relative; overflow: hidden; }
.aud h3 { font-size: 24px; } .aud p { margin: 6px 0 14px; opacity: .85; }
.aud.creators { background: var(--g-camera); } .aud.sellers { background: var(--g-product); }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.why .card h3 { margin-bottom: 6px; }

/* ── витрина шаблонов ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.chips a { padding: 7px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.chips a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.shelf h2 { display: flex; align-items: baseline; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { position: relative; display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 4/5; color: #fff;
        border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-3px); border-color: #3a4050; }
.tile .bg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; padding-bottom: 30%; }
.tile .bg:has(video), .tile .bg:has(img) { padding: 0; }
.tile .bg video, .tile .bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .bg:has(video), .tile .bg:has(img) { background: #000; }
/* «было»: маленький исходник в углу — видно, из чего сделан результат */
.tile .before { position: absolute; right: 10px; top: 44px; width: 54px; height: 54px; object-fit: cover;
                border-radius: 10px; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.example { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.example .res { flex: 1; border-radius: 14px; overflow: hidden; background: #000; max-height: 460px; display: flex; justify-content: center; }
.example .res video, .example .res img { max-height: 460px; width: auto; max-width: 100%; display: block; }
.example .src { width: 110px; text-align: center; color: var(--muted); font-size: 12px; }
.example .src img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 6px; }
.tile .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 14px;
              background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.tile .meta b { display: block; font-size: 16px; } .tile .meta span { font-size: 13px; opacity: .8; }
.tile .cost { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
              padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.tile .kind { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); padding: 3px 9px;
              border-radius: 99px; font-size: 12px; font-weight: 600; }
.g-camera { background: var(--g-camera); } .g-motion { background: var(--g-motion); }
.g-family { background: var(--g-family); } .g-styles { background: var(--g-styles); } .g-season { background: var(--g-season); } .g-effects { background: var(--g-effects); } .g-photo { background: var(--g-photo); }
.g-product { background: var(--g-product); } .g-product_video { background: var(--g-product_video); }

/* ── страница пресета / создание ── */
.workbench { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }
.panel { position: sticky; top: 76px; }
.phead { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.phead .ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; flex: none; }
.drop { margin-top: 6px; border: 1.5px dashed #343a48; border-radius: 14px; min-height: 170px; display: grid; place-items: center;
        text-align: center; color: var(--muted); cursor: pointer; padding: 14px; position: relative; overflow: hidden; background: var(--bg2); }
.drop.over { border-color: var(--accent); color: var(--text); }
.drop img { max-height: 260px; border-radius: 10px; }
.drop input { display: none; }
.drop .x { position: absolute; top: 8px; right: 8px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-top: 6px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 9px;
              font: 600 14px Inter, sans-serif; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--text); }
.model-pick { display: grid; gap: 8px; margin-top: 6px; }
.model-pick label { margin: 0; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
                    border-radius: 12px; cursor: pointer; background: var(--bg2); color: var(--text); }
.model-pick input { width: auto; margin: 0; accent-color: var(--accent); }
.model-pick .n { flex: 1; } .model-pick .n small { display: block; color: var(--muted); font-weight: 400; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #2a3a10; color: var(--accent); text-transform: uppercase; }
.badge.b-fast, .badge.b-cheap { background: #10283a; color: #6ec8ff; } .badge.b-audio { background: #3a1030; color: var(--hot); }
.go .c { opacity: .7; font-weight: 600; }

/* ── галерея ── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.item { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.item .m { aspect-ratio: 1; background: #000; display: block; }
.item img.m, .item video.m { width: 100%; object-fit: cover; }
.item figcaption { padding: 10px 12px; font-size: 13px; }
.item .acts { display: flex; gap: 10px; margin-top: 6px; }
.item .acts a, .item .acts button { font-size: 13px; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-family: inherit; }
.item .acts .del { color: var(--dim); margin-left: auto; }
.item .p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.ph { aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted);
      text-align: center; padding: 16px; background: radial-gradient(circle at 50% 40%, #1c2030, #0d0f14); }
.ph.fail { color: var(--err); background: #150c0e; }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
        animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* ── кредиты/админка ── */
.tx { width: 100%; border-collapse: collapse; font-size: 14px; }
.tx td, .tx th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tx th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tx .r { text-align: right; } .plus { color: var(--ok); } .minus { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stats .card b { display: block; font-size: 26px; } .stats .card span { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }
.inline { display: flex; gap: 6px; } .inline input { width: 90px; margin: 0; padding: 6px 8px; border-radius: 8px; }
.st-done { color: var(--ok); } .st-failed { color: var(--err); } .st-running, .st-queued { color: #f5d565; }
.auth { max-width: 400px; margin: 48px auto; } .auth .btn { margin-top: 20px; }
footer { border-top: 1px solid var(--line); padding: 24px 20px; color: var(--dim); font-size: 13px; text-align: center; }

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; } .panel { position: static; }
  .two, .why { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .top .right { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .bg { font-size: 40px; padding-bottom: 45%; }
  .tile .kind { display: none; }
  .tile .before { width: 44px; height: 44px; top: 42px; }
  .tile .meta span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
