/* Aiartgen — базовая дизайн-система */
:root {
  --bg: #0a0912;
  --bg-soft: #0f0d1a;
  --header-bg: #030207;
  --footer-bg: #020106;
  --chrome-border: rgba(255, 255, 255, 0.13);
  --surface: #14121f;
  --surface-2: #1a1827;
  --surface-3: #211e31;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f2ff;
  --muted: #a9a4bf;
  --dim: #77718f;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-ink: #ffffff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --header-h: 68px;
  --font: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f5fb;
  --bg-soft: #f1eef8;
  --header-bg: #e4deee;
  --footer-bg: #dfd8e9;
  --chrome-border: rgba(16, 12, 40, 0.16);
  --surface: #ffffff;
  --surface-2: #f6f3fc;
  --surface-3: #ece7f7;
  --line: rgba(16, 12, 40, 0.09);
  --line-strong: rgba(16, 12, 40, 0.16);
  --text: #171324;
  --muted: #5f5a75;
  --dim: #8a849e;
  --accent-soft: rgba(139, 92, 246, 0.1);
  --shadow: 0 20px 50px rgba(31, 22, 74, 0.12);
  color-scheme: light;
}

[data-accent="blue"] { --accent: #3b82f6; --accent-2: #22d3ee; --accent-soft: rgba(59, 130, 246, 0.14); }
[data-accent="emerald"] { --accent: #10b981; --accent-2: #84cc16; --accent-soft: rgba(16, 185, 129, 0.14); }
[data-accent="amber"] { --accent: #f59e0b; --accent-2: #fb7185; --accent-soft: rgba(245, 158, 11, 0.14); }
[data-accent="rose"] { --accent: #f43f5e; --accent-2: #a855f7; --accent-soft: rgba(244, 63, 94, 0.14); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--muted); }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; color: var(--muted); }
li { margin-bottom: 0.4em; }
strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; }
.container { width: min(1440px, calc(100% - 64px)); margin-inline: auto; }
.container.narrow { width: min(820px, calc(100% - 40px)); }
@media (min-width: 1800px) {
  .container { width: min(1680px, calc(100% - 96px)); }
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Кнопки и бейджи ---------- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--btn-bg); color: var(--text);
  font-weight: 600; font-size: 14.5px; line-height: 1; text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #111 40%));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-primary:hover { box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.btn-danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); color: #fecdd3; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-group { display: flex; flex-wrap: wrap; gap: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
}
.badge-accent { background: var(--accent-soft); border-color: transparent; color: color-mix(in srgb, var(--accent) 70%, white 30%); }
.badge-success { background: rgba(52, 211, 153, 0.12); border-color: transparent; color: #6ee7b7; }
.badge-warning { background: rgba(251, 191, 36, 0.12); border-color: transparent; color: #fcd34d; }
.badge-danger { background: rgba(251, 113, 133, 0.12); border-color: transparent; color: #fda4af; }
.badge-neutral { background: var(--surface-2); }
.badge-sm { font-size: 10px; padding: 2px 7px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--muted); }

/* ---------- Формы ---------- */
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 11px 13px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.form-error { color: #fda4af; font-size: 12.5px; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: rgba(251, 113, 133, 0.6); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; }
.radio-card span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all 0.15s ease;
}
.radio-card input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.radio-card input:focus-visible + span { outline: 2px solid var(--accent-2); }

/* ---------- Секции ---------- */
.section { padding: 76px 0; }
.section-sm { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  color: color-mix(in srgb, var(--accent) 70%, white 30%);
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--accent); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card-soft { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-hover { transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--surface-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.stack { display: grid; gap: 12px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------- Шапка и подвал ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, color-mix(in srgb, var(--header-bg) 92%, white 8%), var(--header-bg));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--chrome-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}
[data-theme="light"] .site-header { box-shadow: 0 8px 24px rgba(31, 22, 74, 0.08); }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.03em; font-size: 19px; }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.logo-mark .icon { width: 19px; height: 19px; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.balance-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700;
}
.balance-chip .icon { width: 15px; height: 15px; color: var(--accent-2); }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 14px;
}
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.user-menu-panel a, .user-menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  background: none; border: 0; border-radius: 9px; text-align: left; font-size: 13.5px; color: var(--muted);
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-2); color: var(--text); }
.user-menu-panel .icon { width: 16px; height: 16px; }
.nav-toggle { display: none; }
.mobile-nav { display: none; padding: 12px 0 18px; border-top: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 11px 4px; font-weight: 600; color: var(--muted); }
.mobile-nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--chrome-border); padding: 54px 0 34px; background: linear-gradient(180deg, var(--header-bg), var(--footer-bg)); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 34px; }
.footer-grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 14px; }
.footer-grid a { display: block; padding: 4px 0; color: var(--muted); font-size: 14px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.footer-brand p { max-width: 320px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 70px 0 50px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; pointer-events: none;
}
.hero::before { width: 520px; height: 520px; background: var(--accent); top: -220px; right: -80px; }
.hero::after { width: 420px; height: 420px; background: var(--accent-2); bottom: -260px; left: -100px; opacity: 0.18; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 52px; align-items: center; }
.hero-grid > *, .hero-mosaic, .hero-mosaic figure, .tool-hero-grid > *, .catalog-grid > *, .grid > *, .split > * { min-width: 0; }
.hero-mosaic img, .tool-gallery img { width: 100%; height: auto; }
body { overflow-x: hidden; }
.hero h1 { margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent-2), var(--accent), #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 17px; max-width: 540px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; color: var(--dim); font-size: 13px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .icon { width: 16px; height: 16px; color: var(--success); }
.hero-visual { position: relative; min-height: 460px; }
.hero-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; transform: rotate(-2deg); }
.hero-mosaic figure { margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: var(--surface); }
.hero-mosaic figure:nth-child(2) { transform: translateY(28px); }
.hero-mosaic figure:nth-child(3) { transform: translateY(-18px); }
.hero-mosaic img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; }
.hero-mosaic figure:nth-child(2) img { aspect-ratio: 4 / 5.4; }
.hero-float {
  position: absolute; left: 12px; bottom: 6px; z-index: 2;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.hero-float .icon { color: var(--accent-2); }
.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Карточки инструментов ---------- */
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); min-height: 176px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface-2); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tool-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, white 25%);
}
.tool-icon .icon { width: 21px; height: 21px; }
.tool-card h3 { font-size: 15.5px; margin: 0; line-height: 1.3; }
.tool-card p { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--dim); }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.price .icon { width: 13px; height: 13px; color: var(--accent-2); }
.kind-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--accent); }
.kind-dot.video { background: #f472b6; }
.kind-dot.audio { background: var(--accent-2); }
.status-soon { opacity: 0.72; }

/* ---------- Каталог ---------- */
.page-head { padding: 46px 0 26px; }
.breadcrumbs { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--dim); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--text); }
.catalog-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; align-items: start; padding-bottom: 70px; }
.mobile-filters { display: none; }
.filters { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 22px; }
.filter-group { display: grid; gap: 6px; }
.filter-group h4 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin: 0 0 4px; }
.filter-link { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; color: var(--muted); font-size: 13.5px; }
.filter-link:hover { background: var(--surface-2); color: var(--text); }
.filter-link.active { background: var(--accent-soft); color: var(--text); }
.filter-link span { color: var(--dim); font-size: 12px; }
.search-bar { display: flex; gap: 10px; }
.search-bar .input { flex: 1; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); background: var(--surface);
}
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty .icon { width: 40px; height: 40px; color: var(--dim); margin: 0 auto 14px; }

/* ---------- Страница инструмента ---------- */
.tool-hero { padding: 42px 0 30px; }
.tool-hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 46px; align-items: start; }
.tool-hero h1 { font-size: clamp(1.8rem, 3.4vw, 3rem); margin-bottom: 12px; }
.tool-hero-lead { font-size: 16px; max-width: 560px; }
.tool-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tool-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.tool-gallery img:first-child { grid-column: span 2; aspect-ratio: 16 / 10; }
.tool-price-box { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid transparent; }
.tool-price-box strong { font-size: 22px; }
.specs { display: grid; gap: 0; }
.spec-row { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-row:last-child { border-bottom: 0; }
.spec-row span:first-child { color: var(--muted); }
.spec-row span:last-child { text-align: right; font-weight: 600; }

/* ---------- Публичные блоки ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.feature .tool-icon { margin-bottom: 14px; }
.feature h3 { font-size: 16px; }
.feature p { font-size: 13.5px; margin: 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; margin-bottom: 12px;
}
.step h3 { font-size: 15px; }
.step p { font-size: 13px; margin: 0; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.faq-item summary { padding: 16px 18px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { width: 18px; height: 18px; color: var(--dim); transition: transform 0.2s ease; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 18px 16px; color: var(--muted); font-size: 14px; }
.prose { color: var(--muted); font-size: 15.5px; line-height: 1.75; }
.prose h2 { color: var(--text); font-size: 1.4rem; margin-top: 1.6em; }
.prose h3 { color: var(--text); font-size: 1.1rem; margin-top: 1.4em; }
.prose a { color: var(--accent-2); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font-size: 0.9em; }
.article-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.article-card h3 { font-size: 18px; }
.article-card p { font-size: 14px; margin: 0; }
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.price-card.highlight { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.price-card .amount { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.price-card li { display: flex; gap: 8px; align-items: flex-start; }
.price-card li .icon { width: 16px; height: 16px; color: var(--success); margin-top: 2px; }
.cta-band {
  position: relative; overflow: hidden; padding: 46px; border-radius: 26px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 26%, var(--surface)), var(--surface) 60%);
  border: 1px solid var(--line-strong);
}
.cta-band h2 { max-width: 620px; }
.cta-band p { max-width: 560px; }

/* ---------- Вход ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; background: var(--bg-soft); border-right: 1px solid var(--line); }
.auth-side::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: var(--accent); filter: blur(110px); opacity: 0.25; top: -120px; right: -100px; }
.auth-side-art { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.auth-side-art img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: 30px; margin-bottom: 8px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-card .card { padding: 26px; }
.otp-input { letter-spacing: 14px; text-align: center; font-size: 24px; font-weight: 700; height: 58px; }
.auth-note { font-size: 12.5px; color: var(--dim); margin-top: 16px; text-align: center; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; margin-bottom: 18px; }
.auth-back:hover { color: var(--text); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--dim); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-yandex-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fc3f1d; color: #fff; font-size: 12px; font-weight: 800; margin-right: 8px; }
.timer { font-variant-numeric: tabular-nums; }

/* ---------- Toast и модалки ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px;
  border-radius: 13px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  box-shadow: var(--shadow); font-size: 13.5px; animation: toast-in 0.25s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent-2); }
.toast .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast button { margin-left: auto; background: none; border: 0; color: var(--dim); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog {
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text);
  padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(4, 3, 12, 0.7); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h3 { margin: 0; }
.dialog-body { padding: 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }

/* ---------- Личный кабинет ---------- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.mobile-app-nav { display: none; }
.mobile-app-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; color: var(--dim); font-size: 10.5px; font-weight: 600;
}
.mobile-app-nav a.active { color: var(--accent); }
.mobile-app-nav .icon { width: 20px; height: 20px; }
.app-sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--bg-soft); border-right: 1px solid var(--line); overflow-y: auto;
}
.app-sidebar .logo { padding: 6px 8px 10px; }
.side-nav { display: grid; gap: 3px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.side-link .icon { width: 18px; height: 18px; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--accent-soft); color: var(--text); }
.side-link.active .icon { color: var(--accent); }
.side-label { padding: 14px 11px 6px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.balance-card { padding: 14px; border-radius: 14px; background: linear-gradient(145deg, var(--accent-soft), var(--surface-2)); border: 1px solid var(--line); }
.balance-card .amount { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.balance-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 26px; border-bottom: 1px solid var(--chrome-border);
  background: var(--header-bg); backdrop-filter: blur(14px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}
.app-topbar .search { flex: 1; max-width: 420px; }
.app-content { padding: 28px; width: 100%; max-width: 1520px; margin: 0 auto; }
.page-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title-row h1 { font-size: 26px; margin: 0 0 4px; }
.page-title-row p { margin: 0; font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.stat .icon { color: var(--accent); width: 18px; height: 18px; float: right; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.app-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.app-panel h2, .app-panel h3 { font-size: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.mini-job { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-job:last-child { border-bottom: 0; }
.mini-job .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--dim); }
.mini-job .meta { min-width: 0; flex: 1; }
.mini-job .meta strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-job .meta span { font-size: 11.5px; color: var(--dim); }

/* ---------- Студия: форма инструмента ---------- */
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.studio-form { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px; }
.studio-form h2 { font-size: 18px; }
.studio-side { position: sticky; top: 84px; display: grid; gap: 14px; }
.upload-zone {
  position: relative; display: grid; place-items: center; gap: 6px; min-height: 168px; padding: 18px;
  border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2);
  text-align: center; transition: border-color 0.15s ease, background 0.15s ease; cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone .icon { width: 28px; height: 28px; color: var(--accent); }
.upload-zone strong { font-size: 13.5px; }
.upload-zone span { font-size: 12px; color: var(--dim); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.upload-preview img { width: 100%; max-height: 240px; object-fit: cover; }
.upload-preview .remove { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; }
.upload-file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.upload-file .icon { width: 22px; height: 22px; color: var(--accent); }
.form-section-title { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--dim); }
.price-summary { display: grid; gap: 6px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.price-summary .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.price-summary .row.total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 16px; color: var(--text); font-weight: 700; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s ease; }
.job-status { display: flex; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.result-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.result-card img, .result-card video { width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.result-card .body { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-card audio { width: 100%; padding: 10px; }
.job-log { display: grid; gap: 8px; font-size: 12.5px; }
.job-log .row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 6px; }

/* ---------- История и файлы ---------- */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.history-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.history-card .preview { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; color: var(--dim); overflow: hidden; }
.history-card .preview img { width: 100%; height: 100%; object-fit: cover; }
.history-card .body { padding: 12px 14px; }
.history-card h3 { font-size: 13.5px; margin: 0 0 4px; }
.history-card .line { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--dim); }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.history-row .thumb { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.history-row .info { flex: 1; min-width: 0; }
.history-row .info strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row .info span { font-size: 11.5px; color: var(--dim); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.file-card .preview { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; color: var(--dim); overflow: hidden; }
.file-card .preview img { width: 100%; height: 100%; object-fit: cover; }
.file-card .body { padding: 10px 12px; font-size: 11.5px; color: var(--dim); }
.file-card .body strong { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 11px 14px; background: var(--surface-2); color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; position: sticky; top: 0; }
td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
td strong { color: var(--text); font-weight: 600; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-actions { display: flex; gap: 6px; }

/* ---------- Админка ---------- */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: #0b0a12; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.admin-main { padding: 24px 28px; min-width: 0; }
.admin-side .side-link { color: #a9a4bf; }
.admin-side .side-link.active { background: rgba(139, 92, 246, 0.16); color: #fff; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-title h1 { font-size: 22px; margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.kpi span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.kpi strong { font-size: 24px; letter-spacing: -0.02em; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- Ошибки ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.error-code { font-size: clamp(70px, 14vw, 140px); font-weight: 800; letter-spacing: -0.06em; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 24px; margin: 10px 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .tool-hero-grid, .split { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; order: 0; width: 100%; }
  .hero-mosaic { transform: none; }
  .hero-mosaic figure:nth-child(2), .hero-mosaic figure:nth-child(3) { transform: none; }
  .hero-mosaic figure img, .hero-mosaic figure:nth-child(2) img { aspect-ratio: 4 / 3; }
  .hero-float { position: static; margin-top: 14px; width: fit-content; }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-side { position: static; }
  .app-grid { grid-template-columns: 1fr; }
  .stat-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
  .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .container, .container.narrow { width: calc(100% - 28px); }
  .main-nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .mobile-nav.open { display: block; }
  .header-inner { gap: 12px; }
  .header-actions .balance-chip { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { display: none; }
  .mobile-filters { display: grid; gap: 10px; }
  .mobile-filters .card-soft { padding: 12px 14px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .mobile-app-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: blur(16px); padding-bottom: env(safe-area-inset-bottom);
  }
  .app-content { padding: 18px 14px 88px; }
  .toast-stack { bottom: 72px; right: 12px; left: 12px; max-width: none; }
  .app-topbar { padding: 0 14px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-main { padding: 18px 14px; }
  .price-grid { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 50px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cta-band { padding: 28px; }
  .tool-gallery img:first-child { aspect-ratio: 4/3; }
  .history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-card .preview { aspect-ratio: 4 / 3; }
  .stat-grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
  .header-actions { gap: 6px; }
  .header-actions .btn-ghost { display: none; }
  .header-actions .btn-primary { padding: 8px 11px; font-size: 12.5px; min-height: 36px; }
  .header-inner { gap: 8px; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
  .hero { padding-top: 34px; }
  .hero-visual { margin-top: 6px; }
  .hero-mosaic { gap: 8px; }
  .btn-lg { width: 100%; }
  .hero-actions { display: grid; }
  .footer-grid { grid-template-columns: 1fr; }
  .app-topbar .search { display: none; }
  body { overflow-x: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


