/* razdelitfoto — разделить фото на части. Вёрстка по макету maket.png, телефон с 320 px. */

:root {
  --bg: #f5f7fc;
  --bg-glow: #e8eeff;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --text: #0f172a;
  --muted: #5b6478;
  --line: #e3e8f2;
  --primary: #2f5cf0;
  --primary-hover: #244ad6;
  --primary-soft: #edf1ff;
  --accent: #7b3fe4;
  --green: #12b886;
  --green-soft: #e6f8f1;
  --stage: #eef2f9;
  --shadow: 0 10px 30px rgba(28, 48, 110, .08), 0 1px 2px rgba(28, 48, 110, .06);
  --shadow-btn: 0 8px 18px rgba(47, 92, 240, .28);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c111c; --bg-glow: #131d38; --surface: #141b2a; --surface-2: #1a2234; --text: #e8edf7;
    --muted: #9aa5bb; --line: #26314a; --primary: #5b7cff; --primary-hover: #7390ff; --primary-soft: #1c2747;
    --accent: #a77bff; --green: #34d399; --green-soft: #12302a; --stage: #0f1524;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-btn: 0 8px 18px rgba(60, 100, 255, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c111c; --bg-glow: #131d38; --surface: #141b2a; --surface-2: #1a2234; --text: #e8edf7;
  --muted: #9aa5bb; --line: #26314a; --primary: #5b7cff; --primary-hover: #7390ff; --primary-soft: #1c2747;
  --accent: #a77bff; --green: #34d399; --green-soft: #12302a; --stage: #0f1524;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-btn: 0 8px 18px rgba(60, 100, 255, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); font-size: 16px; line-height: 1.5;
  background: radial-gradient(1200px 520px at 70% -120px, var(--bg-glow), transparent 70%), var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 12px; font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #3b68ff, var(--primary)); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-sm { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-lg { height: 56px; padding: 0 22px; font-size: 16px; }
.btn-lg .arr { margin-left: 6px; }
.btn-block { width: 100%; height: 50px; padding: 0 10px; font-size: 14.5px; gap: 8px; }
.btn .play { width: 16px; height: 16px; color: var(--primary); }
.btn[disabled] { opacity: .7; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-strong { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.link-strong svg { width: 16px; height: 16px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--primary-soft); }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: block; }
  :root:not([data-theme="light"]) .ico-moon { display: none; }
}

/* ---------- шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.header-in { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 23px; letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; fill: var(--primary); }
.logo b { color: var(--primary); font-weight: 800; }
.nav { display: flex; gap: 30px; margin: 0 auto; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.menu-btn, .only-mobile { display: none; }

/* ---------- первый экран ---------- */
.hero { padding: 20px 0 36px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 32px; align-items: center; }
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
h1 { margin-top: 20px; font-size: clamp(34px, 4.6vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.grad { background: linear-gradient(90deg, var(--accent), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 18px; color: var(--muted); font-size: 16.5px; line-height: 1.55; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.drop-hint { margin-top: 16px; font-size: 14px; line-height: 1.6; }
.show-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .hide-touch { display: none; } .show-touch { display: inline; } }

/* ---------- инструмент ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 20px; padding: 18px; }
.tool.pulse { animation: pulse 1s ease; }
@keyframes pulse { 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 35%, transparent), var(--shadow); } }
.stage-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.stage {
  position: relative; display: grid; place-items: center; min-height: 240px; padding: 12px; border-radius: 12px;
  background: var(--stage); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.stage.pan { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.parts { grid-area: 1 / 1; position: relative; pointer-events: none; }
.part {
  position: absolute; pointer-events: auto; cursor: pointer;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s, border-radius .45s;
}
.part canvas { display: block; width: 100%; height: 100%; }
.part::after { content: ""; position: absolute; inset: 0; transition: background .12s; pointer-events: none; }
.parts.grid .part::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9); }
.part:hover::after { background: rgba(255, 255, 255, .14); }
.stage.pan .part { cursor: inherit; }
/* части собираются при загрузке фото и разлетаются, пока готовятся к скачиванию */
.parts.intro .part { animation: part-in .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes part-in { from { opacity: 0; transform: translate(calc(var(--dx) * 2), calc(var(--dy) * 2)) scale(.92); } }
.parts.burst .part { transform: translate(var(--dx), var(--dy)); border-radius: 5px; overflow: hidden; box-shadow: 0 8px 18px rgba(20, 30, 60, .28); }
.part b {
  position: absolute; z-index: 1; left: 8px; top: 8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #1e2433;
  background: rgba(255, 255, 255, .94); box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.parts.small .part b { left: 4px; top: 4px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 3px; }
.parts.tiny .part b, .parts:not(.numbered) .part b { display: none; }
.drop-overlay {
  position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 10px;
  font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 2px dashed var(--primary); border-radius: 12px;
}
.drop-overlay svg { width: 34px; height: 34px; }
.stage.drop .drop-overlay { display: grid; }
.view-tabs {
  align-self: center; display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.view-tabs button { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); }
.view-tabs [aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(20, 30, 60, .12); }
.ig { width: min(100%, 340px); padding: 12px 0 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.ig[hidden], .parts[hidden] { display: none; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 10px; }
.ig-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--scene) center / cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #e1306c; flex: none; }
.ig-head b { display: block; font-size: 14px; }
.ig-head span { display: block; font-size: 12px; color: var(--muted); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-tile { position: relative; aspect-ratio: 3 / 4; background: var(--surface-2); }
.ig-tile canvas { display: block; width: 100%; height: 100%; }
.ig-tile b {
  position: absolute; right: 5px; bottom: 5px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  display: grid; place-items: center; font-size: 11px; color: #fff; background: rgba(15, 23, 42, .72);
}
.ig-tile.old { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--line) 8px 9px); }
.ig-note { padding: 10px 12px 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; border: 0; background: none; color: var(--primary); font-size: 13.5px; font-weight: 600; }
.btn-text svg { width: 18px; height: 18px; }
.btn-text:hover { text-decoration: underline; }
.private { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.private svg { width: 18px; height: 18px; color: var(--green); }
.sticky-dl { display: none; }
#printArea { display: none; }
.stage-meta { font-size: 13px; color: var(--muted); text-align: center; min-height: 20px; overflow-wrap: anywhere; }

.settings { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.settings-title { font-size: 14px; font-weight: 600; }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-top: 4px; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset {
  display: grid; justify-items: center; gap: 4px; padding: 9px 0 6px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.preset .g { width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 4px; }
.g2 { background: linear-gradient(90deg, transparent 9px, currentColor 9px 11px, transparent 11px), linear-gradient(transparent 9px, currentColor 9px 11px, transparent 11px); }
.g3 { background: linear-gradient(90deg, transparent 5px, currentColor 5px 7px, transparent 7px 11px, currentColor 11px 13px, transparent 13px), linear-gradient(transparent 5px, currentColor 5px 7px, transparent 7px 11px, currentColor 11px 13px, transparent 13px); }
.g4 { background: linear-gradient(90deg, transparent 3.5px, currentColor 3.5px 5px, transparent 5px 8.5px, currentColor 8.5px 10px, transparent 10px 13px, currentColor 13px 14.5px, transparent 14.5px), linear-gradient(transparent 3.5px, currentColor 3.5px 5px, transparent 5px 8.5px, currentColor 8.5px 10px, transparent 10px 13px, currentColor 13px 14.5px, transparent 14.5px); }
.preset[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.preset:hover, .chip:hover { border-color: var(--primary); }
.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { height: 34px; padding: 0 4px; font-size: 12px; white-space: nowrap; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }

.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stepper .label { margin: 0 0 4px; }
.step-ctl { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; height: 34px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.step-ctl button { height: 100%; border: 0; background: var(--surface-2); font-size: 17px; }
.step-ctl button:hover { color: var(--primary); }
.step-ctl output { text-align: center; font-weight: 600; font-size: 14px; }

.select { position: relative; }
.select select {
  width: 100%; height: 38px; padding: 0 34px 0 12px; font: inherit; font-size: 13.5px; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); appearance: none; -webkit-appearance: none;
}
.select::after { content: ""; position: absolute; right: 13px; top: 14px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }

.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 10px; align-items: center; }
.range-row output { height: 32px; display: grid; place-items: center; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; }
input[type="range"] { min-width: 0; width: 100%; margin: 0; height: 24px; background: transparent; -webkit-appearance: none; appearance: none; --p: 0%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--primary) var(--p), var(--line) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--primary); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); }

.toggles { display: grid; gap: 4px; margin: 2px 0 4px; }
.toggle { position: relative; display: flex; align-items: center; gap: 7px; min-height: 30px; font-size: 13px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { margin-left: auto; width: 36px; height: 20px; border-radius: 20px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle input:checked + i { background: var(--primary); }
.toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

.tip { position: relative; display: inline-grid; color: var(--muted); }
.tip svg { width: 15px; height: 15px; }
.tip::after {
  content: attr(data-tip); position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 8px); width: 220px; transform: translateX(-50%);
  padding: 8px 10px; border-radius: 8px; background: #1e2433; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.4;
  opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none;
}
.tip:hover::after, .tip:focus::after { opacity: 1; visibility: visible; }
.status { min-height: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.status.err { color: #e03131; }
.part { padding: 0; border: 0; border-radius: 0; background: transparent; }
.part:focus-visible { z-index: 3; outline: 3px solid var(--primary); outline-offset: -3px; }
.format-notice { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.legal { max-width: 800px; margin: 0 auto; padding: 32px 20px 64px; }
.legal h1 { margin: 24px 0; font-size: clamp(28px, 6vw, 40px); }
.legal h2 { margin: 28px 0 10px; font-size: 22px; }
.legal p { margin: 12px 0; }
.legal a { color: var(--primary); text-decoration: underline; }

/* ---------- разделы ---------- */
.section { padding: 28px 0; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 36px 32px 40px; box-shadow: var(--shadow); }
.h2 { font-size: clamp(25px, 3vw, 30px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.h2-left { text-align: left; }
.sub { margin-top: 8px; text-align: center; color: var(--muted); font-size: 16px; }
.tile { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.tile svg { width: 30px; height: 30px; }
.tile-green { background: var(--green-soft); color: var(--green); }

.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 48px 1fr 48px 1fr; align-items: start; }
.step { text-align: center; padding: 0 8px; }
.step-head { display: flex; align-items: center; justify-content: center; gap: 22px; }
.num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; }
.step h3 { margin-top: 18px; font-size: 18px; }
.step p { margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.step-arrow { display: grid; place-items: center; height: 64px; color: color-mix(in srgb, var(--primary) 45%, transparent); }
.step-arrow svg { width: 30px; height: 30px; }

.features { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; text-align: center; }
.features .tile { margin: 0 auto; width: 58px; height: 58px; }
.features h3 { margin-top: 14px; font-size: 16px; }
.features p { margin-top: 6px; font-size: 14px; color: var(--muted); }

.uses { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.use { position: relative; padding: 12px 12px 18px; display: flex; flex-direction: column; }
.use h3 { margin: 10px 6px 0; font-size: 17px; }
.use p { margin: 6px 6px 0; font-size: 14px; color: var(--muted); flex: 1; }
.use-try { align-self: flex-start; margin: 12px 6px 0; padding: 0; border: 0; background: none; color: var(--primary); font-size: 14px; font-weight: 600; }
.use-try:hover { text-decoration: underline; }
.use-badge {
  position: relative; z-index: 1; margin: -21px 0 0 10px; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.use-badge svg { width: 22px; height: 22px; }
.badge-insta { color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0, #fd5949 45%, #d6249f 60%, #285aeb 90%); border: 3px solid var(--surface); }

/* иллюстрации: --scene — картинка, которую рисует app.js (тот же пейзаж, что в инструменте) */
.ill { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #dfe6f3; }
.scene { background-image: var(--scene); background-size: cover; background-position: center; background-color: #8ea3cf; }
.split3 { position: relative; aspect-ratio: 1; }
.split3::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent calc(100% / 3 - 1px), #fff 0 calc(100% / 3 + 1px), transparent 0 calc(200% / 3 - 1px), #fff 0 calc(200% / 3 + 1px), transparent 0),
    linear-gradient(180deg, transparent calc(100% / 3 - 1px), #fff 0 calc(100% / 3 + 1px), transparent 0 calc(200% / 3 - 1px), #fff 0 calc(200% / 3 + 1px), transparent 0);
}
.ill-insta { background: linear-gradient(160deg, #fbcfdc, #c3d3fb 55%, #9cc8ee); }
.phone { position: absolute; left: 50%; top: 9%; width: 52%; transform: translateX(-50%) rotate(-4deg); padding: 5px; border-radius: 20px; background: #15171c; box-shadow: 0 16px 30px rgba(20, 30, 60, .35); }
.screen { border-radius: 15px; overflow: hidden; background: #fff; padding: 10px 0 40px; }
.prof { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; }
.ava { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #fd5949, #d6249f); }
.ln { flex: 1; height: 6px; border-radius: 3px; background: #e6e8ee; }
.ill-wall { background: linear-gradient(180deg, #efe8e0, #e5ddd3 78%, #cdbfae 78%); }
.trip { position: absolute; left: 30%; top: 12%; width: 62%; height: 56%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; filter: drop-shadow(0 8px 10px rgba(60, 40, 20, .25)); }
.trip i { background-size: 300% auto; }
.trip i:nth-child(1) { background-position: 0 50%; }
.trip i:nth-child(2) { background-position: 50% 50%; }
.trip i:nth-child(3) { background-position: 100% 50%; }
.plant { position: absolute; left: 4%; bottom: 10%; width: 22%; height: auto; }
.ill-collage { display: grid; grid-template-columns: 1.2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 6px; background: var(--surface-2); }
.ill-collage i { border-radius: 8px; }
.ill-collage .p1 { grid-row: span 2; background-size: 300% auto; background-position: 22% 50%; }
.ill-collage .p2 { background-size: 260% auto; background-position: 70% 30%; }
.ill-collage .p3 { background-size: 240% auto; background-position: 90% 90%; }
.ill-collage .c1 { background: linear-gradient(135deg, #ffd59e, #fbb86c); }
.ill-collage .c2 { background: linear-gradient(135deg, #f9b4d4, #f48cb6); }
.ill-collage .c3 { display: none; }
.ill-edu svg { width: 100%; height: 100%; display: block; }

.faq-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.faq { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; align-items: start; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; min-height: 48px;
  font-size: 15px; font-weight: 500; list-style: none; cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.faq details[open] summary svg { transform: rotate(90deg); color: var(--primary); }
.faq details p { padding: 0 16px 15px; font-size: 14.5px; color: var(--muted); }

/* ---------- подвал ---------- */
.footer { margin-top: 24px; padding: 32px 0 calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr auto; gap: 24px; }
.footer-brand p { margin-top: 10px; font-size: 13.5px; color: var(--muted); max-width: 240px; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13.5px; }
.footer-col h4 { font-size: 13.5px; margin-bottom: 2px; }
.footer-col a, .flink { color: var(--muted); background: none; border: 0; padding: 0; text-align: left; font-size: 13.5px; }
.footer-col a:hover, .flink:hover { color: var(--primary); }
.socials { display: flex; gap: 10px; }
.socials a, .socials button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.socials a:hover, .socials button:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; font-size: 13px; color: var(--muted); }
.heart { color: #e5484d; }

.dlg { max-width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 24px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg::backdrop { background: rgba(10, 15, 30, .45); }
.dlg p { margin: 10px 0 18px; color: var(--muted); font-size: 15px; }
.dlg .btn { height: 44px; padding: 0 22px; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: #1e2433; color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- печать: только части, каждая на своём листе ---------- */
@media print {
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  .sheet { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4mm; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet img { width: 100%; height: calc(100vh - 12mm); object-fit: contain; }
  .sheet p { font: 9pt var(--font); color: #666; }
}

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .hero-text { max-width: 640px; }
  .br-wide { display: none; }
  .features { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .uses { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav {
    position: absolute; left: 12px; right: 12px; top: 68px; display: none; flex-direction: column; gap: 0; margin: 0; padding: 6px;
    background: var(--surface); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  }
  .nav a { padding: 13px 14px; border-radius: 10px; }
  .nav a:hover { background: var(--primary-soft); }
  .nav.open { display: flex; }
  .menu-btn { display: grid; }
  .header-in { justify-content: space-between; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .step { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; text-align: left; padding: 0; }
  .step-head { grid-row: span 2; align-self: start; gap: 0; }
  .step-head .tile { display: none; }
  .step h3 { margin-top: 4px; }
  .step-arrow { display: none; }
}

@media (max-width: 680px) {
  .tool { grid-template-columns: 1fr; padding: 12px; gap: 16px; }
  .settings { gap: 9px; }
  .presets .preset { padding: 10px 0 8px; font-size: 13px; }
  .chip, .step-ctl, .select select { height: 42px; }
  .step-ctl { grid-template-columns: 42px 1fr 42px; }
  .toggle { min-height: 40px; font-size: 14px; }
  .btn-block { height: 54px; font-size: 16px; }
  /* Подсказка привязана к экрану: скрытые псевдоэлементы тоже расширяют WebKit layout. */
  .tip::after { position: fixed; left: 16px; right: 16px; bottom: 84px; transform: none; width: auto; }
  .sticky-dl {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transform: translateY(110%); transition: transform .25s;
  }
  .sticky-dl.show { transform: none; }
  .sticky-dl .btn { width: 100%; height: 50px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .header-in { height: 62px; gap: 8px; }
  .logo { font-size: 19px; gap: 8px; }
  .logo svg { width: 26px; height: 26px; }
  .header-actions { gap: 4px; }
  .header .btn-sm { width: 42px; padding: 0; }
  .header .btn-sm span { display: none; }
  .only-mobile { display: block; }
  .nav { top: 58px; }
  .hero { padding-top: 10px; }
  h1 { margin-top: 14px; }
  .lead { font-size: 15.5px; }
  .hero-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .btn-lg { width: 100%; height: 54px; }
  .section { padding: 18px 0; }
  .panel { padding: 26px 18px 28px; }
  .features { grid-template-columns: 1fr 1fr; gap: 22px 14px; }
  .features li:last-child { grid-column: 1 / -1; max-width: 260px; margin: 0 auto; }
  .uses { grid-template-columns: 1fr; }
  .faq { grid-template-columns: 1fr; }
  .faq-head .h2 { font-size: 24px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-col:nth-of-type(3) { grid-column: 1 / -1; }
  .socials { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  .hero-text .badge { display: none; }
  .hero-text h1 { font-size: 30px; margin-top: 6px; }
  .hero-text .lead { font-size: 14px; margin-top: 8px; }
  .hero-buttons { grid-template-columns: 1fr auto; margin-top: 14px; }
  .hero-buttons .btn-lg { height: 48px; padding: 0 12px; font-size: 14px; }
  .hero-buttons .arr, .hero-buttons .play { display: none; }
  .hero-text .private, .drop-hint { font-size: 12px; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
