:root {
  color-scheme: dark;
  /* «Глубокий космос»: индиго-фон, фиолетовый + циан как двойной акцент туманности. */
  --bg: #0a0e27;
  --bg-deep: #060817;
  --surface: #10142f;
  --surface-2: #161b3d;
  --surface-3: #1c2249;
  --line: rgba(200, 202, 235, .13);
  --line-strong: rgba(200, 202, 235, .24);
  --text: #f1f0fa;
  --muted: #9299c4;
  --faint: #5c6390;
  --violet: #8b7fd6;
  --violet-strong: #a89ae8;
  --cyan: #4ecbdb;
  --cyan-strong: #6fe0ee;
  --magenta: #d67fc0;
  --blue: #91b3ca;
  --green: #69d0aa;
  --danger: #ed7b83;
  --max: 1760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--violet-strong); outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 39, .82);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(var(--max), calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 188px; }
.brand img { width: 34px; height: 34px; object-fit: contain; filter: invert(1) brightness(1.5); }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 14px; line-height: 1; }
.brand small { color: var(--violet); font-size: 11px; line-height: 1.2; }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  color: #a8afb8;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.header-nav a:hover { color: var(--text); border-color: var(--line); background: #171c3f; }
.header-nav .header-order { color: #111317; background: var(--violet); border-color: var(--violet); }
.header-nav .header-order:hover { color: #08090b; background: var(--violet-strong); border-color: var(--violet-strong); }
.menu-button { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.menu-button span { display: block; width: 18px; height: 1px; margin: 5px auto; background: var(--text); transition: transform .2s ease; }
.menu-button[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

main { min-height: calc(100vh - 144px); }
.result-head h1 { margin: 6px 0 0; font-size: 44px; line-height: 1.04; }
.eyebrow { margin: 0; color: var(--violet); font-size: 11px; font-weight: 800; text-transform: uppercase; }

/* Компактная шапка рабочих страниц (редактор) — без полного pitch-hero, тот теперь только на / */
.editor-intro {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}
.editor-intro h1 { margin: 6px 0 0; font-size: 34px; line-height: 1.08; }
.editor-intro > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ══ Hero: сдержанный космос — тихий градиент фона, едва заметная звёздная пыль ══
   (было слишком ярко/пёстро: радужный текст, светящиеся туманности, мерцание — переделано
   по образцу memories.gravium.ru: спокойный тон, акцент только в одном слове/детали) */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 46px;
  background:
    linear-gradient(180deg, rgba(139, 127, 214, .05), transparent 70%),
    var(--bg-deep);
}
.hero-stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
/* Декоративные блики оставлены статичными пятнами без движения и почти незаметными —
   ambient-подсветка угла, а не «туманность» */
.hero-nebula {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .12;
  pointer-events: none;
}
.hero-nebula-a { top: -260px; left: -160px; background: radial-gradient(circle, var(--violet), transparent 68%); }
.hero-nebula-b { top: -120px; right: -200px; width: 500px; height: 500px; background: radial-gradient(circle, var(--cyan), transparent 70%); }
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.hero-title {
  margin: 14px 0 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.hero-title-glow { color: var(--violet-strong); font-style: italic; }
.hero-lead { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-badges span {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
}
.hero-badge-dot { display: none; }

/* Скролл-reveal для «как работает» — прячем и мягко поднимаем, IntersectionObserver ставит is-visible */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ══ Посадочная страница (/) — витрина сервиса, ведёт в редактор (/create/) ══ */
.home-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 460px; align-items: center; gap: 52px; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.home-hero-stage { position: relative; }
.home-hero-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
}
.home-hero-card img { width: 100%; height: auto; display: block; aspect-ratio: 1800 / 1300; object-fit: cover; }
.home-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(6, 8, 23, .55)); }
.home-hero-badge {
  position: absolute;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 39, .82);
  backdrop-filter: blur(8px);
  font-size: 10.5px;
}
.home-hero-badge span { display: block; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.home-hero-badge strong { display: block; margin-top: 2px; color: var(--text); font-size: 11.5px; }
.home-badge-tl { top: 16px; left: 16px; }
.home-badge-br { bottom: 16px; right: 16px; }

.home-note { padding: 40px 0; border-bottom: 1px solid var(--line); }
.home-note-inner {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.home-note-dot { flex-shrink: 0; margin-top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.home-note-inner p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

.home-shapes { padding: 64px 0; border-bottom: 1px solid var(--line); }
.home-shapes-head { width: min(var(--max), calc(100% - 40px)); margin: 0 auto 32px; max-width: 620px; }
.home-shapes-head h2 { margin: 10px 0 12px; font-size: 30px; }
.home-shapes-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.home-shapes-grid {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.home-shape-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.home-shape-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.home-shape-card span { display: block; padding: 12px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

.home-cta { padding: 70px 0 90px; text-align: center; }
.home-cta-inner { width: min(640px, calc(100% - 40px)); margin: 0 auto; }
.home-cta-inner h2 { margin: 0 0 24px; font-size: 28px; }

@media (prefers-reduced-motion: reduce) {
  .hero-nebula { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

.space-editor {
  width: min(var(--max), calc(100% - 40px));
  height: min(820px, calc(100vh - 188px));
  min-height: 660px;
  margin: 0 auto 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: start;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0e27;
}
.sky-workspace {
  position: sticky;
  top: 84px;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}
.stage-toolbar {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #10142f;
}
.view-switch { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #080b22; }
.view-button {
  min-width: 92px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.view-button.is-active { color: var(--text); background: var(--surface-3); }
.stage-actions { display: flex; gap: 6px; }
.icon-action {
  width: 38px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: #cbd1d8;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.icon-action:hover { background: var(--surface-3); border-color: rgba(139, 127, 214, .4); color: var(--violet-strong); }

.sky-stage {
  position: relative;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background: #060817;
  isolation: isolate;
}
.sky-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .35;
}
#skyCanvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s ease; }
#skyCanvas.is-ready { opacity: 1; }
.stage-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  background: rgba(6, 8, 23, .78);
  font-size: 13px;
  transition: opacity .25s ease, visibility .25s ease;
}
.stage-loading.is-hidden { opacity: 0; visibility: hidden; }
.stage-loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.7); opacity: .45; } }
.stage-readout {
  position: absolute;
  left: 18px;
  bottom: 17px;
  display: grid;
  gap: 3px;
  pointer-events: none;
}
.stage-readout strong { font-size: 12px; }
.stage-readout span { color: var(--muted); font-size: 10px; }
.accuracy-note {
  min-height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #10142f;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(105, 208, 170, .38); }
.accuracy-note div { display: grid; gap: 3px; }
.accuracy-note strong { font-size: 12px; }
.accuracy-note small { color: var(--muted); font-size: 10px; }

.editor-inspector {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-color: rgba(139, 127, 214, .38) transparent;
  scrollbar-width: thin;
  background: #12163a;
}
.editor-inspector::-webkit-scrollbar { width: 8px; }
.editor-inspector::-webkit-scrollbar-thumb { border: 2px solid #12163a; border-radius: 8px; background: rgba(139, 127, 214, .38); }
.inspector-head {
  min-height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.inspector-head > div { display: grid; gap: 4px; }
.inspector-head span { color: var(--faint); font-size: 10px; text-transform: uppercase; font-weight: 750; }
.inspector-head strong { font-size: 14px; }
.project-state { padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; background: #191f47; }
.control-section { margin: 0; padding: 22px 20px 24px; border: 0; border-bottom: 1px solid var(--line); }
.control-section legend {
  width: 100%;
  padding: 0 0 18px;
  color: #d5d9de;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.control-section legend span { margin-right: 8px; color: var(--violet); }
.field-label, .field-grid label > span { display: block; margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
input[type="text"], input[type="date"], input[type="time"], select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d1130;
  color: var(--text);
  font-size: 13px;
  transition: border-color .16s ease, background .16s ease;
}
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: rgba(139, 127, 214, .56); background: #11153a; outline: 0; }
input::placeholder { color: #59616b; }
select { color-scheme: dark; }
.search-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.search-field button {
  min-width: 76px;
  border: 1px solid rgba(139, 127, 214, .3);
  border-radius: 5px;
  background: #211a3f;
  color: var(--violet-strong);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.search-field button:hover { background: #2b2350; }
.field-feedback { min-height: 26px; padding: 7px 1px 0; color: var(--faint); font-size: 10px; line-height: 1.35; }
.field-feedback.is-success { color: var(--green); }
.field-feedback.is-error, .errorlist { color: var(--danger); }
.errorlist { margin: 7px 0 0; padding: 0; list-style: none; font-size: 11px; }
.field-grid { display: grid; gap: 8px; margin: 14px 0; }
.field-grid.three { grid-template-columns: 1fr 1fr 1.15fr; }
.form-alert { margin: 16px 20px 0; padding: 12px; border-left: 2px solid var(--danger); background: rgba(237, 123, 131, .08); color: #eeb5b9; font-size: 12px; }

textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d1130;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color .16s ease, background .16s ease;
}
textarea:hover { border-color: var(--line-strong); }
textarea:focus { border-color: rgba(139, 127, 214, .56); background: #11153a; outline: 0; }
textarea::placeholder { color: #59616b; }
.section-hint { margin: -4px 0 14px; color: var(--faint); font-size: 11px; line-height: 1.5; }

/* Загрузка фото истории: нативный input скрыт, кликабельная карточка-лейбл вместо него */
input[type="file"]#id_photo { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-field {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, .015);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.photo-field:hover { border-color: rgba(139, 127, 214, .5); background: rgba(139, 127, 214, .05); }
.photo-field-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(139, 127, 214, .14);
  color: var(--violet-strong);
  font-size: 17px;
}
.photo-field-text { display: grid; gap: 2px; }
.photo-field-text strong { font-size: 12px; }
.photo-field-text small { color: var(--faint); font-size: 10px; }
.photo-preview { position: relative; margin-top: 10px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.photo-preview img { width: 100%; max-height: 180px; object-fit: cover; }
.photo-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 8, 23, .72);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.style-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.style-option {
  position: relative;
  min-height: 48px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 25px 1fr 8px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #10142d;
  color: #aeb5bd;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.style-option:has(input:checked) { border-color: rgba(139, 127, 214, .5); color: var(--text); background: #1a1a3d; }
.style-option input, .product-option input { position: absolute; opacity: 0; pointer-events: none; }
.style-swatch { width: 25px; height: 25px; border: 1px solid rgba(255,255,255,.15); border-radius: 3px; background: #050608; }
[data-style="constellation"] .style-swatch { background: linear-gradient(135deg, #0d1130 50%, #c9a86a 51%, #0d1130 55%); }
[data-style="orbit"] .style-swatch { background: radial-gradient(circle, #91b3ca 0 5%, #06080b 6% 38%, #607789 39% 42%, #06080b 43%); }
[data-style="contour"] .style-swatch { background: #e9e6df; }
[data-style="gold"] .style-swatch { background: radial-gradient(circle at 65% 35%, #f0c874 0 7%, #080604 8%); }
.style-option i { width: 7px; height: 7px; border: 1px solid var(--faint); border-radius: 50%; }
.style-option:has(input:checked) i { border-color: var(--violet); background: var(--violet); }
.toggle-row {
  margin-top: 12px;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}
.toggle-row input { position: absolute; opacity: 0; }
.toggle-control { position: relative; width: 34px; height: 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: #0d1130; }
.toggle-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .18s ease, background .18s ease; }
.toggle-row input:checked + .toggle-control { border-color: rgba(139, 127, 214, .5); }
.toggle-row input:checked + .toggle-control::after { transform: translateX(14px); background: var(--violet); }
.toggle-row > span:last-child { display: grid; gap: 3px; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { color: var(--faint); font-size: 9px; line-height: 1.35; }

.product-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.product-option {
  position: relative;
  min-height: 82px;
  padding: 10px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0f1330;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  cursor: pointer;
}
.product-option:has(input:checked) { border-color: rgba(139, 127, 214, .5); color: var(--text); background: #1a1a3d; }
.product-shape { display: block; width: 58px; height: 32px; border: 1px solid #818993; border-radius: 4px; background: #1e2348; }
.product-shape.round_tag { width: 34px; height: 34px; border-radius: 50%; }
.product-shape.keychain { height: 15px; }
.product-shape.pendant { width: 48px; height: 25px; }

.submit-area { padding: 20px; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 10px; line-height: 1.4; cursor: pointer; }
.consent-row input { margin: 1px 0 0; accent-color: var(--violet); }
.primary-action, .secondary-action {
  min-height: 50px;
  border-radius: 5px;
  font-weight: 800;
  cursor: pointer;
}
.primary-action {
  width: 100%;
  margin-top: 15px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--violet);
  background: var(--violet);
  color: #0a0b0d;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.primary-action:hover { background: var(--violet-strong); border-color: var(--violet-strong); }
.primary-action:active { transform: translateY(1px); }
.primary-action[disabled] { cursor: wait; opacity: .65; }
.submit-area > p { margin: 9px 0 0; color: var(--faint); text-align: center; font-size: 9px; }

.service-band {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.service-band > div { min-height: 164px; padding: 30px; border-right: 1px solid var(--line); }
.service-band > div:last-child { border-right: 0; }
.service-band span { color: var(--violet); font-size: 10px; font-weight: 800; }
.service-band strong { display: block; margin: 20px 0 8px; font-size: 18px; }
.service-band p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.result-head {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.result-head > div > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.secondary-action { min-width: 134px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 12px; }
.secondary-action:hover { border-color: rgba(139, 127, 214, .45); }
.result-layout { width: min(1320px, calc(100% - 40px)); margin: 0 auto 70px; display: grid; grid-template-columns: minmax(0, 1.5fr) 390px; border: 1px solid var(--line); }
.result-visual { min-width: 0; margin: 0; border-right: 1px solid var(--line); background: #0d1130; }
.result-visual img { width: 100%; aspect-ratio: 1.38; object-fit: cover; }
.result-visual figcaption { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.result-panel { padding: 28px 24px; background: #12163a; }
.panel-kicker { margin: 0 0 16px; color: var(--violet); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.result-panel dl { margin: 0; }
.result-panel dl div { padding: 13px 0; display: grid; grid-template-columns: 104px 1fr; gap: 12px; border-top: 1px solid var(--line); }
.result-panel dt { color: var(--faint); font-size: 10px; }
.result-panel dd { margin: 0; color: #cfd4da; font-size: 11px; line-height: 1.4; }
.result-order { text-decoration: none; }
.order-note { margin: 10px 0 20px; color: var(--faint); font-size: 9px; line-height: 1.5; }
.download-list { border-top: 1px solid var(--line); }
.download-list a { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); color: #bdc4cc; }
.download-list a:hover { color: var(--text); }
.download-list span { display: grid; grid-template-columns: 42px 1fr; align-items: center; font-size: 10px; }
.download-list strong { color: var(--violet); font-size: 9px; }
.download-list b { font-size: 14px; }

.btn {
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn-primary { border: 1px solid var(--violet); background: var(--violet); color: #0a0b0d; }
.btn-primary:hover { background: var(--violet-strong); border-color: var(--violet-strong); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: rgba(139, 127, 214, .5); color: var(--violet-strong); }

/* ══ Поделиться историей: QR-блок на странице результата и на публичной странице ══ */
.share-section {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto 80px;
  padding: 48px 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse 520px 320px at 8% 0%, rgba(139, 127, 214, .14), transparent 65%),
    radial-gradient(ellipse 460px 320px at 100% 100%, rgba(78, 203, 219, .1), transparent 65%),
    var(--surface);
}
.share-inner { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 40px; }
.share-title { margin: 10px 0 14px; font-size: 26px; line-height: 1.16; }
.share-text > p:last-of-type { max-width: 52ch; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.share-qr-card { display: grid; justify-items: center; gap: 12px; }
.share-qr-frame {
  width: 100%;
  max-width: 220px;
  padding: 16px;
  border-radius: 16px;
  background: #f2f3fb;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4), 0 0 0 1px rgba(139, 127, 214, .18);
}
.share-qr-frame img { width: 100%; height: auto; display: block; }
.share-qr-hint { color: var(--faint); font-size: 10.5px; text-align: center; }

/* ══ Публичная страница истории (открывается по QR на изделии) ══ */
.story-owner-bar { border-bottom: 1px solid var(--line); background: rgba(139, 127, 214, .08); }
.story-owner-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 52px;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.story-owner-inner b { color: var(--cyan-strong); margin-right: 6px; }
.story-owner-actions { display: flex; gap: 10px; }
.story-owner-actions a, .story-owner-actions button {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.story-owner-actions a:hover, .story-owner-actions button:hover { border-color: rgba(139, 127, 214, .5); color: var(--violet-strong); }

.story-hero { position: relative; overflow: hidden; }
.story-hero-photo { min-height: clamp(420px, 56vh, 620px); display: flex; align-items: flex-end; }
.story-hero-bg { position: absolute; inset: 0; }
.story-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.story-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,8,23,.15) 0%, rgba(6,8,23,.55) 55%, rgba(6,8,23,.94) 100%); }
.story-hero-inner { position: relative; z-index: 1; width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 44px 0 clamp(34px, 6vh, 64px); }
.story-hero-cosmos {
  padding: 70px 0 60px;
  background:
    radial-gradient(ellipse 900px 500px at 18% -10%, rgba(139, 127, 214, .16), transparent 60%),
    radial-gradient(ellipse 700px 460px at 88% 10%, rgba(78, 203, 219, .12), transparent 60%),
    var(--bg-deep);
}
.story-hero-inner-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: center; gap: 40px; padding: 0; }
.story-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.story-brand-mark { color: var(--cyan-strong); font-size: 15px; }
.story-date { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.story-date-d { font-size: 34px; font-weight: 800; color: var(--text); line-height: 1; }
.story-date-my { color: var(--violet-strong); font-size: 13px; font-weight: 700; text-transform: capitalize; }
.story-title { margin: 0 0 10px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08; color: var(--text); }
.story-place { margin: 0; color: var(--muted); font-size: 14px; }
.story-hero-map { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0,0,0,.4); }
.story-hero-map img { width: 100%; height: auto; display: block; }

.story-quote-section { padding: clamp(44px, 6vw, 76px) 0; }
.story-quote-wrap { width: min(720px, calc(100% - 40px)); margin: 0 auto; }
.story-quote-card {
  position: relative;
  padding: clamp(40px, 6vw, 64px) clamp(24px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}
.story-quote-mark { display: block; margin: 0 auto -20px; font-size: clamp(56px, 8vw, 88px); color: var(--violet); opacity: .35; line-height: 1; }
.story-quote-text { max-width: 32ch; margin: 0 auto; color: var(--text); font-size: clamp(18px, 2.4vw, 23px); line-height: 1.6; font-weight: 400; }
.story-quote-card::after { content: ""; display: block; width: 52px; height: 2px; margin: 26px auto 0; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }

.story-visuals-section { padding: 0 0 clamp(40px, 6vw, 70px); }
.story-visuals-wrap { width: min(1100px, calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.story-visual-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.story-visual-card img { width: 100%; display: block; }
.story-visual-label { padding: 12px 16px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }

.story-share { margin-top: 0; }
.story-files { width: min(1320px, calc(100% - 40px)); margin: 0 auto 80px; }
.story-files-details summary { cursor: pointer; padding: 16px 0; color: var(--muted); font-size: 12px; font-weight: 700; border-top: 1px solid var(--line); list-style: none; }
.story-files-details summary::-webkit-details-marker { display: none; }
.story-files-details summary::before { content: "＋ "; color: var(--violet); }
.story-files-details[open] summary::before { content: "－ "; }
.story-files-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; padding: 4px 0 20px; }
.story-files-grid a { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 12px; }
.story-files-grid a:hover { border-color: rgba(139, 127, 214, .4); color: var(--text); }

@media (max-width: 900px) {
  .story-owner-inner, .story-hero-inner, .story-quote-wrap, .story-visuals-wrap, .story-files { width: min(100% - 28px, var(--max)); }
  .story-hero-inner-split { grid-template-columns: 1fr; }
  .story-hero-map { max-width: 420px; }
}
@media (max-width: 560px) {
  .story-owner-inner, .story-hero-inner, .story-quote-wrap, .story-visuals-wrap, .story-files { width: calc(100% - 20px); }
  .story-hero-photo { min-height: 380px; }
  .story-title { font-size: 28px; }
}

.message-stack { position: fixed; top: 82px; right: 18px; z-index: 70; width: min(390px, calc(100vw - 36px)); }
.site-message { padding: 13px 15px; border: 1px solid var(--line); border-left: 2px solid var(--violet); background: #191f47; box-shadow: 0 16px 40px rgba(0,0,0,.35); font-size: 11px; }
.site-message.error { border-left-color: var(--danger); }
.site-footer { border-top: 1px solid var(--line); background: #080b22; }
.footer-inner { width: min(var(--max), calc(100% - 40px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; gap: 24px; color: var(--faint); font-size: 10px; }
.footer-inner > span { color: var(--text); font-weight: 800; }
.footer-inner p { margin: 0; }
.footer-inner nav { margin-left: auto; display: flex; gap: 16px; }
.footer-inner a:hover { color: var(--text); }

@media (max-width: 1180px) {
  .space-editor { grid-template-columns: minmax(0, 1fr) 390px; }
  .field-grid.three { grid-template-columns: 1fr 1fr; }
  .field-grid.three label:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .header-inner, .hero-inner, .editor-intro, .space-editor, .service-band, .result-head, .result-layout, .footer-inner, .share-section { width: min(100% - 28px, var(--max)); }
  .menu-button { display: block; }
  .header-nav {
    position: fixed;
    top: 68px;
    left: 14px;
    right: 14px;
    padding: 8px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    background: #12163a;
    box-shadow: 0 20px 44px rgba(0,0,0,.45);
  }
  .header-nav.is-open { display: flex; }
  .header-nav a { justify-content: center; }
  .hero { padding: 52px 0 40px; }
  .result-head h1 { font-size: 38px; }
  .space-editor { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .sky-workspace { position: static; height: auto; display: block; border-right: 0; border-bottom: 1px solid var(--line); }
  .sky-stage { height: 62vh; min-height: 500px; }
  .editor-inspector { height: auto; overflow: visible; }
  .service-band { grid-template-columns: 1fr; }
  .service-band > div { min-height: 132px; border-right: 0; border-bottom: 1px solid var(--line); }
  .service-band > div:last-child { border-bottom: 0; }
  .result-head { align-items: start; }
  .result-layout { grid-template-columns: 1fr; }
  .result-visual { border-right: 0; border-bottom: 1px solid var(--line); }
  .share-inner { grid-template-columns: 1fr; gap: 28px; }
  .share-qr-card { justify-items: start; }
  .share-qr-frame { max-width: 200px; }
  .home-hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .home-hero-stage { order: -1; }
  .home-shapes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .header-inner, .hero-inner, .editor-intro, .space-editor, .service-band, .result-head, .result-layout, .footer-inner, .share-section { width: calc(100% - 20px); }
  .brand { min-width: 0; }
  .brand img { width: 30px; height: 30px; }
  .hero { padding: 40px 0 30px; }
  .hero-lead { font-size: 14px; }
  .result-head h1 { font-size: 32px; }
  .home-note-inner, .home-shapes-head, .home-shapes-grid, .home-cta-inner { width: calc(100% - 20px); }
  .home-shapes { padding: 46px 0; }
  .home-shapes-head h2 { font-size: 24px; }
  .home-cta { padding: 50px 0 64px; }
  .stage-toolbar { min-height: 54px; padding: 8px; }
  .view-button { min-width: 72px; padding: 0 8px; }
  .icon-action { width: 34px; }
  .sky-stage { height: 56vh; min-height: 430px; }
  .stage-readout { left: 12px; bottom: 12px; }
  .accuracy-note { min-height: 64px; padding: 0 13px; }
  .accuracy-note small { line-height: 1.35; }
  .inspector-head { padding: 0 15px; }
  .control-section, .submit-area { padding-left: 15px; padding-right: 15px; }
  .field-grid.three { grid-template-columns: 1fr 1fr; }
  .style-options, .product-options { grid-template-columns: 1fr 1fr; }
  .result-head { padding-top: 34px; flex-direction: column; }
  .secondary-action { min-height: 42px; }
  .result-panel { padding: 22px 16px; }
  .result-panel dl div { grid-template-columns: 88px 1fr; }
  .share-section { padding: 30px 22px; }
  .share-title { font-size: 21px; }
  .footer-inner { padding: 18px 0; min-height: 0; flex-wrap: wrap; }
  .footer-inner nav { width: 100%; margin-left: 0; }
}

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