body.storybook[data-product='video-placement'] { min-height: 100svh; }
body.storybook .video-start { width: min(580px, calc(100% - 48px)); margin: 42px auto 64px; }
.video-start h1 { margin: 0 0 18px; }
.video-introduction { margin: 0 0 28px; }
.video-selection { display: grid; gap: 8px; margin-bottom: 18px; }
.video-selection > div { display: grid; gap: 8px; margin-top: 12px; }
.video-selection label { display: block; }
.video-selection select { width: 100%; min-height: 52px; padding: 10px 42px 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: #030710; color: var(--gold); font: inherit; }
.video-selection select:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.video-start .button { margin-top: 12px; }
.video-start .small { margin: 12px 0; }
.video-start .video-privacy { margin-top: 22px; }
.video-photo-link { margin-top: 12px; }
/* Sticker pages keep one introduction and the library. Room capture choices
   appear only after a sticker is tapped, using the existing native actions. */
body.video-sticker-product #video-start :is(#video-clip-note, .video-privacy) { display: none; }
/* Elf is chosen in the new submenu. Keep the retired entry controls and empty
   experience picker out of its initial sticker view. Room choices still appear
   in their dialog; the populated picker remains below the sticker library. */
body.video-elf-product #video-start #video-room-actions,
body.video-elf-product #video-start > .video-selection:has(#video-product:disabled) { display: none; }
body.video-sticker-product #video-ready-status {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
body.storybook.video-sticker-product #video-start > .video-selection { margin-bottom: 16px; }
.video-room-choice { width: min(360px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--gold); background: #020812; font: inherit; text-align: center; overflow: auto; }
.video-room-choice::backdrop { background: #000b; backdrop-filter: blur(4px); }
body.storybook .video-room-choice h2 { margin: 0 0 20px; font-size: var(--type-subheading) !important; }
.video-room-choice #video-room-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: min(260px, 100%); margin-inline: auto; gap: 12px; }
body.storybook .video-room-choice #video-room-actions .button { width: 100% !important; max-width: none; min-height: 48px; margin: 0; padding: 10px 20px; }
.video-room-choice #video-room-choice-cancel { min-height: 44px; margin: 12px auto 0; }
.video-room-choice .video-error { margin: 16px 0 4px; }
.video-room-choice #video-retry { min-height: 44px; }
body.storybook.video-sticker-product .video-start { width: min(1000px, calc(100% - 48px)); }
.video-sticker-product .video-selection, .video-sticker-product .video-start-actions { max-width: 580px; margin-inline: auto; }
.video-sticker-product .video-start > h1, .video-sticker-product .video-introduction { max-width: 700px; margin-inline: auto; text-align: center; }
.elf-gallery { margin: 30px 0; }
.elf-gallery h2 { margin: 0 0 10px; text-align: center; }
.elf-gallery > .small { text-align: center; }
.elf-sticker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.elf-sticker-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 14px 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #030710; color: var(--gold); font: inherit; cursor: pointer; text-align: center; }
.elf-sticker-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.elf-sticker-title { display: block; line-height: 1.3; }
body.storybook .elf-sticker-sound { display: block; max-width: 100%; font-size: var(--type-quiet) !important; font-weight: 700 !important; line-height: 1.3; letter-spacing: .04em !important; text-transform: uppercase !important; }
body.storybook .elf-sticker-duration { display: block; max-width: 100%; font-size: var(--type-quiet) !important; line-height: 1.35; overflow-wrap: anywhere; }
.video-start .video-selected-info { max-width: 580px; margin: 10px auto 18px; text-align: center; line-height: 1.4; }
.elf-sticker-access { display: block; font-size: var(--type-quiet); line-height: 1.3; }
.elf-sticker-card[aria-pressed='true'] { border: 2px solid var(--gold); padding: 13px 13px 17px; background: #0a1120; }
.elf-sticker-card[aria-pressed='true']::after { content: 'Selected'; position: absolute; top: 10px; right: 10px; padding: 4px 8px; border-radius: 5px; background: #dfb87a; color: #01030a; font-size: var(--type-quiet); line-height: 1.2; }
.elf-sticker-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.elf-sticker-card:hover { border-color: var(--gold); }
.elf-sticker-card:disabled { cursor: wait; opacity: .65; }
body.storybook .video-editor-controls .video-change-elf { display: block; min-height: 44px; margin: 0 auto; }
@media (max-width: 720px) { .elf-sticker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .elf-sticker-card { padding: 10px 10px 14px; } .elf-sticker-card[aria-pressed='true'] { padding: 9px 9px 13px; } }
@media (min-width: 1200px) { .elf-sticker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.video-error { margin: 16px 0 4px; }
.video-immersive { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; overflow: hidden; background: #01030a var(--brand-page-gradient); padding-top: env(safe-area-inset-top); }
body.video-placement-open { overflow: hidden; }
.video-immersive-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left)); }
body.storybook .video-immersive-header h2 { margin: 0; font-size: var(--type-subheading) !important; }
.video-close { min-height: 44px; min-width: 60px; padding: 8px 0 8px 12px; color: var(--gold); background: none; border: 0; }
.video-canvas-shell { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#placement-canvas { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; touch-action: none; cursor: grab; outline-offset: -4px; }
#placement-canvas:active { cursor: grabbing; }
/* Bound the native camera drawing to its allocated area. A percentage-sized
   grid item can otherwise keep its intrinsic portrait height and be clipped. */
#placement-editor .video-canvas-shell { flex: 1 1 0; min-width: 0; min-height: 0; }
#placement-canvas { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.video-editor-controls { flex: 0 0 auto; padding: 8px max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); max-height: 45svh; overflow: auto; }
.video-editor-controls > .small { margin: 0 0 6px; text-align: center; }
.video-editor-controls .button { margin: 8px auto 0; max-width: 580px; }
body.storybook #video-use-live-camera { display: flex; min-height: 48px; margin: 8px auto 0; }
body.storybook .video-editor-controls .video-sound-toggle { width: fit-content; min-height: 44px; margin: 4px auto 6px; padding: 8px 18px; }
.video-more-controls { max-width: 580px; margin: 8px auto 0; text-align: center; }
.video-more-controls summary { min-height: 44px; display: flex; justify-content: center; align-items: center; cursor: pointer; list-style: none; }
.video-more-controls summary::-webkit-details-marker { display: none; }
.video-adjust-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
#placement-editor .video-adjust-actions > button { width: 100% !important; min-height: 48px; margin: 0; }
.video-more-controls .small { margin: 8px 0; }
/* Keep the ready camera dominant: two short action rows, with optional
   adjustments opening above them rather than taking space from the picture. */
#placement-editor .video-editor-controls {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center; gap: 4px 12px; width: min(100%, 800px); align-self: center;
  padding: 6px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  max-height: none; overflow: visible;
}
#placement-editor .video-editor-controls > .small { grid-column: 1 / -1; margin: 0; line-height: 1.3; }
body.storybook #placement-editor .video-editor-controls > .button { width: 100% !important; margin: 0; padding: 8px 12px; line-height: 1.3; }
body.storybook #placement-editor #video-change-elf { grid-column: 1; width: 100% !important; min-height: 48px; margin: 0; }
#placement-editor #video-preview-sound { grid-column: 2; }
#placement-editor :is(#video-resume, #video-use-live-camera) { grid-column: 1 / -1; }
#placement-editor #video-generate { grid-column: 1; }
#placement-editor .video-more-controls { grid-column: 2; margin: 0; min-width: 0; }
#placement-editor .video-more-controls summary { min-height: 48px; }
#placement-editor .video-more-panel {
  position: absolute; z-index: 4; inset-inline: 12px; bottom: calc(100% + 8px);
  max-width: 580px; margin-inline: auto; max-height: min(48svh, 360px); overflow: auto;
  padding: 12px 16px; background: #020610f5; border: 1px solid var(--line); border-radius: 12px;
}
.video-brightness-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; text-align: left; margin-block: 10px 0; }
.video-brightness-control input { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--gold); touch-action: pan-y; }
.video-brightness-control output { font: inherit; font-variant-numeric: tabular-nums; }
/* The gesture hint already states these ready messages. Keep their live
   announcements without repeating a paragraph below the camera. Errors and
   interrupted-camera/resume messages retain their visible full-width row. */
#placement-editor .video-routine-status {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.video-generation { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 28px; background: #01030ad9; text-align: center; }
.video-generation p { margin: 0; }
.video-generation progress { width: min(320px, 100%); height: 6px; accent-color: var(--gold); }
.video-generation .button { max-width: 260px; }
.video-playback-shell { position: relative; flex: 1 1 0; min-height: 0; min-width: 0; overflow: hidden; }
/* A video's intrinsic grid height can exceed its flex allocation on a short
   screen and paint over Download/Share. Give it the bounded playback area. */
.video-playback-shell video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: 100%; object-fit: contain; background: #000; }
.video-result-controls { flex: 0 0 auto; padding: 12px max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); max-height: 45svh; overflow: auto; }
.video-result-actions { display: flex; gap: 12px; max-width: 580px; margin: auto; }
.video-result-actions .button { flex: 1; margin: 0; }
body.storybook .video-result-controls .video-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
body.storybook .video-result-controls .video-result-actions > .button { width: 100% !important; align-self: stretch; margin: 0; }
/* Keep the ready-file actions visible while the secondary controls scroll. */
body.storybook .video-result-controls .video-result-actions {
  position: sticky; top: 0; z-index: 2; padding-block: 4px;
  background: #01030a;
}
.video-result-controls > .small { max-width: 580px; margin: 10px auto 0; text-align: center; }
.video-result-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; max-width: 580px; margin: 8px auto 0; text-align: center; }
.video-result-links > .back { display: flex; align-items: center; justify-content: center; width: 100% !important; min-height: 48px; margin: 0; }
.video-result-links #video-new-photo { grid-column: 1 / -1; }
@media (min-width: 900px) { .video-canvas-shell, .video-playback-shell { width: min(1100px, 100%); margin: auto; } .video-editor-controls { padding-top: 12px; } }
@media (max-width: 720px) { body.storybook .video-topbar { width: calc(100% - 36px); padding: 18px 0; } body.storybook .video-start { margin-top: 28px; } .video-immersive-header { padding-top: 6px; padding-bottom: 6px; } .video-editor-controls { padding-top: 6px; } }
@media (max-height: 500px) and (orientation: landscape) { .video-immersive-header { padding-top: 0; padding-bottom: 0; } .video-editor-controls { position: absolute; bottom: 0; right: 0; width: 260px; max-height: calc(100% - 48px); background: #01030ae8; padding: 10px 16px; } .video-canvas-shell { width: calc(100% - 260px); margin-left: 0; } .video-result-controls { max-height: 40svh; } }
@media (max-height: 500px) and (orientation: landscape) {
  #placement-editor .video-editor-controls { position: absolute; bottom: 0; right: 0; width: 260px; max-height: calc(100% - 48px); padding: 10px 12px; }
}

/* One thumb action per screen. Other video controls live in the header's
   Options sheet; the camera and result keep their complete bounded canvases. */
body.storybook #video-start { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
body.storybook #video-start :is(#video-start-camera, #video-return-to-room) {
  position: fixed !important; z-index: 110; left: 50%; right: auto;
  bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content !important; min-width: 160px !important;
  max-width: min(320px, calc(100vw - 32px)) !important; min-height: 56px !important;
  margin: 0 !important; padding: 13px 24px;
}
body.storybook #video-start :is(#video-start-camera, #video-return-to-room):active:not(:disabled) {
  transform: translateX(-50%) scale(.98);
}
body.storybook .video-immersive-header { position: relative; gap: 10px; }
body.storybook .video-immersive-header h2 { flex: 1 1 auto; min-width: 0; line-height: 1.15; }
body.storybook .video-immersive-header > .video-close { flex: 0 0 auto; min-width: 48px; padding-inline: 0; }
body.storybook .video-immersive .video-toolbar-options {
  position: static; flex: 0 0 auto; width: auto; min-width: 0; margin: 0;
}
body.storybook .video-toolbar-options > summary,
body.storybook .video-room-alternatives > summary {
  position: static; display: flex; align-items: center; justify-content: center;
  min-height: 48px; min-width: 48px; padding: 8px 4px; margin: 0;
  color: var(--gold); font: inherit; cursor: pointer; list-style: none;
}
body.storybook :is(.video-toolbar-options, .video-room-alternatives) > summary::-webkit-details-marker { display: none; }
body.storybook :is(.video-toolbar-options, .video-room-alternatives) > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
body.storybook .video-immersive .video-options-panel,
body.storybook .video-room-alternatives .video-options-panel {
  position: fixed; z-index: 110; inset: auto 16px calc(112px + env(safe-area-inset-bottom));
  width: min(480px, calc(100% - 32px)); max-width: none; margin: 0 auto;
  max-height: min(58dvh, calc(100dvh - 180px)); overflow: auto; overscroll-behavior: contain;
  padding: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: #020610f7; color: var(--gold); box-shadow: 0 12px 40px #0008;
}
body.storybook .video-options-panel > :is(.button, .back) { display: flex; margin: 0 auto 12px; min-height: 48px; }
body.storybook .video-options-panel .video-adjust-actions { gap: 12px; }
body.storybook .video-options-panel .video-result-links { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 0; }
body.storybook .video-options-panel .video-result-links > .back { min-height: 48px; }
body.storybook .video-options-panel .small { margin: 12px 0 0; }
body.storybook #placement-editor .video-editor-controls,
body.storybook #video-result .video-result-controls {
  position: static; display: flex; flex: 0 0 auto; flex-direction: column;
  align-items: center; justify-content: flex-end; align-self: stretch;
  gap: 8px; width: 100%; max-height: none; overflow: visible;
  padding: 8px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #01030a;
}
body.storybook #placement-editor .video-editor-controls > .small,
body.storybook #video-result .video-result-controls > .small { margin: 0; text-align: center; line-height: 1.3; max-width: 36rem; }
body.storybook #placement-editor .video-editor-controls > .button,
body.storybook #video-result .video-result-actions > .button,
body.storybook #video-room-choice #video-start-camera,
body.storybook #video-cancel {
  position: relative; display: inline-flex; width: fit-content !important;
  min-width: min(160px, 100%) !important; max-width: min(320px, 100%) !important;
  min-height: 56px !important; height: auto; margin: 0 auto !important; padding: 12px 24px;
  flex: 0 0 auto !important; justify-self: center; align-self: center; line-height: 1.3;
}
body.storybook #video-result .video-result-actions {
  position: static; display: flex; justify-content: center; width: 100%;
  margin: 0; padding: 0; background: transparent;
}
body.storybook #placement-editor .video-canvas-shell { width: 100%; margin-inline: auto; }
body.storybook #video-cancel { position: fixed; inset: auto 16px max(12px, env(safe-area-inset-bottom)); z-index: 115; }
body.storybook .video-editor-controls:has(#video-generate[hidden]) { min-height: 84px; }

/* The sticker's room choice is a bottom sheet. Its sole main action remains
   centred below the header's alternate-photo choice and Cancel navigation. */
body.storybook #video-room-choice {
  position: fixed; inset: auto 0 0; width: min(440px, calc(100% - 24px));
  margin: 0 auto max(12px, env(safe-area-inset-bottom));
  max-height: calc(100dvh - 32px); padding: 12px 20px 20px;
}
body.storybook .video-room-choice-header { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
body.storybook .video-room-choice-header h2 { margin: 0; text-align: left; padding-right: 98px; flex: 1; min-width: 0; }
body.storybook #video-room-choice #video-room-choice-cancel { margin: 0; padding: 8px 0; min-width: 64px; min-height: 48px; }
body.storybook #video-room-choice #video-room-actions { display: flex; justify-content: center; width: 100%; margin: 0; }
body.storybook #video-room-choice .video-room-alternatives { position: absolute; top: 12px; right: 96px; margin: 0; }
body.storybook #video-room-choice .video-room-alternatives .video-options-panel { bottom: calc(100px + env(safe-area-inset-bottom)); }
body.storybook #video-room-choice .video-room-alternatives .button { width: fit-content !important; }
body.storybook #video-room-choice-feedback:has(> #video-start-feedback) { margin-top: 12px; }
body.storybook #video-room-choice-feedback .small:empty { display: none; }
@media (max-height: 500px) and (orientation: landscape) {
  body.storybook #placement-editor .video-editor-controls,
  body.storybook #video-result .video-result-controls { padding-top: 4px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  body.storybook #placement-editor #video-placement-help { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  body.storybook .video-immersive .video-options-panel { bottom: calc(76px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 132px); }
}
body.storybook #video-room-choice[open] { display: flex; flex-direction: column; }
body.storybook #video-room-choice .video-room-choice-header { order: 0; }
body.storybook #video-room-choice #video-room-choice-feedback { order: 1; }
body.storybook #video-room-choice #video-room-choice-actions { order: 2; }
body.storybook #placement-editor .video-more-panel {
  position: fixed; z-index: 110; inset: auto 16px calc(112px + env(safe-area-inset-bottom));
  width: min(480px, calc(100% - 32px)); max-width: none; margin: 0 auto;
  max-height: min(58dvh, calc(100dvh - 180px)); overflow: auto;
}
@media (max-height: 500px) and (orientation: landscape) {
  body.storybook #placement-editor .video-more-panel { bottom: calc(76px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 132px); }
}

/* Light is a first-class placement control: one compact original range above
   the single gold action, with the camera retaining its bounded flex space. */
body.storybook #placement-editor .video-editor-controls { gap: 12px; }
body.storybook #placement-editor .video-brightness-control {
  display: grid; grid-template-columns: auto minmax(60px, 1fr) 4ch;
  align-items: center; gap: 8px; width: min(440px, 100%);
  min-height: 44px; margin: 0; font-size: 16px; line-height: 1.3;
}
body.storybook #placement-editor .video-brightness-control > span { grid-column: 1; grid-row: 1; }
body.storybook #placement-editor .video-brightness-control > input {
  grid-column: 2; grid-row: 1; min-height: 44px; height: 44px; margin: 0;
}
body.storybook #placement-editor .video-brightness-control > output {
  grid-column: 3; grid-row: 1; text-align: right;
}
body.storybook #placement-editor #video-placement-help {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
body.storybook #placement-editor .video-more-panel {
  bottom: calc(136px + env(safe-area-inset-bottom));
  max-height: min(58dvh, calc(100dvh - 200px));
}
