/* Shared presentation for the experience chooser and all three photo apps. */
body.storybook {
  --navy: #10110f;
  --cream: #f4eee1;
  --gold: #cdb98d;
  --gold-soft: #e2d3b1;
  --muted: #b6b3a8;
  --line: #d8c69d26;
  --font-script: var(--font-display);
  --type-body: 16px;
  --type-quiet: 14px;
  --type-title: 36px;
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 0, #29291f66, transparent 750px), var(--navy);
  font-family: var(--font-display);
  font-size: var(--type-body);
  font-weight: 350;
  line-height: 1.65;
}

/* The product styles predate the shared system. Keep typography in one place,
   including controls and late-mounted camera UI, without changing icon content. */
body.storybook * {
  font-family: var(--font-display) !important;
  font-size: inherit !important;
  font-weight: 350 !important;
  font-style: normal !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
body.storybook :is(h1, h2),
body.storybook :is(.product-wordmark, .product-subtitle, .magic-capture-title) {
  font-size: var(--type-title) !important;
  line-height: 1.2;
  color: var(--cream);
  text-wrap: balance;
}
body.storybook :is(h1, h2) { margin-bottom: 20px; }
body.storybook :is(h3, .choice-label) {
  font-size: var(--type-body) !important;
  line-height: 1.5;
  color: var(--cream);
}
body.storybook :is(.step, .eyebrow, .small, .badge, .range-labels,
  .choice-number, .photo-guidance li > span, .photo-guidance small,
  .size-heading output, .metadata, figcaption, footer,
  .santa-frame-tip small, .santa-instruction, .santa-picker-status,
  .santa-loading, .tree-guide-toggle, .magic-capture-eyebrow,
  .magic-capture-note, .magic-capture-status, .magic-capture-error,
  .magic-capture-instruction, #anchor-instruction) {
  font-size: var(--type-quiet) !important;
  line-height: 1.6;
}
body.storybook :is(.support, .lede, .control-label, .choice-content,
  .plate-directions, .santa-frame-tip p, .magic-capture-shutter,
  .magic-capture-fallback, .tree-range label, .santa-range-control label,
  .size-heading label, .text-option, .side-option, .button) {
  font-size: var(--type-body) !important;
  line-height: 1.6;
}
body.storybook .step { margin-bottom: 12px; color: var(--gold-soft); }
body.storybook .support { max-width: 650px; margin-bottom: 24px; }
body.storybook .photo-guidance small { margin-top: 4px; }
body.storybook footer .footer-script,
body.storybook footer > span,
body.storybook footer a { font-size: var(--type-quiet) !important; }

/* The same quiet header and readable experience links on every screen. */
body.storybook .topbar {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
  padding: 24px 0;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
body.storybook .brand { gap: 12px; min-width: 0; }
body.storybook .topbar .portal-mark { width: 36px; height: 36px; }
body.storybook :is(.brand-title, .santa-brand-title, .tree-brand-title,
  .experience-brand-title) {
  display: block;
  font-size: var(--type-body) !important;
  line-height: 1.25;
  color: var(--cream);
}
body.storybook :is(.brand-title, .santa-brand-title, .tree-brand-title,
  .experience-brand-title) small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--type-quiet) !important;
  line-height: 1.25;
}
body.storybook .topbar > :is(.back, a:not(.brand)) {
  flex-shrink: 0;
  max-width: none;
  color: var(--gold-soft);
  font-size: var(--type-quiet) !important;
  line-height: 1.5;
  white-space: normal;
  text-align: right;
}
body.storybook main { width: min(1100px, calc(100% - 64px)); }
body.storybook .experience-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 24px;
  min-height: 0;
  padding: 18px 0 8px;
}
body.storybook .experience-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: var(--type-quiet) !important;
  line-height: 1.5;
  text-decoration: none;
  text-underline-offset: 6px;
}
body.storybook .experience-navigation a:is(:hover, [aria-current="page"]) {
  color: var(--gold-soft);
  text-decoration: underline;
  text-decoration-color: #cdb98d88;
}
body.storybook.welcome-routing main { visibility: hidden; }

/* A single button treatment; the photograph remains the focus of the editor. */
body.storybook .button {
  min-height: 52px;
  padding: 13px 20px;
  gap: 12px;
  border-radius: 10px;
  box-shadow: none;
}
body.storybook .button.primary,
body.storybook .magic-capture-shutter {
  color: #242217;
  border: 1px solid #decaa4;
  background: #d8c29a;
  box-shadow: none;
}
body.storybook .button.primary:hover:not(:disabled),
body.storybook .magic-capture-shutter:hover:not(:disabled) {
  background: #e4d1ad;
  box-shadow: none;
}
body.storybook .button.secondary {
  color: var(--cream);
  background: transparent;
  border: 1px solid #d8c69d55;
}
body.storybook .button.secondary:hover:not(:disabled) {
  background: #d8c69d0a;
  border-color: #d8c69d99;
}
body.storybook :is(.side-options, .side-option) { border-radius: 8px; }
body.storybook .stage { padding-top: 30px; min-height: 0; }
body.storybook :is(.photo-stage, .choice-stage) { max-width: 680px; }
body.storybook .workspace :is(.photo-stage, .choice-stage) { padding-bottom: 40px; }
body.storybook .photo-stage > #picker { margin-top: 26px; }
body.storybook :is(.guidance-stage, .santa-guidance, .tree-guidance) {
  gap: 56px;
  padding-top: 30px;
  padding-bottom: 40px;
}
body.storybook :is(.guidance-photo, .santa-source-photo) {
  min-height: 430px;
  max-height: 590px;
  border: 1px solid #d8c69d40;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
}
body.storybook :is(.guidance-photo, .santa-source-photo) .photo-corner { display: none; }
body.storybook :is(.guidance-photo, .santa-source-photo, .tree-visitor-card) figcaption {
  bottom: 24px;
  left: 24px;
  right: 24px;
  color: var(--cream);
  line-height: 1.6;
}
body.storybook .photo-guidance li { padding: 14px 0; }
body.storybook .santa-product-name {
  color: var(--gold-soft);
  font-size: var(--type-quiet) !important;
  margin-bottom: 12px;
}
body.storybook .santa-simple-stage,
body.storybook .tree-photo-stage { padding-top: 30px; padding-bottom: 40px; }
body.storybook :is(.creating-stage, .santa-creating-stage, .tree-creating) { min-height: 60svh; }
body.storybook .creation-portal { border-radius: 50%; background: transparent; }
body.storybook :is(.result-stage > .room-image, #still-result,
  .santa-own-photo, .santa-result-media > img, .santa-result-media > video,
  .santa-result-media > canvas, .tree-result-stage > img) {
  border: 1px solid #d8c69d40;
  border-radius: 12px;
  box-shadow: none;
}
body.storybook .tree-visitor-card {
  border: 1px solid #d8c69d40;
  border-radius: 16px;
  background: #d8c69d05;
  box-shadow: none;
}
/* The outline and nearby instructions identify the tree without a tiny SVG label. */
body.storybook .tree-guide text { display: none; }

/* Camera chrome stays outside the photo and matches the rest of the app. */
body.storybook .magic-capture { background: var(--navy); }
body.storybook .magic-capture-shell { padding-bottom: 8px; }
body.storybook .magic-capture-frame {
  border-color: #d8c69d66;
  border-radius: 12px;
  box-shadow: none;
}
body.storybook .magic-capture-close {
  border-color: #d8c69d66;
  color: var(--cream);
  font-size: 28px !important;
  background: transparent;
}
body.storybook .magic-capture-shutter { border-radius: 10px; }

/* Actions fit their words rather than stretching across a photograph or form.
   Explicit sizing wins over older product ID/flex rules; selection cards,
   camera controls, media and input fields retain their own geometry. */
body.storybook .button {
  display: inline-flex;
  width: fit-content !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 48px !important;
  flex: 0 1 auto !important;
  justify-self: start;
  align-self: start;
  justify-content: center;
  padding: 11px 22px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
body.storybook :is(main, .video-immersive, .welcome-actions) :is(.back, .text-option) {
  width: fit-content !important;
  min-width: 0 !important;
  max-width: 100%;
  min-height: 44px;
  flex: 0 1 auto;
  justify-self: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Keep related actions together without forcing their labels into equal-width
   columns. Long labels can still wrap within a narrow phone viewport. */
body.storybook :is(.result-actions, .tree-result-actions, .santa-result-edit,
  .parent-actions, .video-result-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
body.storybook :is(.result-actions, .tree-result-actions, .santa-result-edit,
  .video-result-actions) { justify-content: center; }
body.storybook :is(.result-actions, .tree-result-actions, .santa-result-edit,
  .parent-actions, .video-result-actions) > .button { margin-inline: 0; }
body.storybook :is(.video-editor-controls, .video-generation, .journey-external,
  .welcome-actions) > .button {
  display: flex;
  margin-inline: auto;
  align-self: center;
}

@media (max-width: 720px) {
  body.storybook { --type-title: 28px; }
  body.storybook .topbar {
    width: calc(100% - 40px);
    padding: 18px 0;
    gap: 12px;
  }
  body.storybook .topbar .portal-mark { width: 32px; height: 32px; }
  body.storybook .topbar > :is(.back, a:not(.brand)) {
    max-width: 128px;
    gap: 5px;
  }
  body.storybook main { width: calc(100% - 40px); }
  body.storybook .experience-navigation { gap: 4px 18px; padding-top: 12px; }
  body.storybook .stage { padding-top: 24px; }
  body.storybook :is(.guidance-stage, .santa-guidance, .tree-guidance) {
    gap: 28px;
    padding-top: 24px;
    padding-bottom: 32px;
  }
  body.storybook .guidance-stage { gap: 0; }
  body.storybook :is(.guidance-photo, .santa-source-photo) {
    min-height: 0;
    height: 230px;
    max-height: 300px;
    border-radius: 12px;
  }
  body.storybook .guidance-photo { margin-top: 28px; }
  body.storybook .santa-source-photo { margin-top: 0; }
  body.storybook .photo-guidance li { padding: 12px 0; }
  body.storybook .tree-visitor-card { border-radius: 12px; }
  body.storybook :is(.editor-surface, .santa-canvas-surface, .santa-preview-host) {
    width: calc(100% + 40px);
    margin-left: -20px;
  }
  body.storybook :is(#still-result, #motion-canvas-host, .tree-result-stage > img) {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
  }
  body.storybook :is(.result-stage > .room-image, #still-result,
    .santa-result-media > img, .santa-result-media > video,
    .santa-result-media > canvas, .tree-result-stage > img) { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.storybook .stage { animation: none; }
}
