/* AI Studio — общая дизайн-система */
:root {
  --bg: #0b0a1e;
  --bg-soft: #14122e;
  --panel: rgba(255, 255, 255, .05);
  --panel-strong: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #e8ebf7;
  --muted: #99a3bd;
  --dim: #6b7490;
  --accent: #7c5cff;
  --accent-2: #b45bff;
  --pink: #ec4899;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

.section-head[id] { scroll-margin-top: 90px; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(124, 92, 255, .28), transparent 60%),
    radial-gradient(800px 520px at 92% 0%, rgba(236, 72, 153, .16), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(59, 130, 246, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img, video { max-width: 100%; display: block; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ── Шапка ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: rgba(11, 10, 30, .82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #fff;
  white-space: nowrap;
}
.brand span { background: linear-gradient(135deg, #8b73ff, #d06bff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand:hover { color: #fff; }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav a:hover { background: var(--panel-strong); color: #fff; }
.nav a.active { background: rgba(124, 92, 255, .22); color: #fff; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  white-space: nowrap;
}
.credits-badge:hover { color: #fff; filter: brightness(1.08); }

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 16px;
}
.icon-link:hover { color: #fff; background: var(--panel-strong); }

/* ── Каркас страницы ─────────────────────────────────────────────────── */
.page { padding: 28px 0 72px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.container--narrow { max-width: 860px; }

.page--auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 22px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 34px 0 16px; flex-wrap: wrap; }
.section-title { font-size: 19px; font-weight: 700; }
.section-badge { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }
.section-link { margin-left: auto; font-size: 13px; }

/* ── Панели и карточки ───────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.panel + .panel { margin-top: 18px; }
.panel__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel__hint { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }

.divider { height: 1px; background: var(--border); margin: 34px 0; }

/* ── Сетки ───────────────────────────────────────────────────────────── */
.studio { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.theme-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); color: var(--text); }
.theme-card--video:hover { border-color: var(--pink); }
.theme-card__icon { font-size: 34px; line-height: 1.1; }
.theme-card__name { font-size: 16px; font-weight: 700; }
.theme-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.theme-card__cost {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(124, 92, 255, .22);
  color: #c7b8ff;
}
.theme-card--video .theme-card__cost { background: rgba(236, 72, 153, .2); color: #f9a8d4; }

/* ── Формы ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%;
  padding: 10px 13px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, background .18s;
}
.input:focus { border-color: var(--accent); background: rgba(124, 92, 255, .1); }
.input:disabled { opacity: .55; cursor: not-allowed; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2399a3bd' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
select.input option { background: #1d1a3d; color: var(--text); padding: 8px; }
select.input optgroup { background: #1d1a3d; color: #cfc4ff; font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Кнопки ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--panel-strong);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, opacity .18s;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn--primary:hover { box-shadow: 0 12px 28px rgba(124, 92, 255, .38); }
.btn--ghost { background: rgba(124, 92, 255, .14); border-color: rgba(124, 92, 255, .35); color: #cfc4ff; }
.btn--success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn--danger { background: rgba(239, 68, 68, .16); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.btn--danger:hover { background: rgba(239, 68, 68, .26); }
.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 22px; font-size: 15px; }

/* ── Стоимость, алерты, прогресс ─────────────────────────────────────── */
.cost-info {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(124, 92, 255, .1);
  border: 1px solid rgba(124, 92, 255, .22);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.cost-info b { color: #cfc4ff; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-top: 12px; border: 1px solid transparent; }
.alert--error { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
.alert--success { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.alert--info { background: rgba(124, 92, 255, .12); border-color: rgba(124, 92, 255, .28); color: #cfc4ff; }
.alert--warn { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
.flash-stack { margin-bottom: 18px; }
.flash-stack .alert { margin-top: 8px; }

.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 14px 0 8px; }
.progress__bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width .4s ease; }

.spinner {
  width: 46px; height: 46px; margin: 0 auto 16px;
  border: 4px solid rgba(124, 92, 255, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Студия: промты и результат ──────────────────────────────────────── */
.prompt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.prompt-item {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.prompt-item:hover { border-color: rgba(124, 92, 255, .5); background: rgba(124, 92, 255, .1); }
.prompt-item.active { border-color: var(--accent); background: rgba(124, 92, 255, .2); }
.prompt-item__name { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.prompt-item__preview {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upload-zone {
  padding: 18px;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: rgba(124, 92, 255, .1); }
.upload-zone__icon { font-size: 26px; margin-bottom: 6px; }
.upload-zone__text { font-size: 12.5px; color: var(--muted); }
.upload-zone__hint { font-size: 11px; color: var(--dim); margin-top: 4px; }
.upload-preview { margin-top: 12px; }
.upload-preview img, .upload-preview video { width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--radius-sm); }

.refs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
.ref-card { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.ref-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.ref-card__num {
  position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 6px;
  background: rgba(11, 10, 30, .82); color: #fff; font-size: 11px; font-weight: 700;
}
.ref-card__actions { display: flex; gap: 4px; padding: 6px; }
.ref-card__actions .btn { flex: 1; padding: 4px 6px; font-size: 10.5px; border-radius: 7px; white-space: nowrap; }

.result-panel { min-height: 520px; display: flex; flex-direction: column; }
.result-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.result-placeholder { color: var(--dim); }
.result-placeholder__icon { font-size: 56px; margin-bottom: 10px; }
.result-media { width: 100%; border-radius: 14px; box-shadow: var(--shadow); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

/* ── Бейджи, медиа-сетки ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge--image { background: rgba(124, 92, 255, .2); color: #c7b8ff; }
.badge--video { background: rgba(236, 72, 153, .2); color: #f9a8d4; }
.badge--done { background: rgba(34, 197, 94, .18); color: #86efac; }
.badge--work { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.badge--failed { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.badge--public { background: rgba(59, 130, 246, .18); color: #93c5fd; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cards--wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.card__media { position: relative; aspect-ratio: 1 / 1; background: #0d0b22; overflow: hidden; }
.card__media img, .card__media video { width: 100%; height: 100%; object-fit: cover; }
.card__media--video { background: #05040f; }
.card__media--pending { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 30px; }
.card__badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.card__body { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.card__prompt {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}
.card__meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--dim); }
.card__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card__actions .btn { padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }

/* ── Табы и пагинация ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
}
.tab:hover { color: #fff; border-color: var(--border-strong); }
.tab.active { color: #fff; background: rgba(124, 92, 255, .22); border-color: rgba(124, 92, 255, .45); }

.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 26px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px;
  padding: 7px 11px;
  text-align: center;
  border-radius: 9px;
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pagination a:hover { color: #fff; border-color: var(--accent); }
.pagination .current { background: rgba(124, 92, 255, .25); border-color: rgba(124, 92, 255, .45); color: #fff; }

/* ── Статистика и таблицы ────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat__value { font-size: 24px; font-weight: 700; }
.stat__label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 9px 10px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.table tr:last-child td { border-bottom: none; }

/* ── Пакеты кредитов ─────────────────────────────────────────────────── */
.balance-card {
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, .85), rgba(180, 91, 255, .8));
  border: 1px solid rgba(255, 255, 255, .16);
}
.balance-card__label { font-size: 13px; opacity: .85; }
.balance-card__value { font-size: 42px; font-weight: 800; line-height: 1.15; }
.balance-card__hint { font-size: 12.5px; opacity: .85; margin-top: 4px; }

.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.package {
  padding: 15px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  background: var(--panel-strong);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  user-select: none;
}
.package:hover { border-color: rgba(124, 92, 255, .6); }
.package.selected { border-color: var(--accent); background: rgba(124, 92, 255, .2); }
.package__credits { font-size: 16px; font-weight: 700; }
.package__price { font-size: 13px; color: #c7b8ff; margin-top: 2px; }
.package__name { font-size: 11px; color: var(--muted); margin-top: 3px; }
.package__bonus { font-size: 10.5px; color: #86efac; margin-top: 3px; }
.package__rate { font-size: 10px; color: var(--dim); margin-top: 2px; }
.custom-amount { display: flex; gap: 10px; align-items: center; }
.custom-amount .input { flex: 1; }

/* ── Авторизация ─────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border-radius: 20px;
  background: rgba(20, 18, 46, .72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.auth-card--wide { max-width: 440px; }
.auth-title { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-links { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.auth-links a { font-weight: 600; }
.auth-features { display: flex; flex-direction: column; gap: 9px; margin-top: 22px; }
.auth-feature { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.auth-feature__icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(124, 92, 255, .18); font-size: 15px; }
.bonus { margin-top: 16px; padding: 11px; border-radius: var(--radius-sm); font-size: 12.5px; text-align: center; color: #cfc4ff; background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .25); }

/* ── Главная: два режима ─────────────────────────────────────────────── */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(124, 92, 255, .18), rgba(255, 255, 255, .04));
  color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 20px 44px rgba(0, 0, 0, .35); color: var(--text); }
.mode-card--video { background: linear-gradient(160deg, rgba(236, 72, 153, .18), rgba(255, 255, 255, .04)); }
.mode-card--video:hover { border-color: var(--pink); }
.mode-card--enhance { background: linear-gradient(160deg, rgba(251, 191, 36, .16), rgba(255, 255, 255, .04)); }
.mode-card--enhance:hover { border-color: #fbbf24; }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: 6px; }
.range-field label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.range-value { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Crop & Expand ────────────────────────────────────────────────────── */
.expand-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0d0b20;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}
.expand-stage__image {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 66%;
  max-height: 66%;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}
.expand-frame {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(6, 5, 16, .55);
  cursor: move;
  touch-action: none;
}
.expand-frame__handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: nwse-resize;
}
.expand-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--dim);
  font-size: 13px;
  text-align: center;
}
.expand-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.expand-aspects { display: flex; flex-wrap: wrap; gap: 6px; }
.expand-aspects .btn.active { border-color: var(--accent); color: var(--text); background: rgba(124, 92, 255, .18); }
.mode-card__badge {
  position: absolute; top: 16px; right: 16px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: var(--muted); font-size: 11px;
}
.mode-card__icon { font-size: 40px; line-height: 1.1; }
.mode-card__title { font-size: 20px; font-weight: 700; }
.mode-card__desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.mode-card__cta { margin-top: 12px; font-size: 13px; font-weight: 600; color: #cfc4ff; }
.mode-card--video .mode-card__cta { color: #f9a8d4; }
@media (max-width: 520px) {
  .mode-card { padding: 20px; }
  .mode-card__title { font-size: 18px; }
  .mode-card__icon { font-size: 34px; }
}

/* ── Студия: промт сверху на всю ширину ─────────────────────────────── */
.prompt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
.prompt-hero .field { margin: 0; }
.prompt-hero__input { min-height: 118px; font-size: 15px; }
@media (max-width: 900px) {
  .prompt-hero { grid-template-columns: 1fr; gap: 12px; }
  .prompt-hero__input { min-height: 96px; }
}

/* ── Полноэкранный просмотр ──────────────────────────────────────────── */
.js-media { cursor: zoom-in; }
.js-media img { transition: transform .2s ease; }
.js-media:hover img { transform: scale(1.02); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 5, 16, .94);
  backdrop-filter: blur(6px);
}
.lightbox.hidden { display: none; }
.lightbox__stage { display: flex; align-items: center; justify-content: center; max-width: 94vw; max-height: 86vh; }
.lightbox__stage img,
.lightbox__stage video {
  max-width: 94vw;
  max-height: 84vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(20, 18, 46, .85);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(124, 92, 255, .4); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(20, 18, 46, .85);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav:hover { background: rgba(124, 92, 255, .4); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox--has-prompt .lightbox__stage { max-height: 70vh; }
.lightbox--has-prompt .lightbox__stage img,
.lightbox--has-prompt .lightbox__stage video { max-height: 68vh; }
.lightbox__prompt {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 40px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(16, 14, 38, .92);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.lightbox__prompt.hidden { display: none; }
.lightbox__prompt-text {
  flex: 1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  max-height: 54px;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.lightbox__prompt .btn { flex-shrink: 0; }
.lightbox__footer {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 600px) {
  .lightbox { padding: 10px; }
  .lightbox__nav { width: 38px; height: 38px; font-size: 20px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__prompt { bottom: 56px; flex-direction: column; align-items: stretch; gap: 8px; }
  .lightbox__prompt .btn { width: 100%; }
  .lightbox--has-prompt .lightbox__stage img,
  .lightbox--has-prompt .lightbox__stage video { max-height: 58vh; }
}

/* ── Выпадающий список готовых промтов ──────────────────────────────── */
.preset { position: relative; }
.preset__toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.preset__current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset__arrow { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.preset__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: #16142f;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.preset__panel::-webkit-scrollbar { width: 8px; }
.preset__panel::-webkit-scrollbar-track { background: transparent; }
.preset__panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }
.preset__panel::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
.preset__group + .preset__group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.preset__group-title {
  padding: 8px 10px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .2px;
}
.preset__option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.preset__option:hover { background: rgba(124, 92, 255, .18); }
.preset__option:focus-visible { background: rgba(124, 92, 255, .18); outline: 2px solid var(--accent); outline-offset: -2px; }
.preset__option[aria-selected="true"] { background: rgba(124, 92, 255, .26); }
@media (max-width: 600px) {
  .preset__panel { max-height: 45vh; }
}

/* ── Отзывы и админка ────────────────────────────────────────────────── */
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rating-input label {
  font-size: 32px;
  line-height: 1;
  color: rgba(255, 255, 255, .22);
  cursor: pointer;
  transition: color .15s;
}
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label { color: #fbbf24; }
.rating-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.reviews, .admin-reviews { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.review__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.review__author { font-weight: 700; }
.review__date { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.review__text { margin-top: 10px; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.stars { color: #fbbf24; letter-spacing: 2px; font-size: 16px; white-space: nowrap; }
.review__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.review__reply {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(124, 92, 255, .12);
  border: 1px solid rgba(124, 92, 255, .28);
}
.review__reply-head { font-size: 12px; font-weight: 600; color: #cfc4ff; margin-bottom: 6px; }
.review__reply p { font-size: 13.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.review__admin { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.review__admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.review--hidden { opacity: .62; border-style: dashed; }
@media (max-width: 600px) {
  .rating-input label { font-size: 28px; }
  .review__admin-actions .btn { flex: 1 1 auto; }
}

/* ── Пустое состояние, тосты, подвал ─────────────────────────────────── */
.empty { text-align: center; padding: 50px 20px; color: var(--dim); }
.empty__icon { font-size: 44px; margin-bottom: 12px; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #fff;
  background: rgba(30, 27, 61, .96);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
  max-width: 320px;
}
.toast--ok { border-color: rgba(34, 197, 94, .45); }
.toast--err { border-color: rgba(239, 68, 68, .45); }
.toast--out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.footer { border-top: 1px solid var(--border); padding: 18px 0; margin-top: 30px; }
.footer__inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); }
.footer__links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--text); }

/* ── Юридические страницы, согласие, жалобы ───────────────────────────── */
.legal__body { font-size: 14px; line-height: 1.65; color: var(--text); }
.legal__body h2 { margin: 22px 0 8px; font-size: 17px; }
.legal__body ul { margin: 8px 0 12px 20px; }
.legal__body li { margin-bottom: 6px; }
.legal__body p { margin: 8px 0; }
.legal__body a { color: #b9a8ff; }
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.consent input { margin-top: 3px; accent-color: var(--accent); }
.consent a { color: #b9a8ff; }
.panel--danger { border-color: rgba(239, 68, 68, .35); }
.review__report { margin-top: 10px; font-size: 12.5px; }
.review__report a { color: var(--muted); }
.review__report a:hover { color: #fca5a5; }
.report-quote {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(124, 92, 255, .08);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.report-reasons { display: flex; flex-direction: column; gap: 8px; }
.report-reason { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.report-reason input { accent-color: var(--accent); }

/* ── Адаптивность ────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .result-panel { min-height: 380px; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .topbar__right { gap: 6px; }
  .credits-badge { padding: 6px 11px; font-size: 13px; }
  .container { padding: 0 14px; }
  .page { padding: 20px 0 56px; }
  .page-title { font-size: 23px; }
  .panel { padding: 18px; }
  .theme-card { padding: 16px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card__actions .btn { padding: 4px 7px; font-size: 11px; }
  .row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .toast-wrap { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
}

@media (max-width: 420px) {
  .brand { font-size: 17px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .package { padding: 12px; }
}
