:root {
  --bg: #07111f;
  --bg-2: #0b1830;
  --surface: rgba(8, 18, 34, 0.72);
  --surface-strong: rgba(9, 22, 42, 0.9);
  --surface-soft: rgba(255, 247, 235, 0.08);
  --line: rgba(255, 231, 198, 0.16);
  --line-strong: rgba(255, 231, 198, 0.26);
  --text: #f6efe4;
  --muted: #cbbfae;
  --gold: #f4c97a;
  --gold-strong: #ffdd9f;
  --teal: #6fd5c5;
  --rose: #f0a998;
  --shadow: 0 30px 90px rgba(1, 6, 16, 0.42);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1220px;
  --heading-font: "Cormorant Garamond", Georgia, serif;
  --body-font: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--body-font);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(111, 213, 197, 0.12), transparent 22%),
    radial-gradient(circle at 80% 12%, rgba(240, 169, 152, 0.16), transparent 18%),
    radial-gradient(circle at 50% 90%, rgba(244, 201, 122, 0.1), transparent 28%),
    linear-gradient(180deg, #08111f 0%, #0a1730 45%, #07101d 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.8px),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.55) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 55% 70%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.7px),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.8px);
  background-size: 240px 240px, 320px 320px, 280px 280px, 360px 360px;
  opacity: 0.28;
  animation: driftStars 28s linear infinite;
}

body::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 201, 122, 0.08), transparent 28%),
    linear-gradient(180deg, transparent 0%, rgba(7, 17, 31, 0.2) 68%, rgba(7, 17, 31, 0.85) 100%);
}

.magic-stars-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.magic-star {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--star-size, 7px);
  height: var(--star-size, 7px);
  opacity: 0;
  transform: translate3d(var(--x-start, 0), var(--y-start, 0), 0) scale(0.55);
  background: var(--star-core, #fffef8);
  box-shadow: none;
  filter: none;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation: magicStarArc var(--star-duration, 4600ms) linear forwards;
  will-change: transform, opacity;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.cabinet-shell {
  width: min(calc(100% - 32px), 1320px);
}

.aurora {
  position: fixed;
  inset: auto;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  animation: floatBlob 18s ease-in-out infinite;
}

.aurora-one {
  top: -12rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(240, 169, 152, 0.52), transparent 60%);
}

.aurora-two {
  bottom: -10rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(111, 213, 197, 0.42), transparent 58%);
  animation-delay: -6s;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(56px) saturate(1.85);
  -webkit-backdrop-filter: blur(56px) saturate(1.85);
  background: rgba(7, 17, 31, 0.38);
  box-shadow:
    0 14px 40px rgba(3, 8, 18, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar.compact {
  position: relative;
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 248, 223, 0.96) 0 14%, rgba(244, 201, 122, 0.94) 15% 45%, rgba(244, 201, 122, 0.18) 46% 70%, transparent 71%),
    radial-gradient(circle at 60% 68%, rgba(111, 213, 197, 0.6), transparent 56%);
  box-shadow: 0 0 22px rgba(244, 201, 122, 0.28);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  color: rgba(246, 239, 228, 0.82);
  font-size: 0.94rem;
  transition: color 180ms ease;
}

.nav a:hover {
  color: var(--gold-strong);
}

.nav-cta {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(244, 201, 122, 0.34);
  background: rgba(244, 201, 122, 0.1);
}

.nav-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(246, 239, 228, 0.96);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-account-balance {
  color: rgba(246, 239, 228, 0.84);
  font-weight: 500;
}

.nav-account-logout {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(244, 201, 122, 0.42);
  background: rgba(7, 17, 31, 0.45);
  font-size: 0.75rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-toggle-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.section {
  margin-bottom: 26px;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
  min-height: clamp(520px, 74vh, 760px);
  padding-top: 6px;
}

.hero-copy,
.hero-stage,
.glass,
.story-card,
.process-card,
.future-stage,
.account-card,
.order-card,
.billing-card,
.support-panel,
.support-side,
.cabinet-hero,
.cabinet-sidebar {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 201, 122, 0.95));
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

h1 {
  margin-top: 18px;
  font-size: clamp(3.4rem, 7vw, 6.8rem);
}

.hero-title-main {
  font-size: clamp(2.38rem, 4.9vw, 4.76rem);
}

h2 {
  font-size: clamp(2.2rem, 4.8vw, 4.1rem);
}

h3 {
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
}

p {
  margin: 0;
  color: rgba(246, 239, 228, 0.8);
  line-height: 1.7;
}

.lead {
  margin-top: 20px;
  max-width: 44rem;
  font-size: 1.08rem;
}

.hero-actions,
.account-cta {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.button-primary {
  background: linear-gradient(135deg, #f7d59d, #f0a998);
  color: #24110d;
  box-shadow: 0 16px 40px rgba(240, 169, 152, 0.22);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: rgba(255, 247, 235, 0.07);
  color: var(--text);
}

.button-wide {
  width: 100%;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.hero-metrics article,
.trust-item,
.process-card,
.account-card,
.billing-card,
.order-card,
.support-side,
.summary-panel,
.builder-panel,
.future-stage,
.cabinet-hero,
.cabinet-sidebar,
.story-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 247, 235, 0.08), rgba(255, 247, 235, 0.04));
  box-shadow: var(--shadow);
}

.hero-metrics article {
  padding: 18px;
  border-radius: var(--radius-md);
}

.hero-metrics strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-strong);
  font-size: 1.65rem;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-stage {
  min-height: 640px;
}

.stage-card-main {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(5, 15, 30, 0.62);
  box-shadow: var(--shadow);
}

.stage-window {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 250, 218, 0.14), transparent 20%),
    linear-gradient(180deg, #173054 0%, #102643 38%, #0b1e38 62%, #0c1a26 100%);
}

.moon {
  position: absolute;
  top: 54px;
  left: 50%;
  width: 110px;
  height: 110px;
  margin-left: -55px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 241, 0.98), rgba(244, 201, 122, 0.86));
  box-shadow:
    0 0 30px rgba(255, 221, 159, 0.35),
    0 0 80px rgba(255, 221, 159, 0.18);
  animation: pulseMoon 5.5s ease-in-out infinite;
}

.mountain {
  position: absolute;
  inset: auto 0 0;
}

.mountain-back {
  height: 46%;
  background:
    radial-gradient(circle at 25% 110%, rgba(111, 213, 197, 0.14), transparent 34%),
    linear-gradient(180deg, transparent 0%, rgba(8, 25, 48, 0.16) 30%, rgba(12, 27, 45, 0.92) 100%);
  clip-path: polygon(0 100%, 0 70%, 18% 54%, 30% 63%, 48% 40%, 61% 57%, 76% 46%, 100% 70%, 100% 100%);
}

.mountain-front {
  height: 34%;
  background:
    linear-gradient(180deg, rgba(11, 26, 40, 0.24) 0%, rgba(7, 16, 29, 0.98) 100%),
    radial-gradient(circle at 70% 40%, rgba(244, 201, 122, 0.08), transparent 26%);
  clip-path: polygon(0 100%, 0 55%, 15% 44%, 28% 66%, 48% 48%, 61% 65%, 80% 38%, 100% 63%, 100% 100%);
}

.storybook-glow {
  position: absolute;
  inset: auto 12% 8% 12%;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 213, 197, 0.22), transparent 68%);
  filter: blur(8px);
}

.stage-meta {
  padding: 22px 8px 8px;
}

.stage-meta span,
.story-tag,
.floating-label,
.field-title,
.pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 7px 12px;
  border: 1px solid rgba(255, 231, 198, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.06);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stage-meta strong,
.future-meta strong {
  display: block;
  margin: 18px 0 12px;
  font-family: var(--heading-font);
  font-size: 2rem;
}

.floating-card {
  position: absolute;
  padding: 18px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 18, 34, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: bob 8s ease-in-out infinite;
}

.floating-card strong {
  display: block;
  margin: 12px 0 8px;
}

.floating-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.card-upload {
  top: 46px;
  left: -28px;
}

.card-story {
  right: -20px;
  top: 260px;
  animation-delay: -2.5s;
}

.card-future {
  bottom: 26px;
  left: 44px;
  animation-delay: -4.2s;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.trust-item {
  padding: 20px;
  border-radius: 22px;
}

.trust-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.trust-item strong {
  font-family: var(--heading-font);
  font-size: 1.65rem;
}

.section-heading {
  max-width: 54rem;
  margin-bottom: 24px;
}

.section-heading h2,
.section-heading p {
  margin-top: 16px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.generation-heading {
  max-width: none;
}

.generation-new-order-btn {
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 213, 197, 0.42);
  background: rgba(111, 213, 197, 0.12);
  color: #dff8f2;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.generation-new-order-btn[hidden] {
  display: none !important;
}

.generation-new-order-btn__icon {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1;
}

.generation-new-order-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 213, 197, 0.62);
  background: rgba(111, 213, 197, 0.2);
}

.generation-new-order-btn:focus-visible {
  outline: 2px solid rgba(111, 213, 197, 0.75);
  outline-offset: 2px;
}

.section-grid {
  padding-top: 30px;
}

.story-grid,
.process-grid,
.account-preview,
.order-grid,
.billing-grid {
  display: grid;
  gap: 16px;
}

.story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-card-link {
  display: block;
  color: inherit;
}

.story-card {
  overflow: hidden;
  border-radius: 28px;
  cursor: pointer;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.story-card:hover,
.story-card.active {
  transform: translateY(-4px);
  border-color: rgba(244, 201, 122, 0.34);
  box-shadow: 0 24px 70px rgba(2, 8, 18, 0.42);
}

.story-cover {
  position: relative;
  height: auto;
  aspect-ratio: 2 / 1;
  min-height: 220px;
  background-size: cover;
  background-position: center;
}

.story-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 13, 24, 0.02), rgba(6, 13, 24, 0.16) 68%, rgba(6, 13, 24, 0.34)),
    radial-gradient(circle at 14% 16%, rgba(255, 247, 235, 0.16), transparent 24%);
  pointer-events: none;
}

.story-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-moon {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 243, 207, 0.58), transparent 18%),
    linear-gradient(180deg, #17375f, #0c1f37 60%, #081621);
}

.cover-sea {
  background:
    radial-gradient(circle at 50% 18%, rgba(250, 220, 163, 0.34), transparent 22%),
    linear-gradient(180deg, #21657b, #11364a 58%, #0a1d29);
}

.cover-cloud {
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 247, 235, 0.3), transparent 18%),
    linear-gradient(180deg, #50688f, #30445f 56%, #162131);
}

.story-body {
  padding: 22px;
}

.story-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.story-title-row h3 {
  min-width: 0;
  margin: 0;
}

.story-title-row .story-tag {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}

.story-body p {
  margin-top: 12px;
}

.text-link {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-strong);
}

.process-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-card {
  min-height: 240px;
  padding: 26px;
  border-radius: 28px;
}

.process-card span:first-child {
  display: inline-block;
  color: rgba(244, 201, 122, 0.82);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.process-card h3 {
  margin: 20px 0 14px;
}

.builder-shell {
  padding: 36px;
  border: 1px solid rgba(255, 231, 198, 0.14);
  border-radius: 38px;
  background:
    radial-gradient(circle at 10% 10%, rgba(111, 213, 197, 0.12), transparent 18%),
    radial-gradient(circle at 92% 20%, rgba(240, 169, 152, 0.12), transparent 20%),
    rgba(6, 16, 31, 0.52);
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.glass,
.builder-panel,
.summary-panel,
.future-stage,
.account-card,
.support-panel,
.support-side,
.cabinet-hero,
.cabinet-sidebar,
.order-card,
.billing-card {
  padding: 24px;
  border-radius: 28px;
  backdrop-filter: blur(16px);
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.field span {
  color: rgba(246, 239, 228, 0.74);
  font-size: 0.92rem;
}

input[type="text"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 231, 198, 0.14);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 247, 235, 0.05);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 201, 122, 0.18);
  color: var(--text);
}

.upload-preview {
  overflow: hidden;
  min-height: 180px;
  margin-bottom: 18px;
  border: 1px dashed rgba(255, 231, 198, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 247, 235, 0.06), rgba(111, 213, 197, 0.08)),
    rgba(8, 18, 34, 0.6);
}

.upload-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.upload-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  text-align: center;
  gap: 8px;
}

.upload-placeholder span {
  color: var(--muted);
  font-size: 0.9rem;
}

.preset-group + .preset-group {
  margin-top: 18px;
}

.chip-row,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 231, 198, 0.16);
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.04);
  color: var(--text);
  line-height: 1.2;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.chip:hover,
.chip.active,
.quick-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 201, 122, 0.34);
  background: rgba(244, 201, 122, 0.1);
}

.gender-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gender-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 231, 198, 0.16);
  border-radius: 20px;
  background: rgba(255, 247, 235, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.gender-chip:hover:not(:disabled) {
  transform: translateY(-1px);
}

.gender-chip--girl:hover:not(:disabled) {
  border-color: rgba(255, 143, 193, 0.45);
  background: rgba(255, 143, 193, 0.08);
}

.gender-chip--boy:hover:not(:disabled) {
  border-color: rgba(41, 136, 255, 0.42);
  background: rgba(41, 136, 255, 0.08);
}

.gender-chip--girl.is-active {
  border-color: rgba(236, 72, 153, 0.55);
  background: rgba(255, 143, 193, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 143, 193, 0.16);
}

.gender-chip--boy.is-active {
  border-color: rgba(37, 99, 235, 0.52);
  background: rgba(41, 136, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(41, 136, 255, 0.14);
}

.gender-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gender-chip__icon {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
}

.gender-chip__icon--girl {
  background: #fceee6;
}

.gender-chip__icon--boy {
  background: #d4ebfa;
}

.gender-chip__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
}

.gender-chip.is-active .gender-chip__icon--girl {
  background: #fceee6;
}

.gender-chip.is-active .gender-chip__icon--boy {
  background: #d4ebfa;
}

.gender-chip__label {
  padding: 12px 14px 14px;
  font-size: 0.95rem;
  line-height: 1.1;
  text-align: center;
}

.style-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.style-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 231, 198, 0.16);
  border-radius: 14px;
  background: rgba(255, 247, 235, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.style-chip:hover:not(:disabled) {
  transform: translateY(-1px);
}

.style-chip--watercolor:hover:not(:disabled) {
  border-color: rgba(111, 213, 197, 0.45);
  background: rgba(111, 213, 197, 0.08);
}

.style-chip--pixar:hover:not(:disabled) {
  border-color: rgba(244, 201, 122, 0.45);
  background: rgba(244, 201, 122, 0.08);
}

.style-chip--watercolor.is-active {
  border-color: rgba(111, 213, 197, 0.62);
  background: rgba(111, 213, 197, 0.1);
  box-shadow: 0 0 0 2px rgba(111, 213, 197, 0.14);
}

.style-chip--pixar.is-active {
  border-color: rgba(244, 201, 122, 0.62);
  background: rgba(244, 201, 122, 0.1);
  box-shadow: 0 0 0 2px rgba(244, 201, 122, 0.14);
}

.style-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.photo-upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-dropzone {
  position: relative;
  display: grid;
  min-height: 196px;
  border: 2px dashed rgba(255, 231, 198, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 247, 235, 0.06), rgba(111, 213, 197, 0.08)),
    rgba(255, 247, 235, 0.03);
  cursor: pointer;
  overflow: hidden;
  outline: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.photo-dropzone:hover:not(.is-disabled) {
  transform: translateY(-1px);
  border-color: rgba(244, 201, 122, 0.38);
}

.photo-dropzone:focus-visible {
  box-shadow: 0 0 0 3px rgba(244, 201, 122, 0.24);
}

.photo-dropzone.is-dragover {
  border-color: rgba(244, 201, 122, 0.55);
  background:
    linear-gradient(135deg, rgba(244, 201, 122, 0.12), rgba(111, 213, 197, 0.12)),
    rgba(255, 247, 235, 0.08);
  box-shadow: 0 0 0 3px rgba(244, 201, 122, 0.16);
}

.photo-dropzone.is-filled {
  border-style: solid;
  border-color: rgba(244, 201, 122, 0.28);
}

.photo-dropzone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.photo-dropzone__empty,
.photo-dropzone__preview {
  grid-area: 1 / 1;
  min-height: inherit;
}

.photo-dropzone__empty {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: inherit;
  padding: 0;
  text-align: center;
}

.photo-dropzone__icon {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.photo-dropzone__icon img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photo-dropzone__copy {
  display: grid;
  gap: 8px;
  padding: 14px 16px 18px;
}

.photo-dropzone__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
}

.photo-dropzone__cta {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(246, 239, 228, 0.78);
}

.photo-dropzone__hint {
  max-width: 18rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(246, 239, 228, 0.58);
}

.photo-dropzone__preview {
  position: relative;
  display: grid;
}

.photo-dropzone__image {
  width: 100%;
  height: 100%;
  min-height: 196px;
  object-fit: cover;
}

.photo-dropzone__meta {
  position: absolute;
  inset: auto 0 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(8, 18, 34, 0), rgba(8, 18, 34, 0.88));
}

.photo-dropzone.is-filled .photo-dropzone__meta {
  display: flex;
}

.photo-dropzone__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 247, 235, 0.92);
}

.photo-dropzone__clear {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: #141b4d;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(8, 18, 34, 0.18);
}

.photo-dropzone.is-filled .photo-dropzone__clear:not([hidden]) {
  display: inline-flex;
}

.photo-dropzone__clear:hover {
  background: #fff;
}

@media (max-width: 760px) {
  .photo-upload-row {
    grid-template-columns: 1fr;
  }
}

.tier-grid {
  display: grid;
  gap: 10px;
}

.tier-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 231, 198, 0.16);
  border-radius: 22px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 247, 235, 0.05);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.tier-card.active {
  border-color: rgba(111, 213, 197, 0.42);
  background: rgba(111, 213, 197, 0.1);
}

.tier-card.upcoming {
  opacity: 0.7;
}

.summary-header h3 {
  margin-top: 14px;
}

.summary-price {
  display: grid;
  gap: 8px;
  margin: 28px 0 20px;
}

.summary-price strong {
  font-size: 2.2rem;
  color: var(--gold-strong);
}

.summary-price span {
  color: var(--muted);
}

.summary-list {
  padding-left: 18px;
  margin: 0;
  color: rgba(246, 239, 228, 0.82);
  line-height: 1.75;
}

.summary-list li + li {
  margin-top: 4px;
}

.progress-demo {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid rgba(255, 231, 198, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-line {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.08);
}

.progress-line span {
  display: block;
  width: var(--progress-width, 33%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fd5c5, #f4c97a, #f0a998);
  transition: width 320ms ease;
}

.progress-copy {
  margin-top: 14px;
  color: rgba(246, 239, 228, 0.76);
}

.note-card {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(111, 213, 197, 0.18);
  border-radius: 22px;
  background: rgba(111, 213, 197, 0.08);
}

.note-card strong {
  display: block;
  margin-bottom: 10px;
}

.future-section {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 18px;
  align-items: stretch;
}

.future-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) 1fr;
  gap: 20px;
  align-items: center;
}

.future-screen {
  position: relative;
  min-height: 320px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 247, 235, 0.18), transparent 24%),
    linear-gradient(135deg, #102743, #0c1a2c 62%, #08131f);
  overflow: hidden;
}

.future-screen::before,
.future-screen::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 50%;
}

.future-screen::before {
  width: 220px;
  height: 220px;
  top: 18%;
  left: 20%;
  background: radial-gradient(circle, rgba(111, 213, 197, 0.2), transparent 60%);
}

.future-screen::after {
  width: 280px;
  height: 120px;
  right: -40px;
  bottom: 12%;
  background: linear-gradient(180deg, rgba(244, 201, 122, 0.14), transparent);
  filter: blur(12px);
}

.future-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.9), rgba(244, 201, 122, 0.8)),
    rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 40px rgba(244, 201, 122, 0.2);
}

.future-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  margin: -12px 0 0 -8px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #0d2036;
}

.account-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-card {
  min-height: 280px;
}

.mini-list,
.payment-stack,
.chat-preview {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.mini-list span,
.payment-stack span,
.chat-preview span {
  padding: 14px 16px;
  border: 1px solid rgba(255, 231, 198, 0.12);
  border-radius: 18px;
  background: rgba(255, 247, 235, 0.04);
}

.footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 8px 8px;
  color: rgba(246, 239, 228, 0.72);
}

.footer strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
}

.footer-legal-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.footer-legal-links a {
  color: inherit;
  text-decoration: none;
  max-width: min(18rem, 100%);
}

.footer-start {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer-meta .footer-legal {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.72;
}

.footer-meta .footer-version {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.site-legal-footer:not(:has(.footer-start)) {
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.cabinet-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.cabinet-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.cabinet-side-nav {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.cabinet-side-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 231, 198, 0.12);
  color: rgba(246, 239, 228, 0.84);
  background: rgba(255, 247, 235, 0.03);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.cabinet-side-nav a.has-unread {
  border-color: rgba(255, 120, 100, 0.34);
  background: rgba(255, 120, 100, 0.08);
}

.cabinet-nav-unread-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b57;
  box-shadow: 0 0 0 3px rgba(255, 107, 87, 0.22);
}

.cabinet-side-nav a:hover {
  border-color: rgba(244, 201, 122, 0.28);
  background: rgba(244, 201, 122, 0.08);
  transform: translateX(1px);
}

.cabinet-side-nav a.is-active {
  border-color: rgba(111, 213, 197, 0.42);
  background: rgba(111, 213, 197, 0.12);
  color: var(--text);
}

.avatar-ring {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: #0d2036;
  background: linear-gradient(135deg, #f7d59d, #6fd5c5);
  font-weight: 800;
}

.sidebar-stat + .sidebar-stat,
.sidebar-roadmap {
  margin-top: 18px;
}

.sidebar-stat span,
.sidebar-roadmap p {
  display: block;
  color: var(--muted);
}

.sidebar-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.24rem;
}

.sidebar-roadmap h2 {
  margin: 14px 0 12px;
  font-size: 2.1rem;
}

.cabinet-main {
  display: grid;
  gap: 18px;
}

.cabinet-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.cabinet-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill.success {
  color: #8df0d4;
}

.pill.warn {
  color: #ffd991;
}

.dashboard-section {
  display: grid;
  gap: 14px;
}

.generation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.generation-result {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
}

body.theme-skazum .generation-result.glass {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.generation-stage-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.generation-stage-nav.is-loading {
  pointer-events: none;
}

.generation-stage-nav.is-loading .generation-stage-btn:not(.is-active) {
  opacity: 0.28;
}

.generation-stage-btn {
  border: 1px solid rgba(255, 231, 198, 0.18);
  background: rgba(255, 247, 235, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.generation-stage-btn.is-active {
  border-color: rgba(111, 213, 197, 0.46);
  background: rgba(111, 213, 197, 0.12);
}

.generation-stage-btn.is-locked,
.generation-stage-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.35);
  background: rgba(255, 247, 235, 0.025);
  border-color: rgba(255, 231, 198, 0.1);
  color: rgba(246, 239, 228, 0.5);
  pointer-events: none;
}

.generation-payment-hint {
  padding: 0;
}

body.theme-skazum .generation-payment-hint.glass {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.generation-payment-hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.generation-payment-hint p {
  margin: 0 0 8px;
}

.generation-payment-status {
  margin: 0 0 12px;
  padding: 0 4px;
}

.generation-payment-status.is-error {
  color: #ffb3aa;
}

.generation-payment-details {
  display: block;
  margin-top: 0;
}

.generation-payment-details[hidden] {
  display: none;
}

.generation-payment-card {
  overflow: hidden;
  padding: 18px 18px 0;
  border-radius: 28px;
  border: 1px solid rgba(24, 42, 136, 0.1);
  background: #fff;
  box-shadow: 0 20px 50px rgba(20, 27, 77, 0.08);
}

.generation-payment-formats {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.generation-payment-formats legend {
  margin: 0 0 10px;
  color: #141b4d;
  font-size: 1.05rem;
  font-weight: 900;
}

.generation-payment-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.generation-payment-format {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 12px 12px 16px;
  border-radius: 22px;
  border: 2px solid rgba(24, 42, 136, 0.1);
  background: #fbfaff;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 180ms ease,
    background 180ms ease;
}

.generation-payment-format input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.generation-payment-format:hover {
  transform: translateY(-2px);
  border-color: rgba(89, 33, 255, 0.28);
}

.generation-payment-format:active {
  transform: scale(0.985);
}

.generation-payment-format.is-active {
  border-color: #5921ff;
  background: #fff;
  box-shadow: 0 16px 32px rgba(89, 33, 255, 0.12);
}

.generation-payment-format.is-locked {
  cursor: default;
}

.generation-payment-format.is-locked:hover,
.generation-payment-format.is-locked:active {
  transform: none;
}

.generation-payment-format-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  height: 132px;
  border-radius: 16px;
}

.generation-payment-format-visual--pdf {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 46%),
    linear-gradient(160deg, #efe8ff 0%, #d9ecff 100%);
}

.generation-payment-format-visual--print {
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 245, 220, 0.9), transparent 42%),
    linear-gradient(160deg, #ffe7c2 0%, #ffd0b8 100%);
}

.generation-payment-format-visual img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
}

.generation-payment-format-visual--print img {
  max-width: 100%;
  max-height: 118%;
  object-fit: cover;
  object-position: center 40%;
}

.generation-payment-format-body {
  display: grid;
  gap: 4px;
  padding: 0 4px;
}

.generation-payment-format-kicker {
  color: #7a4dff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.generation-payment-format-body strong {
  color: #141b4d;
  font-size: 1.05rem;
  font-weight: 900;
}

.generation-payment-format-copy {
  color: #59617e;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.generation-payment-format-body b {
  margin-top: 6px;
  color: #141b4d;
  font-size: 1.2rem;
  font-weight: 900;
}

.print-upgrade-offer {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 153, 67, 0.28);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 214, 102, 0.42), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(255, 120, 162, 0.28), transparent 32%),
    linear-gradient(180deg, #fff8ec 0%, #fff 58%);
  box-shadow: 0 22px 48px rgba(176, 84, 18, 0.12);
}

.print-upgrade-offer-glow {
  position: absolute;
  inset: auto -40px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 64, 0.35), transparent 68%);
  pointer-events: none;
}

.print-upgrade-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ff7a1a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(255, 122, 26, 0.35);
}

.print-upgrade-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.print-upgrade-media {
  position: relative;
  min-height: 210px;
}

.print-upgrade-cover,
.print-upgrade-book {
  display: block;
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
}

.print-upgrade-cover {
  position: absolute;
  width: 46%;
  height: 58%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 12px 24px rgba(20, 27, 77, 0.18);
  transform: rotate(-8deg);
  left: 6%;
  top: 18%;
}

.print-upgrade-book {
  height: 210px;
  object-position: center 40%;
  box-shadow: 0 18px 32px rgba(176, 84, 18, 0.16);
}

.print-upgrade-kicker {
  margin: 0 0 6px;
  color: #c2410c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.print-upgrade-copy h3 {
  margin: 0;
  color: #141b4d;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 900;
  line-height: 1.15;
}

.print-upgrade-lead {
  margin: 8px 0 0;
  max-width: 42ch;
  color: #5c4633;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.print-upgrade-perks {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.print-upgrade-perks li {
  color: #3f2f22;
  font-size: 0.92rem;
  font-weight: 800;
}

.print-upgrade-perks li::before {
  content: '✦ ';
  color: #ff7a1a;
}

.print-upgrade-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
}

.print-upgrade-price strong {
  color: #141b4d;
  font-size: 1.7rem;
  font-weight: 900;
}

.print-upgrade-price span {
  color: #9a8474;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: line-through;
}

.print-upgrade-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  min-height: 52px;
  margin-top: 14px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff8a2a 0%, #ff6a12 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 106, 18, 0.28);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), filter 160ms ease;
}

.print-upgrade-cta:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.print-upgrade-cta:active {
  transform: scale(0.98);
}

.print-upgrade-note {
  margin: 10px 0 0;
  color: #8a7464;
  font-size: 0.82rem;
  font-weight: 700;
}

.generation-payment-hero-panel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 10 / 3;
  min-height: 0;
  padding: 33px 250px 33px 26px;
  border-radius: 22px;
  border: 1px solid rgba(122, 77, 255, 0.14);
  background-color: #f7f4ff;
  background-image:
    linear-gradient(90deg, rgba(247, 244, 255, 0.08) 0%, rgba(255, 255, 255, 0.32) 38%, rgba(255, 255, 255, 0.82) 52%, rgba(255, 255, 255, 0.96) 68%),
    url('/site/assets/payment-hero-bg.png?v=2');
  background-position: center, left top;
  background-size: 100% 100%, 100% auto;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 28px rgba(122, 77, 255, 0.08);
}

.generation-payment-hero-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.generation-payment-hero-panel.is-paid::after {
  background: linear-gradient(90deg, rgba(41, 216, 255, 0.05) 0%, rgba(41, 216, 255, 0.1) 100%);
}

.generation-payment-hero-panel.is-pending::after {
  background: linear-gradient(90deg, rgba(255, 183, 41, 0.05) 0%, rgba(255, 183, 41, 0.1) 100%);
}

.generation-payment-hero-panel.is-failed::after {
  background: linear-gradient(90deg, rgba(255, 75, 75, 0.05) 0%, rgba(255, 75, 75, 0.1) 100%);
}

.generation-payment-hero-main {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: min(100%, 340px);
  text-align: center;
}

.generation-payment-trust-list {
  position: absolute;
  top: 50%;
  right: 24px;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(240px, 30%);
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}

.generation-payment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 77, 255, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: #141b4d;
  font-size: 0.84rem;
  font-weight: 800;
}

.generation-payment-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #29d8ff;
  box-shadow: 0 0 0 3px rgba(41, 216, 255, 0.18);
}

.generation-payment-badge-dot.is-paid {
  background: #29d8ff;
}

.generation-payment-amount {
  margin: 12px 0 4px;
  color: #141b4d;
  font-size: clamp(2.4rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.generation-payment-bonus {
  margin: 0 0 4px;
  color: rgba(20, 27, 77, 0.52);
  font-size: 0.84rem;
}

.generation-payment-storyline {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 6px;
}

.generation-payment-story-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
}

.generation-payment-story-name {
  color: #7a4dff;
}

.generation-payment-story-sep {
  margin: 0 0.35em;
  color: rgba(20, 27, 77, 0.32);
  font-weight: 700;
}

.generation-payment-story-hero {
  color: #141b4d;
}

.generation-payment-story-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
}

.generation-payment-story-status.is-ready {
  border: 1px solid rgba(41, 216, 255, 0.32);
  background: rgba(41, 216, 255, 0.14);
  color: #0b6f94;
}

.generation-payment-story-status.is-pending {
  border: 1px solid rgba(255, 183, 41, 0.34);
  background: rgba(255, 183, 41, 0.16);
  color: #9a6200;
}

.generation-payment-story-status.is-unpaid {
  border: 1px solid rgba(122, 77, 255, 0.24);
  background: rgba(122, 77, 255, 0.1);
  color: #5c2fe6;
}

.generation-payment-story-status.is-failed {
  border: 1px solid rgba(255, 75, 75, 0.28);
  background: rgba(255, 75, 75, 0.1);
  color: #c12b2b;
}

.generation-payment-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.generation-payment-trust-list img,
.generation-payment-yookassa-mark {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.generation-payment-yookassa-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #0070f0 0%, #0057c2 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 900;
}

.generation-payment-trust-list strong {
  display: block;
  color: #141b4d;
  font-size: 0.88rem;
  line-height: 1.25;
}

.generation-payment-trust-list span {
  display: block;
  margin-top: 2px;
  color: rgba(20, 27, 77, 0.52);
  font-size: 0.78rem;
  line-height: 1.35;
}

.generation-payment-action {
  display: grid;
  gap: 14px;
  padding: 22px 10px 22px;
}

.generation-payment-cta-row {
  display: grid;
  gap: 10px;
}

.generation-payment-pay-btn--free-credit {
  border-color: rgba(111, 213, 197, 0.5);
  background: rgba(111, 213, 197, 0.14);
}

.generation-payment-free-credit-badge {
  margin-left: 0.45rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
}

.generation-payment-pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a4dff 0%, #ff4bc3 48%, #ffb729 78%, #29d8ff 100%);
  box-shadow: 0 10px 24px rgba(122, 77, 255, 0.22);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.generation-payment-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(122, 77, 255, 0.28);
}

.generation-payment-pay-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.generation-payment-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 24px;
}

.generation-payment-trust-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.generation-payment-trust-logo--pci {
  height: 32px;
}

.generation-payment-trust-logo--ssl {
  height: 36px;
}

.generation-payment-trust-logo--yookassa {
  height: 24px;
}

.generation-payment-secure-note {
  margin: 0;
  text-align: center;
  color: rgba(20, 27, 77, 0.48);
  font-size: 0.82rem;
  line-height: 1.4;
}

.generation-payment-secondary {
  display: flex;
  justify-content: center;
}

.generation-payment-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(20, 27, 77, 0.58);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(20, 27, 77, 0.22);
  text-underline-offset: 3px;
  cursor: pointer;
}

.generation-payment-link:hover {
  color: #7a4dff;
  text-decoration-color: rgba(122, 77, 255, 0.35);
}

.generation-payment-meta {
  padding: 0 28px 18px;
  border-top: 0;
}

.generation-payment-meta summary {
  cursor: pointer;
  color: rgba(20, 27, 77, 0.52);
  font-size: 0.84rem;
  font-weight: 700;
  user-select: none;
}

.generation-payment-meta summary:hover {
  color: #141b4d;
}

.generation-payment-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 12px 0 0;
}

.generation-payment-meta-list div {
  min-width: 0;
}

.generation-payment-meta-list dt {
  margin: 0;
  color: rgba(20, 27, 77, 0.48);
  font-size: 0.78rem;
}

.generation-payment-meta-list dd {
  margin: 4px 0 0;
  color: #141b4d;
  font-size: 0.92rem;
  font-weight: 700;
}

.generation-payment-empty {
  padding: 36px 24px;
  text-align: center;
}

.generation-payment-empty-title {
  margin: 0 0 6px;
  color: #141b4d;
  font-size: 1.02rem;
  font-weight: 800;
}

.generation-payment-empty-text {
  margin: 0;
  color: rgba(20, 27, 77, 0.58);
  font-size: 0.9rem;
  line-height: 1.45;
}

.generation-payment-mock-hint {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 12px 28px;
  border-top: 1px solid rgba(255, 183, 41, 0.22);
  background: #fff8e6;
  color: rgba(20, 27, 77, 0.68);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
}

.generation-payment-mock-hint img {
  flex: 0 0 18px;
  margin-top: 1px;
}

.generation-result-panel {
  display: grid;
  gap: 14px;
}

#genResultStatus:empty {
  display: none;
}

.generation-result-card {
  overflow: hidden;
  padding: 18px 18px 0;
  border-radius: 28px;
  border: 1px solid rgba(24, 42, 136, 0.1);
  background: #fff;
  box-shadow: 0 20px 50px rgba(20, 27, 77, 0.08);
}

.generation-result-hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 228px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(122, 77, 255, 0.14);
  background-color: #f7f4ff;
  background-image:
    linear-gradient(90deg, rgba(247, 244, 255, 0.08) 0%, rgba(255, 255, 255, 0.32) 38%, rgba(255, 255, 255, 0.82) 52%, rgba(255, 255, 255, 0.96) 68%),
    url('/site/assets/payment-hero-bg.png?v=2');
  background-position: center, left center;
  background-size: 100% 100%, cover;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 28px rgba(122, 77, 255, 0.08);
}

.generation-result-hero-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(111, 213, 197, 0.05) 0%, rgba(122, 77, 255, 0.08) 100%);
}

.generation-result-hero-main {
  position: absolute;
  top: 50%;
  right: 28px;
  z-index: 1;
  transform: translateY(-50%);
  display: grid;
  gap: 10px;
  width: min(390px, 46%);
  text-align: left;
}

.generation-result-hero-eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #7a4dff;
}

.generation-result-hero-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.12;
  font-weight: 900;
  color: #141b4d;
}

.generation-result-hero-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
  color: #59617e;
}

.generation-result-hero-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
  color: #7a4dff;
}

.generation-result-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.generation-result-status-pill.is-complete {
  color: #0f7a58;
  background: rgba(111, 213, 197, 0.18);
  border: 1px solid rgba(111, 213, 197, 0.42);
}

.generation-result-status-pill.is-finished {
  color: #6b4dff;
  background: rgba(122, 77, 255, 0.1);
  border: 1px solid rgba(122, 77, 255, 0.22);
}

.generation-result-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.generation-result-product-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px 20px;
  align-items: center;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(24, 42, 136, 0.08);
  background: linear-gradient(180deg, rgba(247, 244, 255, 0.72) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.generation-result-product-cover {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #ede8ff 0%, #fff7eb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.generation-result-product-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generation-result-product-cover-fallback {
  font-size: 34px;
  line-height: 1;
}

.generation-result-product-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.generation-result-product-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
  color: #141b4d;
}

.generation-result-product-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.generation-result-product-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.generation-result-product-list span {
  color: #7b839f;
  font-weight: 700;
  min-width: 72px;
}

.generation-result-product-list strong {
  color: #2a3158;
  font-weight: 800;
}

.generation-result-actions {
  padding: 10px 0 24px;
}

.generation-result-product-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-self: end;
  align-self: center;
}

.generation-result-product-actions.is-hidden {
  display: none;
}

.generation-result-download-btn.is-hidden {
  display: none;
}

.generation-result-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  min-width: 196px;
  padding: 0 28px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #7a4dff 0%, #5921ff 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 32px rgba(89, 33, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}

.generation-result-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(89, 33, 255, 0.32);
  color: #fff;
}

.generation-result-download-btn span {
  color: #fff;
}

.generation-result-download-btn img {
  flex: 0 0 24px;
}

.generation-result-download-btn.is-loading,
.generation-result-copy-btn.is-loading,
.order-list-action-btn.is-loading {
  pointer-events: none;
  cursor: wait;
}

.generation-result-download-btn.is-loading img,
.generation-result-copy-btn.is-loading .generation-result-copy-btn__icon,
.order-list-action-btn.is-loading .order-list-action-icon {
  display: none;
}

.generation-result-download-btn.is-loading::before,
.generation-result-copy-btn.is-loading::before,
.order-list-action-btn.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pdf-download-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.generation-result-copy-btn.is-loading::before,
.order-list-action-btn.is-loading::before {
  border-color: rgba(122, 77, 255, 0.2);
  border-top-color: #7a4dff;
}

@keyframes pdf-download-spin {
  to {
    transform: rotate(360deg);
  }
}

.generation-result-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  min-width: 196px;
  padding: 0 28px;
  border: 1px solid rgba(24, 42, 136, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #141b4d;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(20, 27, 77, 0.06);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}

.generation-result-copy-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 77, 255, 0.24);
  background: rgba(247, 244, 255, 0.96);
  color: #5921ff;
  box-shadow: 0 12px 24px rgba(89, 33, 255, 0.1);
}

.generation-result-copy-btn:hover .generation-result-copy-btn__icon {
  color: #5921ff;
}

.generation-result-copy-btn__icon {
  flex: 0 0 24px;
  color: #7a4dff;
}

.generation-result-copy-btn span {
  color: inherit;
}

a.generation-result-copy-btn:visited {
  color: #141b4d;
}

.generation-result-print-guide {
  padding: 6px 18px 14px;
  border-top: 1px solid rgba(24, 42, 136, 0.06);
}

.generation-result-print-guide summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0;
  color: rgba(20, 27, 77, 0.52);
  font-size: 0.84rem;
  font-weight: 700;
  user-select: none;
  list-style: none;
}

.generation-result-print-guide summary::-webkit-details-marker {
  display: none;
}

.generation-result-print-guide summary::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin-right: 2px;
  border-right: 2px solid rgba(20, 27, 77, 0.42);
  border-bottom: 2px solid rgba(20, 27, 77, 0.42);
  transform: rotate(45deg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.generation-result-print-guide summary:hover {
  color: #141b4d;
}

.generation-result-print-guide summary:hover::after {
  border-color: rgba(20, 27, 77, 0.72);
}

.generation-result-print-guide[open] summary::after {
  transform: rotate(225deg);
}

.generation-result-print-guide-body {
  margin: 0 0 8px;
  padding-bottom: 8px;
}

.generation-result-print-guide-body ol {
  margin: 0;
  padding-left: 1.15rem;
  color: #2a3158;
  font-size: 0.88rem;
  line-height: 1.55;
}

.generation-result-print-guide-body li + li {
  margin-top: 8px;
}

.generation-result-print-guide-body strong {
  font-weight: 800;
}

.generation-result-print-guide-note {
  margin: 12px 0 0;
  color: rgba(20, 27, 77, 0.56);
  font-size: 0.82rem;
  line-height: 1.45;
}

.generation-result-block.is-hidden {
  display: none;
}

.generation-result-block .generation-form-actions {
  margin-top: 16px;
}

.generation-book-delivery {
  margin-top: 16px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(24, 42, 136, 0.1);
  background: #fff;
  box-shadow: 0 20px 50px rgba(20, 27, 77, 0.08);
}

.generation-book-delivery-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: end;
  margin-bottom: 18px;
}

.generation-book-delivery-copy h3 {
  margin: 0;
  color: #141b4d;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 900;
  line-height: 1.15;
}

.generation-book-delivery-copy p {
  margin: 8px 0 0;
  max-width: 46ch;
  color: #59617e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.generation-book-delivery-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: #f4f1ff;
}

.generation-book-delivery-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  color: #4d5578;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1), color 180ms ease, transform 160ms ease;
}

.generation-book-delivery-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.generation-book-delivery-choice.is-active {
  background: #fff;
  color: #5921ff;
  box-shadow: 0 8px 18px rgba(89, 33, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .generation-book-delivery-choice:hover {
    color: #141b4d;
  }
}

.generation-book-delivery-choice:active {
  transform: scale(0.97);
}

.cdek-delivery {
  display: grid;
  gap: 14px;
}

.cdek-delivery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.cdek-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #59617e;
  font-size: 13px;
  font-weight: 700;
}

.cdek-brand-mark {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #1aaa5a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.cdek-quote {
  margin: 0;
  color: #7a4dff;
  font-size: 14px;
  font-weight: 800;
}

.cdek-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cdek-mode {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 42, 136, 0.1);
  border-radius: 18px;
  background: #fbfaff;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 180ms ease;
}

.cdek-mode input {
  position: absolute;
  opacity: 0;
}

.cdek-mode strong,
.cdek-mode span {
  display: block;
}

.cdek-mode strong {
  color: #141b4d;
  font-size: 15px;
  font-weight: 900;
}

.cdek-mode span {
  color: #7b839f;
  font-size: 13px;
  font-weight: 700;
}

.cdek-mode.is-active {
  border-color: rgba(122, 77, 255, 0.38);
  background: linear-gradient(180deg, rgba(247, 244, 255, 0.96) 0%, #fff 100%);
  box-shadow: 0 12px 24px rgba(89, 33, 255, 0.08);
}

.cdek-mode:active {
  transform: scale(0.985);
}

.cdek-city-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.cdek-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.cdek-field span {
  color: #4d5578;
  font-size: 13px;
  font-weight: 800;
}

.cdek-delivery input[type="text"],
.cdek-delivery textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 42, 136, 0.12);
  border-radius: 16px;
  background: #fff;
  color: #141b4d;
  font: inherit;
  font-weight: 700;
}

.cdek-delivery input[type="text"]:focus,
.cdek-delivery textarea:focus {
  border-color: rgba(122, 77, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(122, 77, 255, 0.12);
}

.cdek-city-field {
  position: relative;
}

.cdek-city-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  display: grid;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(24, 42, 136, 0.1);
  background: #fff;
  box-shadow: 0 18px 40px rgba(20, 27, 77, 0.14);
}

.cdek-city-menu[hidden] {
  display: none;
}

.cdek-city-option {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.cdek-city-option + .cdek-city-option {
  border-top: 1px solid rgba(24, 42, 136, 0.06);
}

.cdek-city-option strong {
  color: #141b4d;
  font-size: 14px;
}

.cdek-city-option span {
  color: #7b839f;
  font-size: 12px;
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .cdek-city-option:hover {
    background: #f7f4ff;
  }
}

.cdek-city-option.is-muted {
  cursor: default;
  color: #7b839f;
}

.cdek-geo-btn {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(24, 42, 136, 0.12);
  border-radius: 16px;
  background: #fff;
  color: #141b4d;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 180ms ease, color 180ms ease;
}

.cdek-geo-btn:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .cdek-geo-btn:hover {
    border-color: rgba(122, 77, 255, 0.28);
    color: #5921ff;
  }
}

.cdek-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 12px;
  min-height: 420px;
}

.cdek-map-layout.is-courier {
  display: none;
}

.cdek-map-pane,
.cdek-office-pane {
  min-height: 0;
  border-radius: 22px;
  border: 1px solid rgba(24, 42, 136, 0.08);
  background: #f8f6ff;
  overflow: hidden;
}

.cdek-map-pane {
  position: relative;
}

.cdek-map-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #141b4d;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(20, 27, 77, 0.1);
}

.cdek-map {
  height: 420px;
  width: 100%;
}

.cdek-office-pane {
  display: grid;
  min-height: 0;
}

.cdek-office-list {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0;
  height: 420px;
  max-height: 420px;
}

.cdek-office-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(24, 42, 136, 0.06);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease;
}

.cdek-office-item-top strong,
.cdek-office-item > span:not(.cdek-office-item-top),
.cdek-office-item small {
  display: block;
}

.cdek-office-item strong {
  color: #141b4d;
  font-size: 14px;
  font-weight: 900;
}

.cdek-office-item > span:not(.cdek-office-item-top) {
  color: #2a3158;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.cdek-office-item small {
  color: #7b839f;
  font-size: 12px;
}

.cdek-office-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cdek-office-item-top strong {
  min-width: 0;
}

.cdek-office-picked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #5921ff;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.cdek-office-item.is-selected {
  background: rgba(122, 77, 255, 0.1);
}

.cdek-office-empty {
  margin: 0;
  padding: 22px 16px;
  color: #7b839f;
  font-size: 14px;
  line-height: 1.45;
}

.cdek-courier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cdek-courier-grid.is-hidden {
  display: none;
}

.cdek-delivery-footer {
  display: flex;
  justify-content: flex-end;
}

.cdek-delivery-footer .generation-result-download-btn {
  min-width: 220px;
}

.leaflet-container,
.cdek-map .ymaps-2-1-79-map {
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .generation-book-delivery-choice,
  .cdek-mode,
  .cdek-geo-btn {
    transition: none;
  }
}

.referral-actions,
.billing-card .generation-form-actions {
  margin-top: auto;
  padding-top: 22px;
}

.generation-story-pick {
  padding: 18px;
}

.generation-story-pick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.generation-story-pick-head strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.generation-story-pick-lead {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.generation-story-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
  align-items: stretch;
}

.generation-story-pick-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  border: 1px solid rgba(255, 231, 198, 0.16);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.35);
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.generation-story-pick-card:hover {
  border-color: rgba(111, 213, 197, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.generation-story-pick-card.is-selected {
  border-color: rgba(111, 213, 197, 0.65);
  box-shadow: 0 0 0 1px rgba(111, 213, 197, 0.35);
}

.generation-story-pick-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.generation-story-pick-card-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.generation-story-pick-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.generation-story-pick-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
  gap: 6px;
}

.generation-story-pick-card-body h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  color: rgba(248, 247, 255, 0.96);
}

.generation-story-pick-card-body p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.generation-story-pick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.generation-story-pick-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(111, 213, 197, 0.12);
  border: 1px solid rgba(111, 213, 197, 0.22);
  color: #6fd5c5;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.generation-story-pick-tag--style {
  background: rgba(244, 201, 122, 0.12);
  border-color: rgba(244, 201, 122, 0.24);
  color: #e8b45a;
}

.generation-story-pick-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.generation-story-pick-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.generation-consents {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 6px;
}

.generation-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.generation-consent input {
  margin-top: 4px;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #6fd5c5;
}

.generation-consent a,
.generation-consent-policy-link {
  color: #6fd5c5;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.generation-consent a:hover,
.generation-consent-policy-link:hover {
  color: #9ae8dc;
}

.generation-consent-hint {
  margin: 4px 0 0;
  color: rgba(255, 179, 170, 0.95);
  font-size: 0.88rem;
  line-height: 1.4;
}

.generation-consent-hint[hidden] {
  display: none;
}

.privacy-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1rem;
}

#generation.is-booting .generation-stage-panel {
  display: none !important;
}

.generation-boot-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 36px 24px;
  border-radius: 24px;
  border: 1px solid rgba(122, 77, 255, 0.14);
  background:
    radial-gradient(circle at 50% 0%, rgba(122, 77, 255, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 48px rgba(122, 77, 255, 0.08);
  text-align: center;
}

#generation.is-booting .generation-boot-panel {
  display: flex;
}

.generation-boot-panel__spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(122, 77, 255, 0.16);
  border-top-color: #7a4dff;
  border-right-color: #29d8ff;
  border-radius: 50%;
  animation: payment-return-spin 0.85s linear infinite;
}

.generation-boot-panel__title {
  margin: 6px 0 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #5921ff;
}

.generation-boot-panel__hint {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.generation-stage-panel {
  display: none !important;
  pointer-events: none;
  overflow: hidden;
}

.generation-stage-panel.is-active {
  display: block !important;
  pointer-events: auto;
  overflow: hidden;
}

.generation-form.is-active,
.generation-portrait-panel.is-active,
.generation-progress.is-active {
  min-height: 250px;
}

.generation-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.generation-form-actions--primary {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  margin-top: 20px;
}

.generation-form-actions--primary #genAnchorBtn {
  width: 100%;
}

.generation-form-actions--primary #genAnchorBtn[hidden] {
  display: none !important;
}

#genAnchorBtn.is-loading,
.generation-variant-regen.is-loading {
  pointer-events: none;
  cursor: wait;
  opacity: 1;
}

#genAnchorBtn.is-loading:disabled,
.generation-variant-regen.is-loading:disabled {
  opacity: 1;
}

#genAnchorBtn.is-loading::before,
.generation-variant-regen.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: pdf-download-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.generation-variant-regen.is-loading::before {
  border-color: rgba(122, 77, 255, 0.2);
  border-top-color: #7a4dff;
}

.generation-form-actions--primary #genStartBtn {
  width: auto;
}

.generation-form-actions--primary.generation-form-actions--next #genStartBtn {
  width: 100%;
}

.generation-form-actions--primary #genStartBtn[hidden] {
  display: none !important;
}

.gen-selected-anchor {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.gen-status {
  margin-top: 12px;
  color: var(--muted);
  min-height: 1.2rem;
}

.generation-payment-mock-hint code {
  font-size: 0.84em;
}

.generation-variants {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.generation-portrait-panel .generation-variants {
  margin-top: 16px;
  grid-template-columns: 1fr;
  width: 100%;
}

.generation-portrait-panel .generation-variants:empty {
  margin-top: 0;
}

.generation-stage-footer--portrait-variants .generation-stage-footer__primary .button-primary {
  min-width: min(100%, 240px);
}

.generation-portrait-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.generation-portrait-head strong {
  font-size: 1.02rem;
  line-height: 1.25;
}

.generation-portrait-quota {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 231, 198, 0.16);
  background: rgba(255, 247, 235, 0.05);
  color: rgba(246, 239, 228, 0.72);
  white-space: nowrap;
}

.generation-portrait-quota__value {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.generation-portrait-quota__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--muted);
}

.generation-portrait-quota.is-loading {
  border-color: rgba(255, 201, 120, 0.28);
  background: rgba(255, 201, 120, 0.08);
}

.generation-portrait-quota.is-loading .generation-portrait-quota__value {
  color: rgba(255, 201, 120, 0.98);
}

.generation-portrait-quota.is-full {
  border-color: rgba(111, 213, 197, 0.28);
  background: rgba(111, 213, 197, 0.08);
}

.generation-portrait-quota.is-full .generation-portrait-quota__value {
  color: rgba(111, 213, 197, 0.98);
}

.generation-prior-portraits {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generation-prior-portraits__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.generation-prior-portraits__head strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.generation-prior-portraits__hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.generation-prior-portraits__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.generation-prior-portrait {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 2px solid rgba(255, 231, 198, 0.14);
  border-radius: 16px;
  background: rgba(255, 247, 235, 0.04);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.generation-prior-portrait:hover {
  border-color: rgba(255, 201, 120, 0.4);
  transform: translateY(-1px);
}

.generation-prior-portrait.is-selected {
  border-color: rgba(111, 213, 197, 0.7);
  background: rgba(111, 213, 197, 0.08);
}

.generation-prior-portrait.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.generation-prior-portrait--skeleton {
  cursor: default;
  pointer-events: none;
}

.generation-prior-portrait--skeleton .generation-prior-portrait__media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.generation-prior-portrait--skeleton .generation-prior-portrait__media img {
  opacity: 0.45;
  filter: grayscale(0.2);
}

.generation-prior-portrait--skeleton .generation-variant-skeleton-spinner {
  /* Center with inset/margin — not transform. Spin keyframes also use transform
     and would otherwise overwrite translate(-50%, -50%), making the spinner jump. */
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  z-index: 2;
}

.generation-prior-portrait__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

.generation-prior-portrait__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.generation-prior-portrait__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.generation-prior-portrait__name {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-prior-portrait__story {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-prior-portrait__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(111, 213, 197, 0.95);
  color: #03261f;
  font-size: 13px;
  font-weight: 900;
}

.generation-prior-portrait.is-selected .generation-prior-portrait__check {
  display: flex;
}

.generation-variant--external {
  border-color: rgba(111, 213, 197, 0.55);
  background: rgba(111, 213, 197, 0.06);
}

.generation-variant-more-slot:empty {
  display: none;
}

.generation-portrait-panel .generation-variant {
  width: 100%;
}

.generation-progress {
  grid-column: 1 / -1;
}

.generation-variant {
  border: 2px solid rgba(255, 231, 198, 0.14);
  border-radius: 18px;
  background: rgba(255, 247, 235, 0.04);
  overflow: hidden;
  display: grid;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.generation-variant:hover:not(.generation-variant-skeleton) {
  border-color: rgba(111, 213, 197, 0.34);
  transform: translateY(-1px);
}

.generation-variant.is-selected {
  border-color: rgba(111, 213, 197, 0.72);
  background: rgba(111, 213, 197, 0.06);
  box-shadow:
    0 0 0 3px rgba(111, 213, 197, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.14);
}

.generation-variant-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 231, 198, 0.1);
}

.generation-variant-radio {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 231, 198, 0.34);
  background: rgba(255, 247, 235, 0.04);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.generation-variant.is-selected .generation-variant-radio {
  border-color: rgba(111, 213, 197, 0.95);
  background: rgba(111, 213, 197, 0.95);
  box-shadow: inset 0 0 0 3px rgba(7, 17, 31, 0.92);
}

.generation-variant-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}

.generation-variant-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(111, 213, 197, 0.16);
  color: rgba(111, 213, 197, 0.98);
}

.generation-variant-badge--loading {
  background: rgba(255, 201, 120, 0.14);
  color: rgba(255, 201, 120, 0.96);
}

.generation-variant-ref {
  position: relative;
  margin: 0;
  min-width: 0;
}

.generation-variant-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 231, 198, 0.18);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.72);
  color: rgba(246, 239, 228, 0.92);
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.88;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

@media (hover: hover) {
  .generation-variant-zoom {
    opacity: 0;
    transform: translateY(2px);
  }

  .generation-variant:hover .generation-variant-zoom,
  .generation-variant:focus-within .generation-variant-zoom {
    opacity: 1;
    transform: translateY(0);
  }
}

.generation-variant-zoom:hover {
  border-color: rgba(111, 213, 197, 0.45);
  background: rgba(7, 17, 31, 0.88);
}

.generation-variant-skeleton {
  cursor: default;
  pointer-events: none;
  border-style: dashed;
  border-color: rgba(255, 201, 120, 0.28);
  background: rgba(255, 201, 120, 0.04);
  box-shadow: none;
}

.generation-variant-skeleton-block {
  aspect-ratio: 3 / 4;
  min-height: 220px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(255, 247, 235, 0.04) 0%,
    rgba(255, 247, 235, 0.12) 48%,
    rgba(255, 247, 235, 0.04) 100%
  );
  background-size: 220% 100%;
  animation: generation-variant-shimmer 1.35s ease-in-out infinite;
}

.generation-variant-skeleton-note {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.generation-variant-skeleton-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 201, 120, 0.22);
  border-top-color: rgba(255, 201, 120, 0.95);
  border-radius: 50%;
  animation: payment-return-spin 0.9s linear infinite;
}

.generation-variant-more {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.generation-variant-more-error {
  margin: 0;
  max-width: 36rem;
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #ffb3aa;
}

.generation-variant-regen {
  border: 1px dashed rgba(111, 213, 197, 0.34);
  background: rgba(111, 213, 197, 0.08);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  color: rgba(246, 239, 228, 0.92);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.generation-variant-regen:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(111, 213, 197, 0.58);
  background: rgba(111, 213, 197, 0.14);
  color: rgba(111, 213, 197, 0.98);
}

.generation-variant-regen:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes generation-variant-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.generation-variant-media {
  position: relative;
}

.generation-variant-media--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 10px 0;
}

.generation-variant-media--dual > .generation-variant-ref {
  position: relative;
  z-index: 1;
}

.generation-variant-media--dual > .generation-portrait-watermark {
  z-index: 2;
}

.generation-portrait-panel .generation-variant img {
  min-height: 280px;
  max-height: min(52vh, 520px);
}

.generation-portrait-panel .generation-variant-skeleton-block {
  min-height: 280px;
  max-height: min(52vh, 520px);
}

.generation-variant-ref figcaption {
  margin: 6px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, rgba(255, 245, 230, 0.55));
  text-align: center;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted, rgba(255, 245, 230, 0.62));
}

.generation-variant img {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 340px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.generation-portrait-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
  color: rgba(255, 245, 230, 0.58);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 2px 24px rgba(3, 8, 18, 0.75);
  backdrop-filter: saturate(0.92);
  transform: rotate(-24deg);
  z-index: 2;
}

.generation-portrait-watermark::before {
  content: '';
  position: absolute;
  inset: 14% 6%;
  border-radius: 24px;
  background:
    repeating-linear-gradient(
      -24deg,
      rgba(255, 255, 255, 0.02) 0 18px,
      rgba(255, 255, 255, 0.08) 18px 36px
    );
  opacity: 0.55;
  z-index: -1;
}

.generation-portrait-watermark--zoom {
  font-size: clamp(1.4rem, 2.4vw, 2.4rem);
  letter-spacing: 0.22em;
}

.generation-pages-stage-actions {
  margin-top: 16px;
}

.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(246, 239, 228, 0.78);
  font-weight: 600;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 247, 235, 0.06);
  border-color: rgba(255, 231, 198, 0.14);
}

.button-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.generation-stage-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 231, 198, 0.12);
}

.generation-stage-footer__secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.generation-stage-footer__primary {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.generation-stage-footer__primary .button-primary {
  width: auto;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
}

.generation-stage-footer__primary .button-primary + .button-primary[hidden],
.generation-stage-footer__primary .button-primary[hidden] + .button-primary {
  width: auto;
  max-width: 100%;
}

.generation-stage-footer--portrait .generation-stage-footer__primary .button-primary {
  min-width: 0;
}

.generation-progress.is-active {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 0;
  overflow: hidden;
}

.gen-preview-studio {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 18px;
  padding: 20px 20px 18px;
}

.gen-preview-studio__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.gen-preview-studio__status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gen-preview-studio__ring {
  --gen-progress: 0;
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 58%, transparent 59%),
    conic-gradient(
      #7a4dff 0 calc(var(--gen-progress) * 1%),
      rgba(122, 77, 255, 0.14) calc(var(--gen-progress) * 1%) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(122, 77, 255, 0.12),
    0 8px 24px rgba(122, 77, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
  color: #5921ff;
}

.gen-preview-studio__copy {
  min-width: 0;
}

.gen-preview-studio__eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(122, 77, 255, 0.72);
}

.gen-preview-studio__step {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: rgba(20, 27, 77, 0.78);
}

.gen-preview-studio__metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
}

.gen-preview-studio__count {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.gen-preview-studio__metric-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.gen-preview-studio__track {
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: rgba(122, 77, 255, 0.1);
}

.gen-preview-studio__track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a4dff, #ff4bc3 52%, #29d8ff);
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.gen-preview-studio__track span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 100%
  );
  transform: translateX(-120%);
  opacity: 0;
}

.gen-preview-studio.is-generating .gen-preview-studio__track {
  height: 6px;
  background: rgba(122, 77, 255, 0.16);
  box-shadow: 0 0 18px rgba(122, 77, 255, 0.22);
}

.gen-preview-studio.is-generating .gen-preview-studio__track span {
  background: linear-gradient(90deg, #5921ff, #7a4dff 28%, #ff4bc3 58%, #29d8ff 82%, #5921ff);
  background-size: 220% 100%;
  animation: gen-progress-flow 1.8s linear infinite;
  box-shadow: 0 0 16px rgba(122, 77, 255, 0.45);
}

.gen-preview-studio.is-generating .gen-preview-studio__track span::after {
  opacity: 1;
  animation: gen-progress-sheen 1.35s ease-in-out infinite;
}

.gen-preview-studio__ring.is-animating {
  animation: gen-ring-breathe 1.6s ease-in-out infinite;
  box-shadow:
    inset 0 0 0 1px rgba(122, 77, 255, 0.18),
    0 0 0 4px rgba(122, 77, 255, 0.1),
    0 10px 28px rgba(122, 77, 255, 0.28);
}

.gen-preview-studio__step.is-generating {
  font-weight: 800;
  color: #5921ff;
  text-shadow: 0 0 18px rgba(122, 77, 255, 0.22);
  animation: gen-step-glow 1.8s ease-in-out infinite;
}

.generation-progress.is-running {
  box-shadow:
    inset 0 0 0 1px rgba(122, 77, 255, 0.14),
    0 0 0 1px rgba(122, 77, 255, 0.08),
    0 18px 48px rgba(122, 77, 255, 0.12);
}

@keyframes gen-progress-flow {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: -100% 50%;
  }
}

@keyframes gen-progress-sheen {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes gen-ring-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.04);
    filter: brightness(1.08);
  }
}

@keyframes gen-step-glow {
  0%,
  100% {
    color: #5921ff;
  }
  50% {
    color: #8b5cff;
  }
}

.gen-preview-studio__stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.gen-preview-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(122, 77, 255, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(20, 27, 77, 0.72);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(20, 27, 77, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.gen-preview-nav:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(122, 77, 255, 0.28);
  color: #5921ff;
}

.gen-preview-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.generation-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 14px;
}

.generation-page-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.generation-page-status--done {
  color: #0a8a72;
}

.generation-page-status--running {
  position: relative;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #5921ff;
  background: linear-gradient(135deg, rgba(122, 77, 255, 0.2), rgba(41, 216, 255, 0.14));
  border: 1px solid rgba(122, 77, 255, 0.34);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 0 22px rgba(122, 77, 255, 0.28);
  animation: gen-status-badge 1.6s ease-in-out infinite;
}

.generation-page-status__pulse {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7a4dff, #29d8ff);
  box-shadow: 0 0 12px rgba(122, 77, 255, 0.75);
  animation: gen-status-dot 1s ease-in-out infinite;
}

.generation-page-status__label {
  display: inline-flex;
  align-items: baseline;
}

.generation-animated-dots {
  display: inline-block;
  width: 1.15em;
  text-align: left;
}

.generation-animated-dots::after {
  content: '...';
  animation: gen-dots 1.2s steps(4, end) infinite;
}

@keyframes gen-status-badge {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.45) inset,
      0 0 18px rgba(122, 77, 255, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.55) inset,
      0 0 28px rgba(122, 77, 255, 0.42);
  }
}

@keyframes gen-status-dot {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@keyframes gen-dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75%,
  100% {
    content: '...';
  }
}

.generation-page-status--error {
  color: #b42318;
}

.generation-page-status--cancelled,
.generation-page-status--queued {
  color: var(--muted);
}

.generation-page-regen {
  border: 0;
  background: transparent;
  padding: 6px 2px;
  color: rgba(20, 27, 77, 0.52);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(122, 77, 255, 0.28);
  text-underline-offset: 3px;
  cursor: pointer;
}

.generation-page-regen:hover:not(:disabled) {
  color: #5921ff;
}

.generation-page-regen:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: none;
}

.generation-pages-stage {
  margin-top: 0;
  display: grid;
  gap: 14px;
}

.generation-page-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.generation-thumb {
  flex: 0 0 auto;
  width: 118px;
  padding: 0;
  margin: 0;
  border: 2px solid rgba(122, 77, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.generation-thumb:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 77, 255, 0.28);
}

.generation-thumb.is-active {
  border-color: rgba(122, 77, 255, 0.62);
  box-shadow: 0 10px 28px rgba(122, 77, 255, 0.14);
}

.generation-thumb:focus-visible {
  outline: 2px solid rgba(122, 77, 255, 0.45);
  outline-offset: 2px;
}

.generation-pages {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(122, 77, 255, 0.12);
  background:
    radial-gradient(circle at 18% 12%, rgba(41, 216, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 252, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 48px rgba(20, 27, 77, 0.08);
}

.generation-page-detail .generation-spread {
  aspect-ratio: 2 / 1;
  border-radius: 18px 18px 0 0;
}

.generation-spread--cover {
  aspect-ratio: 1 / 1;
}

.generation-page-detail .generation-spread--cover {
  aspect-ratio: 1 / 1;
}

.generation-story-pick.is-active,
.generation-payment-hint.is-active,
.generation-form.is-active,
.generation-portrait-panel.is-active,
.generation-progress.is-active,
.generation-result.is-active {
  display: flex !important;
  flex-direction: column;
}

.generation-story-pick .generation-stage-footer,
.generation-payment-hint .generation-stage-footer,
.generation-form .generation-stage-footer,
.generation-portrait-panel .generation-stage-footer {
  margin-top: auto;
}

.generation-payment-hint .generation-payment-details + .generation-stage-footer,
.generation-payment-hint > .generation-stage-footer {
  margin-top: auto;
}

@media (max-width: 760px) {
  .generation-stage-footer {
    grid-template-columns: 1fr;
  }

  .generation-stage-footer__primary {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .generation-stage-footer__primary .button-primary {
    width: 100%;
    max-width: none;
  }

  .gen-preview-studio__header {
    flex-direction: column;
  }

  .gen-preview-studio__metrics {
    justify-items: start;
    text-align: left;
  }

  .gen-preview-studio__stage {
    grid-template-columns: 1fr;
  }

  .gen-preview-nav {
    display: none;
  }
}

.generation-thumb-inner {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

.generation-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  vertical-align: middle;
}

.generation-thumb--cover img {
  aspect-ratio: 1 / 1;
}

.generation-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(3, 7, 14, 0.78);
  color: rgba(246, 239, 228, 0.95);
}

.generation-thumb--running {
  border-color: rgba(122, 77, 255, 0.72);
  box-shadow:
    0 0 0 2px rgba(122, 77, 255, 0.16),
    0 0 24px rgba(122, 77, 255, 0.34);
  animation: gen-thumb-pulse 1.35s ease-in-out infinite;
}

.generation-thumb--running .generation-thumb-inner {
  position: relative;
  overflow: hidden;
}

.generation-thumb--running .generation-thumb-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 28%,
    rgba(122, 77, 255, 0.28) 48%,
    rgba(41, 216, 255, 0.22) 52%,
    transparent 72%
  );
  transform: translateX(-120%);
  animation: gen-thumb-shimmer 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gen-thumb-pulse {
  0%,
  100% {
    border-color: rgba(122, 77, 255, 0.58);
    box-shadow:
      0 0 0 2px rgba(122, 77, 255, 0.12),
      0 0 16px rgba(122, 77, 255, 0.24);
  }
  50% {
    border-color: rgba(122, 77, 255, 0.92);
    box-shadow:
      0 0 0 2px rgba(122, 77, 255, 0.22),
      0 0 28px rgba(122, 77, 255, 0.42);
  }
}

@keyframes gen-thumb-shimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.generation-thumb--done {
  border-color: rgba(111, 213, 197, 0.35);
}

.generation-thumb--error {
  border-color: rgba(255, 150, 130, 0.52);
}

.generation-thumb--cancelled {
  border-color: rgba(182, 195, 220, 0.45);
}

.generation-page-detail {
  overflow: visible;
  align-self: stretch;
}

.generation-page-detail .generation-page {
  max-width: min(920px, 100%);
  margin: 0 auto;
}

.generation-page-detail .generation-spread .text-frame-inner {
  padding: 0.65rem 0.8rem;
}

.generation-page {
  border-radius: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.generation-spread {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 2 / 1;
}

.generation-spread .text-frame {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  pointer-events: none;
}

.generation-spread .text-frame-inner {
  pointer-events: none;
  max-width: 100%;
  max-height: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--story-font-family, 'Cormorant Garamond', Georgia, serif);
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

.generation-page .generation-spread img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(8, 18, 34, 0.62);
}

.generation-page-meta {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.generation-page-meta strong {
  font-size: 0.95rem;
}

.generation-page-meta span {
  font-size: 0.82rem;
  color: var(--muted);
}

.generation-page--running .generation-page-meta span {
  color: inherit;
}

.generation-page--running .generation-spread::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(122, 77, 255, 0.16) 48%,
    rgba(41, 216, 255, 0.12) 52%,
    transparent 70%
  );
  transform: translateX(-130%);
  animation: gen-page-shimmer 2s ease-in-out infinite;
}

@keyframes gen-page-shimmer {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(130%);
  }
}

/* While a page is still awaiting generation, let the spread grow to fit the
   wait placeholder instead of being locked to the image aspect ratio. This
   keeps the spinner + hint fully visible on narrow screens. */
.generation-spread:has(.generation-wait-placeholder) {
  aspect-ratio: auto;
  min-height: clamp(200px, 48vw, 460px);
}

.generation-wait-placeholder {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 16px);
  min-height: clamp(200px, 48vw, 460px);
  padding: clamp(16px, 4vw, 28px);
  text-align: center;
  color: #fff;
  background-image: url('/assets/generation-wait-bg.jpg');
  background-size: cover;
  background-position: center;
}

.generation-wait-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 16, 32, 0.45), rgba(8, 16, 32, 0.68));
}

.generation-wait-placeholder > * {
  position: relative;
  z-index: 1;
}

.generation-wait-placeholder__spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: gen-wait-spin 0.9s linear infinite;
}

@keyframes gen-wait-spin {
  to {
    transform: rotate(360deg);
  }
}

.generation-wait-placeholder__title {
  font-size: clamp(1.1rem, 3.2vw, 1.6rem);
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.generation-wait-placeholder__hint {
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  line-height: 1.45;
  max-width: 46ch;
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.generation-page--done .generation-page-meta span {
  color: #8df0d4;
}

.generation-page--error .generation-page-meta span {
  color: #ffb3aa;
}

.generation-page--cancelled .generation-page-meta span {
  color: rgba(210, 220, 236, 0.9);
}

.gen-zoom {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(3, 7, 14, 0.86);
  display: grid;
  place-items: center;
}

.gen-zoom[hidden] {
  display: none !important;
}

.gen-zoom-body {
  width: min(96vw, 1500px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.gen-zoom-spread {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
}

.gen-zoom-spread--cover {
  aspect-ratio: 1 / 1;
}

.gen-zoom img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--zoom-scale, 1));
  transform-origin: center;
  transition: transform 180ms ease;
}

.gen-zoom-text-frame {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  pointer-events: none;
}

.gen-zoom-text-inner {
  pointer-events: none;
  max-width: 100%;
  max-height: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--story-font-family, 'Cormorant Garamond', Georgia, serif);
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

.gen-zoom-btn,
.gen-zoom-close {
  border: 1px solid rgba(255, 231, 198, 0.26);
  background: rgba(255, 247, 235, 0.1);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.gen-zoom-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.gen-zoom-page-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 231, 198, 0.28);
  background: rgba(7, 17, 31, 0.5);
  color: var(--text);
  font-size: 1.9rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.gen-zoom-page-nav--prev {
  left: 10px;
}

.gen-zoom-page-nav--next {
  right: 10px;
}

.gen-zoom-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.order-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 247, 235, 0.08), rgba(255, 247, 235, 0.04));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.order-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.order-list-item-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  margin: -6px -8px;
  padding: 6px 8px;
  transition: background 160ms ease;
}

.order-list-item-link:hover {
  background: rgba(255, 231, 198, 0.08);
}

.order-list-item-link:focus-visible {
  outline: 2px solid rgba(244, 201, 122, 0.45);
  outline-offset: 2px;
}

.order-list-previews {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.order-list-preview {
  width: 52px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 231, 198, 0.08);
}

.order-list-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-list-preview-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(111, 213, 197, 0.35), rgba(244, 201, 122, 0.35));
}

.order-list-main {
  flex: 1;
  min-width: 0;
}

.order-list-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.order-list-heading {
  font-size: 1rem;
  line-height: 1.25;
  min-width: 0;
}

.order-list-status {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.order-list-status.is-neutral {
  background: rgba(255, 231, 198, 0.12);
  color: rgba(246, 239, 228, 0.96);
  border-color: rgba(255, 231, 198, 0.18);
}

.order-list-status.is-warn {
  background: rgba(244, 201, 122, 0.18);
  color: #f4c97a;
  border-color: rgba(244, 201, 122, 0.35);
}

.order-list-status.is-active {
  background: rgba(111, 213, 197, 0.16);
  color: #8ce8dc;
  border-color: rgba(111, 213, 197, 0.35);
}

.order-list-status.is-success {
  background: rgba(111, 213, 197, 0.2);
  color: #6fd5c5;
  border-color: rgba(111, 213, 197, 0.42);
}

.order-list-status.is-error {
  background: rgba(240, 120, 120, 0.16);
  color: #ffb4b4;
  border-color: rgba(240, 120, 120, 0.35);
}

.order-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(246, 239, 228, 0.88);
  font-size: 0.82rem;
}

.order-list-sep {
  opacity: 0.45;
}

.order-list-item:last-child {
  border-bottom: 0;
}

.order-list-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.order-list-action-btn {
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
  font-weight: 600;
}

.order-list-action-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.order-list-empty {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 247, 235, 0.08), rgba(255, 247, 235, 0.04));
  box-shadow: var(--shadow);
}

.order-list-empty p {
  margin-top: 10px;
  margin-bottom: 16px;
}

.order-card,
.billing-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.order-card.muted {
  opacity: 0.8;
}

.order-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: rgba(246, 239, 228, 0.9);
  font-size: 0.9rem;
}

.order-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 231, 198, 0.12);
  overflow: hidden;
  margin-bottom: 8px;
}

.order-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fd5c5 0%, #f4c97a 100%);
}

.order-progress-copy {
  color: rgba(246, 239, 228, 0.9);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.order-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.order-preview {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 231, 198, 0.15);
  background: rgba(3, 12, 26, 0.6);
}

.order-preview img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
}

.order-preview figcaption {
  padding: 6px 8px;
  font-size: 0.8rem;
  color: rgba(246, 239, 228, 0.88);
}

.button.is-disabled,
.button[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.order-top span {
  display: block;
  margin-top: 4px;
  color: rgba(246, 239, 228, 0.9);
  font-size: 0.92rem;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.timeline span {
  position: relative;
  padding-left: 22px;
  color: rgba(246, 239, 228, 0.94);
}

.timeline span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 231, 198, 0.3);
  background: rgba(255, 247, 235, 0.08);
}

.timeline .done::before {
  background: rgba(111, 213, 197, 0.72);
  border-color: rgba(111, 213, 197, 0.92);
}

.timeline .current::before {
  background: rgba(244, 201, 122, 0.76);
  border-color: rgba(244, 201, 122, 0.98);
  box-shadow: 0 0 14px rgba(244, 201, 122, 0.28);
}

.billing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-card strong,
.billing-card b {
  display: block;
}

.billing-card span {
  display: block;
  margin: 12px 0 16px;
  color: var(--muted);
}

.billing-card b {
  margin-bottom: 14px;
  color: var(--gold-strong);
  font-size: 1.65rem;
}

.support-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.65fr);
}

.chat-window {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.chat-placeholder {
  margin: 8px 0 4px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
}

body.theme-skazum .chat-placeholder {
  color: rgba(20, 27, 77, 0.58);
}

body.theme-skazum .chat-placeholder.is-sent {
  color: var(--su-violet);
  font-weight: 600;
}

.chat-bubble {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.6;
}

.chat-bubble.support {
  background: rgba(255, 247, 235, 0.08);
  border: 1px solid rgba(255, 231, 198, 0.14);
}

.chat-bubble.user {
  margin-left: auto;
  background: rgba(111, 213, 197, 0.12);
  border: 1px solid rgba(111, 213, 197, 0.18);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

body.ready [data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulseMoon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes driftStars {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-30px, 12px, 0);
  }
}

@keyframes magicStarArc {
  0% {
    opacity: 0;
    transform: translate3d(var(--x-start, 0), var(--y-start, 0), 0) scale(0.55);
  }
  12% {
    opacity: 1;
  }
  50% {
    transform: translate3d(var(--x-mid, 0), var(--y-mid, 0), 0) scale(0.92);
  }
  82% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x-end, 0), var(--y-end, 0), 0) scale(0.65);
  }
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -24px, 0) scale(1.06);
  }
}

@media (max-width: 1120px) {
  .hero,
  .future-section,
  .builder-grid,
  .cabinet-layout,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-stage {
    min-height: auto;
  }

  .cabinet-sidebar {
    position: relative;
    top: 0;
  }

  .order-grid,
  .order-list,
  .billing-grid,
  .story-grid,
  .process-grid,
  .account-preview,
  .trust-strip,
  .generation-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-variants {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-portrait-panel .generation-variants {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-shell,
  .cabinet-shell {
    width: min(calc(100% - 20px), var(--container));
    padding-top: 14px;
  }

  .topbar {
    top: 10px;
    border-radius: 30px;
    padding: 16px;
    flex-wrap: wrap;
  }

  body.theme-skazum [data-public-topbar].topbar,
  body.theme-skazum [data-cabinet-topbar].topbar {
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 8px;
  }

  .nav.nav-static {
    display: flex;
    width: auto;
    flex-direction: row;
    padding-top: 0;
  }

  .topbar.menu-open .nav {
    display: flex;
  }

  h1 {
    font-size: clamp(2.8rem, 12vw, 4.4rem);
  }

  h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-metrics,
  .trust-strip,
  .story-grid,
  .process-grid,
  .account-preview,
  .order-grid,
  .order-list,
  .billing-grid,
  .generation-layout,
  .generation-pages,
  .future-stage {
    grid-template-columns: 1fr;
  }

  .generation-variants {
    grid-template-columns: 1fr;
  }

  .generation-portrait-panel .generation-variants {
    grid-template-columns: 1fr;
  }

  .generation-new-order-btn {
    margin-left: 0;
    width: 100%;
  }

  .generation-portrait-panel .generation-variant-media--dual {
    grid-template-columns: 1fr;
  }

  .generation-portrait-panel .generation-variant img {
    min-height: 240px;
    max-height: none;
  }

  .generation-payment-hint-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .generation-payment-hero-panel {
    aspect-ratio: 8 / 3;
    min-height: 0;
    padding: 28px 18px 30px;
    background-image:
      linear-gradient(180deg, rgba(247, 244, 255, 0.12) 0%, rgba(255, 255, 255, 0.88) 46%, rgba(255, 255, 255, 0.96) 62%),
      url('/site/assets/payment-hero-bg.png?v=2');
    background-position: center, left top;
    background-size: 100% 100%, 100% auto;
  }

  .generation-result-card {
    padding: 14px 14px 0;
  }

  .generation-result-hero-panel {
    min-height: 200px;
  }

  .generation-result-hero-main {
    right: 18px;
    width: min(320px, 54%);
    gap: 8px;
  }

  .generation-result-hero-title {
    font-size: 1.35rem;
  }

  .generation-result-hero-lead,
  .generation-result-hero-meta {
    font-size: 13px;
  }

  .generation-result-product-card {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      'cover body'
      'actions actions';
    gap: 12px;
    padding: 14px;
  }

  .generation-result-product-cover {
    grid-area: cover;
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .generation-result-product-body {
    grid-area: body;
  }

  .generation-result-product-actions {
    grid-area: actions;
    width: 100%;
  }

  .generation-result-download-btn,
  .generation-result-copy-btn {
    width: 100%;
    min-width: 0;
  }

  .generation-result-print-guide {
    padding-left: 0;
    padding-right: 0;
  }

  .generation-result-print-guide summary {
    padding: 18px 0;
  }

  .generation-payment-hero-main {
    position: static;
    transform: none;
    width: 100%;
    margin-bottom: 23px;
  }

  .generation-payment-format-grid,
  .print-upgrade-layout {
    grid-template-columns: 1fr;
  }

  .print-upgrade-badge {
    top: 14px;
    right: 14px;
  }

  .print-upgrade-media {
    min-height: 180px;
  }

  .print-upgrade-book {
    height: 180px;
  }

  .generation-payment-trust-list {
    position: static;
    transform: none;
    width: min(100%, 320px);
    margin: 0 auto;
  }

  .generation-payment-trust-list li {
    text-align: left;
  }

  .generation-payment-action,
  .generation-payment-meta,
  .generation-payment-mock-hint {
    padding-left: 18px;
    padding-right: 18px;
  }

  .generation-payment-meta-list {
    grid-template-columns: 1fr;
  }

  .generation-book-delivery-head,
  .cdek-mode-row,
  .cdek-city-row,
  .cdek-map-layout,
  .cdek-courier-grid {
    grid-template-columns: 1fr;
  }

  .cdek-geo-btn {
    width: 100%;
  }

  .order-meta-row {
    flex-direction: column;
    gap: 4px;
  }

  .order-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-carousel {
    grid-template-columns: 1fr;
  }

  .carousel-nav {
    justify-self: center;
  }

  .floating-card {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    margin-top: 14px;
  }

  .stage-card-main {
    min-height: auto;
  }

  .stage-window {
    height: 320px;
  }

  .builder-shell {
    padding: 22px;
  }

  .footer,
  .cabinet-hero,
  .chat-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .footer-links,
  .hero-actions,
  .account-cta,
  .cabinet-pill-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-shell,
  .cabinet-shell {
    width: min(calc(100% - 16px), var(--container));
  }

  .topbar {
    gap: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .hero-actions,
  .account-cta {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .cookie-consent__actions .button {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .magic-stars-layer {
    display: none;
  }
}

.payment-return-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(7, 17, 31, 0.82);
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
}

.payment-return-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.payment-return-overlay__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(244, 201, 122, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: payment-return-spin 0.9s linear infinite;
}

.payment-return-overlay__text {
  color: var(--text);
  font-size: 1.05rem;
  text-align: center;
  max-width: 280px;
}

@keyframes payment-return-spin {
  to {
    transform: rotate(360deg);
  }
}

.generation-story-pick-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  color: var(--muted);
  grid-column: 1 / -1;
}

.generation-story-pick-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(244, 201, 122, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: payment-return-spin 0.9s linear infinite;
}

/* Cookie consent banner */
.cookie-consent {
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 24px);
  left: clamp(12px, 3vw, 24px);
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 20px;
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(122, 77, 255, 0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(122, 77, 255, 0.12), transparent 48%),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(122, 77, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.cookie-consent.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-consent__copy {
  flex: 1 1 280px;
  min-width: 0;
}

.cookie-consent__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(31, 22, 51, 0.82);
}

.cookie-consent__link {
  color: #6b45e8;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent__link:hover {
  color: #4f2fc9;
}

.cookie-consent__accept {
  flex: 0 0 auto;
  min-width: 132px;
  align-self: center;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-consent__reject {
  min-width: 120px;
}

.cookie-consent__pd {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(31, 22, 51, 0.88);
  cursor: pointer;
}

.cookie-consent__pd-input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #6b45e8;
}

@media (max-width: 640px) {
  .cookie-consent {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .cookie-consent__copy {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .cookie-consent__text {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .cookie-consent__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
  }

  .cookie-consent__reject,
  .cookie-consent__accept {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .cookie-consent__pd {
    margin-top: 8px;
    font-size: 0.74rem;
    gap: 8px;
  }
}

