/* Shared consumer workspace. The original welcome page retains its own design. */
body:has(#editor:not([hidden])), body.studio-page {
  --paper: #fff; --ink: var(--studio-ink); --muted: var(--studio-muted);
  --action: var(--studio-accent); --action-hover: var(--studio-hover);
  --surface: var(--studio-mat); --stone: var(--studio-tint); --line: var(--studio-line);
  --input-line: #849078; --font-ui: var(--studio-font); --font-display: var(--studio-font);
  font-family: var(--studio-font); color: var(--ink); background: #fff;
  scrollbar-color: #899779 #f5f6f1;
}
body:has(#editor:not([hidden])) .site-header, .studio-page .site-header { padding: 20px 32px; }
body:has(#editor:not([hidden])) .brand, .studio-page .brand { font-family: var(--studio-font); font-weight: 650; font-size: 22px; letter-spacing: -.02em; }
body:has(#editor:not([hidden])) .brand span, .studio-page .brand span { display: none; }
body:has(#editor:not([hidden])) main { max-width: 1680px; padding: 0 32px 48px; }
body:has(#editor:not([hidden])) footer, .studio-page footer { padding: 24px 32px; font-family: var(--studio-font); }
#editor { padding-top: 26px; }
#editor h1, #editor h2, #editor h3 { font-family: var(--studio-serif); font-size-adjust:.46; color: var(--ink); }
#editor h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 0; }
#editor h2 { font-size: 23px; font-weight: 600; margin-bottom: 18px; }
#editor h3 { font-size: 18px; }
#editor .project-label { margin-bottom: 5px; font-size: 13px; }
#editor .editor-heading { align-items: center; }
#editor .editor-heading > div + div { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
#editor .history-toolbar button { font-size: 13px; }
#editor button, #editor .download, .studio-page button { border-radius: 7px; }
#editor input, #editor select, #editor textarea, .studio-page input { border-radius: 6px; }
#editor button:hover:not(:disabled), .studio-page button:hover:not(:disabled) { border-color: var(--action); }
#editor :focus-visible, .studio-page :focus-visible { outline: 3px solid #a44228; outline-offset: 3px; }
#editor ::selection, .studio-page ::selection { color: #273126; background: #dce4cc; }
#editor .editor-nav { gap: 0; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(4,1fr); border-block: 0; background: var(--surface); border-radius: 8px; }
#editor .editor-nav a { padding: 14px 18px; justify-content: center; color: var(--muted); font-weight: 500; border: 0; text-decoration: none; }
#editor .editor-nav a[aria-current] { color: var(--action); background: var(--stone); border-radius: 8px 8px 0 0; font-weight: 650; }
#editor #getting-started { background: var(--studio-tint); padding: 16px 20px; border-radius: 8px; }
.studio-workspace { display: grid; grid-template-columns: minmax(350px,.85fr) minmax(0,1.25fr); align-items: start; gap: 40px; }
.studio-controls, .studio-stage { min-width: 0; }
.studio-stage { position: sticky; top: 24px; }
#editor #photos { border: 0; padding: 0; margin: 0; }
#editor .album-workspace { display: block; }
#editor #dropzone { background: var(--surface); padding: 20px; gap: 16px; border-color: #98a28c; border-radius: 10px; }
#editor #dropzone p { font-size: 12px; line-height: 1.6; }
#editor .upload > span { font-size: 15px; margin-bottom: 8px; }
#editor .upload input { color: transparent; font-size: 0; }
#editor .upload input::file-selector-button { font-family: var(--studio-font); font-size: 14px; width: 100%; padding: 12px; border-radius: 6px; margin: 0; }
#editor #upload-status { margin: 12px 0 0; }
#editor .photo-actions { margin: 12px 0; }
#editor .photo-actions button { min-height: 44px; font-size: 13px; }
#editor #family-collection { margin: 0 0 18px; border-top: 0; border-bottom: 1px solid var(--line); }
#editor #family-collection summary { padding: 0 0 14px; }
#editor #storyboard-area { margin-top: 24px; }
#editor #storyboard-area > p { font-size: 13px; }
#editor .storyboard-navigation { justify-content: space-between; align-items: center; gap: 8px; }
#editor .storyboard-navigation label { display: flex; align-items: center; gap: 8px; }
#editor .storyboard-navigation select { width: 110px; margin: 0; }
#editor #storyboard { grid-template-columns: repeat(auto-fill,minmax(126px,1fr)); gap: 10px; max-height: 680px; overflow: auto; padding: 4px; scrollbar-gutter: stable; }
#editor .story-tile { border-radius: 8px; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-color: var(--line); }
#editor .story-tile:has([aria-pressed="true"]) { background: var(--stone); border-color: var(--action); }
#editor .story-photo { border-radius: 4px; overflow: hidden; }
#editor .story-photo img { height: 104px; background: var(--surface); }
#editor .story-photo span { font-size: 12px; padding: 6px; }
#editor .story-select { margin: 0; justify-content: center; font-size: 12px; }
#editor .story-tile > button:not(.story-photo) { min-height: 44px; padding: 6px; background: transparent; }
#editor .storyboard-actions { background: var(--surface); border-radius: 8px; padding: 12px; font-size: 13px; }
#editor #story-selection { width: 100%; font-weight: 600; }
#editor .storyboard-actions label { font-size: 12px; flex: 1; }
#editor .storyboard-actions input { width: 100%; }
#editor .storyboard-actions button { font-size: 12px; padding: 10px; }
#editor #preview { display: block; border: 0; padding: 0; margin: 0; }
#editor #preview .section-heading { align-items: center; }
#editor #preview .section-heading h2 { margin-bottom: 12px; }
#editor .player { border-radius: 10px; background: var(--studio-mat); }
#editor .frame-controls { margin: 12px 0; }
#editor #preview > label { display: flex; align-items: center; gap: 16px; font-size: 13px; }
#editor #scene-selector { flex: 1; margin-top: 0; }
#editor #preview > .quiet { font-size: 12px; }
#editor .preview-actions { margin: 16px 0; }
#editor .preview-actions button { width: 100%; }
#editor .scene-inspector { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; margin-top: 24px; }
#editor .scene-inspector .inspector-composition { display: none; }
#editor .inspector-back { display: none; }
#editor #personalize { padding: 0; }
#editor .theme-example { display: none; }
#editor .theme-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 12px; }
#editor .theme-choices button { display: block; padding: 6px; text-align: left; font-size: 13px; background: #fff; }
#editor .theme-choices button[aria-pressed="true"] { border: 2px solid var(--action); padding: 5px; background: var(--stone); }
#editor .theme-choices img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: contain; border-radius: 4px; }
#editor .theme-choices strong, #editor .theme-choices span { display: block; padding: 6px 6px 0; }
#editor .theme-choices span { font-weight: 400; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
#editor #music-panel { margin-top: 24px; }
#editor #music-list li { padding: 20px; background: var(--surface); border: 0; border-radius: 8px; margin-bottom: 12px; }
#editor #music-list audio { height: 44px; }
#editor #music-coverage { padding: 16px; background: var(--stone); font-weight: 500; border-radius: 8px; }
#editor #export { margin: 0; padding: 0; border: 0; }
#editor #export h3 { font-size: 23px; }
#editor #render-export { width: 100%; }
#editor #render-status { background: var(--stone); border-radius: 8px; margin: 16px 0; }
#editor #download { width: 100%; }
#editor #project-privacy { margin-top: 40px; max-width: 720px; }
#editor #project-privacy button, #editor #family-collection button, #editor #private-sharing button { margin: 4px 4px 4px 0; }
/* Navigation changes the editing surface, not the canonical preview. */
body:not([data-step="personalize"]) #editor #personalize,
body:not([data-step="personalize"]) #editor #music-panel,
body:not([data-step="export"]) #editor #export,
body[data-step="personalize"] #editor #photos,
body[data-step="export"] #editor #photos,
body[data-step="personalize"] #editor #scene-inspector,
body[data-step="export"] #editor #scene-inspector { display: none; }
.studio-page .collection-page { max-width: 1000px; padding: 64px 32px; }
.studio-page .collection-page h1 { font-family: var(--studio-serif); font-size-adjust:.46; font-size: clamp(34px,5vw,54px); font-weight: 600; letter-spacing: -.02em; }
.studio-page .contribution-upload { background: var(--studio-mat); border: 0; border-radius: 12px; padding: 32px; }
.studio-page .contribution-privacy, .studio-page .viewing-note { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 24px 0 0; }
.studio-page .eyebrow { display: none; }
.studio-page #shared-video { border-radius: 12px; }
@media(min-width:1600px) { .studio-workspace { gap: 64px; } #editor #storyboard { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media(max-width:1000px) { .studio-workspace { gap: 24px; grid-template-columns: minmax(310px,.9fr) minmax(0,1fr); } body:has(#editor:not([hidden])) main { padding-inline: 24px; } #editor .editor-heading { align-items: start; } #editor .editor-heading > div + div { max-width: 280px; } }
@media(max-width:760px) {
 body:has(#editor:not([hidden])) .site-header, .studio-page .site-header { padding: 18px 16px; gap: 12px; }
 body:has(#editor:not([hidden])) .brand, .studio-page .brand { font-size: 20px; }
 body:has(#editor:not([hidden])) .dev, .studio-page .page-context { font-size: 12px; }
 body:has(#editor:not([hidden])) main { padding: 0 16px 32px; }
 #editor .editor-heading { display: block; }
 #editor h1 { font-size: 26px; }
 #editor .editor-heading > div + div { max-width: none; justify-content: flex-start; gap: 8px; margin-top: 16px; }
 #editor #save-status { flex: 1; }
 #editor #new { font-size: 12px; padding: 10px; }
 #editor .history-toolbar button { font-size: 12px; padding: 10px; }
 #editor .editor-nav { position: static; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 20px 0; }
 #editor .editor-nav a { font-size: 12px; padding: 12px 4px; text-align: center; min-width: 0; }
 .studio-workspace { display: flex; flex-direction: column; gap: 28px; }
 .studio-controls, .studio-stage { width: 100%; }
 .studio-stage { position: static; }
 #editor #preview { display: block; }
 body[data-step="photos"] #editor #preview { display: none; }
 body[data-step="preview"] .studio-stage { order: -1; }
 #editor .scene-inspector .inspector-composition { display: block; }
 #editor .inspector-back { display: inline-block; min-height: 44px; }
 #editor #storyboard { max-height: 620px; grid-template-columns: repeat(2,minmax(0,1fr)); }
 #editor .story-photo img { height: 122px; }
 #editor #dropzone { padding: 16px; gap: 12px; grid-template-columns: 1fr 1fr; }
 #editor #dropzone p { grid-row: 2; }
 #editor .upload > span { font-size: 13px; }
 #editor .upload input::file-selector-button { font-size: 12px; }
 #editor #preview > label { display: block; }
 #editor #scene-selector { width: 100%; margin-top: 8px; }
 #editor .frame-controls { gap: 6px; font-size: 12px; }
 #editor .frame-controls button { font-size: 12px; padding: 10px; }
 #editor #getting-started { font-size: 13px; padding: 14px; }
 .studio-page .collection-page { padding: 36px 16px; }
 .studio-page .contribution-upload { padding: 22px; }
 .studio-page .contribution-privacy, .studio-page .viewing-note { padding: 22px 0 0; }
 body:has(#editor:not([hidden])) footer, .studio-page footer { padding: 24px 16px; font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { #editor *, .studio-page * { scroll-behavior: auto; transition: none; } }
#editor #add-media { margin-bottom: 16px; }
#editor #add-media summary { padding: 14px 0; }
#editor .story-tile { grid-template-columns: repeat(3,minmax(0,1fr)); }
#editor .story-photo { grid-column: 1 / -1; }
#editor .story-select { grid-column: auto; }
#editor .story-select span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#editor .storyboard-actions[data-empty="true"] > :not(#story-selection) { display: none; }
#editor #render-status label { display: block; }
.studio-mark { display: none; }
body:has(#editor:not([hidden])) .brand { display: inline-flex; align-items: center; gap: 10px; }
body:has(#editor:not([hidden])) .studio-mark { display: block; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; }
#editor .track-region { font-size: 12px; margin: 8px 0; font-variant-numeric: tabular-nums; }
#editor #duration, #editor #selected-label, #editor #progress { font-variant-numeric: tabular-nums; }
@media(max-width:760px) { body[data-step="personalize"] .studio-stage { order: -1; } }
#editor #render-status button { margin: 6px 6px 0 0; }
@media(min-width:1100px) {
 #editor #personalize { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
 #editor #personalize > * { grid-column: 1 / -1; }
 #editor #personalize > label:has(#name), #editor #personalize > label:has(#dates) { grid-column: auto; }
}
#editor .storyboard-navigation { display: grid; grid-template-columns: 1fr 1.2fr 1fr; max-width: none; }
#editor .storyboard-navigation label { display: block; font-size: 0; }
#editor .storyboard-navigation select { width: 100%; font-size: 13px; }
#editor .storyboard-navigation button { padding-inline: 8px; font-size: 13px; }
@media(max-width:760px) { #editor .scene-inspector { margin-top: 0; } }
.studio-page .recovery-page { max-width: 650px; padding: 64px 24px 88px; }
.studio-page .recovery-page h1 { font-size: clamp(30px,5vw,42px); font-weight: 600; letter-spacing: -.03em; }
.studio-page .recovery-page form { margin: 32px 0; padding: 24px; background: var(--studio-mat); border-radius: 12px; }
.studio-page .recovery-page form label { margin-bottom: 0; }
.studio-page #recover-status { margin: 16px 0 0; }
.studio-page #recovery-help { margin-top: 12px; }
/* Direct editor entry and saved-project fallback share the approved workspace. */
.studio-page .workspace-entry { max-width: 640px; margin: 48px auto; padding-block: 24px; }
.studio-page .workspace-entry h1 { font-family: var(--studio-serif); font-size-adjust:.46; font-size: 36px; font-weight: 600; }
.studio-page .workspace-entry > p { max-width: 52ch; }
.studio-page .workspace-entry #recent { margin-top: 24px; }

/* Photo preparation keeps decisions beside the original photographs. */
.photo-review { margin-block: 1rem; padding-block: 1rem; border-block: 1px solid var(--border, #dce0d8); }
.photo-review .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.photo-review-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1rem; }
.photo-review-pair figure { margin: 0; min-width: 0; }
.photo-review-pair img { width: 100%; height: 260px; object-fit: contain; background: #f4f5f1; }
.photo-review-pair figcaption { margin-block: .5rem; font-size: .85rem; }
.photo-review-pair button { width: 100%; }
@media (max-width: 540px) {
  .photo-review-pair { grid-template-columns: 1fr; }
  .photo-review-pair img { height: 210px; }
  .photo-review .section-heading { align-items: flex-start; }
}
.scan-source { position: relative; max-width: 780px; margin-block: 1rem; }
.scan-source img { display: block; width: 100%; height: auto; }
.scan-source svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.scan-source polygon { fill: #62704b22; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.scan-source circle { fill: #52643b; stroke: white; stroke-width: .4; cursor: grab; }
.scan-corners { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
@media(max-width:540px) { .scan-corners { grid-template-columns: 1fr; } }

.scan-source .scan-hit { fill: transparent; stroke: none; pointer-events: all; }
.library-track { padding-block: 1rem; border-bottom: 1px solid #dce0d8; }
.library-track h4, .library-track p { margin-block: .4rem; }
.library-track audio { display: block; width: 100%; margin-block: .6rem; }
.order-preview { list-style: none; margin: 1rem 0; padding: 0; }
.order-preview li { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: .75rem; padding-block: .75rem; border-bottom: 1px solid #dce0d8; }
.order-preview img { width: 72px; height: 60px; object-fit: contain; background: #f4f5f1; }
.order-preview p { margin-block: .4rem; }
.chapter-order-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: .5rem; margin-block: .6rem; }
#batch-organization { flex-basis: 100%; }
.chapter-order-row span, .order-preview strong, .order-preview p { overflow-wrap: anywhere; }

/* Keep limits with their controls and secondary text readable. */
#editor #dropzone .upload-limits { grid-column: 1 / -1; margin: 0; padding-top: 8px; border: 0; border-top: 1px solid var(--line); }
#editor #dropzone .upload-limits summary { padding: 8px 0; font-size: 13px; }
#editor #count { margin-inline-start: .3em; color: var(--muted); font-weight: 400; }

#editor .storyboard-actions #story-help { flex-basis: 100%; margin: 0; }

#timing-review { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
#timing-review::backdrop { background: rgb(20 25 20 / .45); }
#timing-review h2 { margin-top: 0; font-size: 24px; }
#timing-review p { line-height: 1.6; }
#timing-review .actions { display: flex; flex-wrap: wrap; gap: 12px; }
#match-music { margin-block: 8px; }

#family-draft-review { margin-top: 20px; }
.reviewing-page video { display: block; width: 100%; max-height: 65vh; margin-block: 24px; background: #20251d; }
.reviewing-page video[hidden], .reviewing-page form[hidden] { display: none; }
#feedback-form { margin-block: 28px; max-width: 680px; }
#feedback-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
#feedback-fields textarea { width: 100%; }
.review-comment { padding-block: 20px; border-top: 1px solid var(--line); }
.review-comment h4 { margin-bottom: 8px; }
.review-comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
#review-comments:empty { display: none; }

.contribution-clip { display: block; width: 180px; max-width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #20251d; }
@media(max-width:600px) { .contribution:has(.contribution-clip) { flex-wrap: wrap; } .contribution-clip { width: 100%; } }

.contribution > div { min-width: 0; overflow-wrap: anywhere; }
.review-comment { overflow-wrap: anywhere; }

/* Guided studio: neutral work surfaces, explicit controls, one active step. */
body:has(#editor:not([hidden])) { background: #f2f3ee; --input-line: #77836c; }
body:has(#editor:not([hidden])) .site-header { background: #fff; padding-block: 16px; }
body:has(#editor:not([hidden])) main { max-width: 1600px; }
#editor { padding-top: 22px; }
#editor .editor-heading { margin-bottom: 20px; }
#editor .editor-heading h1 { font-size: 25px; }
#editor .editor-heading > div + div { gap: 8px; }
#editor button { background: #f8f9f5; border-color: #77836c; font-size: 14px; }
#editor button:hover:not(:disabled) { background: #e6ecdc; border-color: #384829; }
#editor button.primary, #editor #render-preview, #editor #render-export, #editor .download { color: #fff; background: #44532e; border-color: #44532e; }
#editor button.primary:hover, #editor #render-preview:hover, #editor #render-export:hover { background: #303f20; }
#editor input:not([type=checkbox]):not([type=range]):not([type=file]), #editor select, #editor textarea { background: #fcfcfa; border: 1px solid #77836c; min-height: 48px; padding: 12px; font-size: 16px; }
#editor select { border-width: 2px; padding: 10px 12px; cursor: pointer; }
#editor label { color: #283123; font-size: 14px; font-weight: 600; }
#editor .quiet { color: #526047; line-height: 1.65; }
#editor .editor-nav { background: #fff; border: 1px solid #b3bca9; border-radius: 8px; padding: 5px; gap: 5px; margin: 0 0 24px; }
#editor .editor-nav a { min-height: 52px; border: 0; border-radius: 5px; color: #3d4935; font-weight: 600; }
#editor .editor-nav a:hover { background: #edf0e5; }
#editor .editor-nav a[aria-current] { background: #44532e; color: #fff; border-radius: 5px; }
.workspace-guide { margin: 0 0 24px; max-width: 800px; }
#editor .workspace-guide h2 { font-size: 23px; margin: 0 0 7px; }
.workspace-guide p { color: #526047; font-size: 15px; margin: 0; }
.studio-workspace { grid-template-columns: minmax(340px,.82fr) minmax(0,1.18fr); gap: 24px; align-items: start; }
.studio-controls { background: #fff; border: 1px solid #d4dacb; padding: 24px; border-radius: 10px; }
.studio-stage { background: #fff; border: 1px solid #d4dacb; padding: 20px; border-radius: 10px; top: 16px; }
#editor #preview .section-heading h2 { font-size: 18px; margin-bottom: 14px; }
#editor #personalize > h2, #editor #photos > .section-heading h2 { font-size: 20px; }
#editor #personalize > label { margin-bottom: 18px; }
#editor details { border: 1px solid #aeb9a2; border-radius: 6px; margin-top: 16px; padding: 0 16px; background: #fcfcf9; }
#editor summary { padding: 16px 0; color: #303e25; font-size: 15px; }
#editor details[open] > summary { border-bottom: 1px solid #d4dacb; margin-bottom: 16px; }
#editor #family-collection { border: 1px solid #aeb9a2; margin-bottom: 18px; }
#editor #family-collection summary, #editor #add-media summary { padding: 16px 0; }
#editor .theme-choices { gap: 10px; margin-top: 12px; }
#editor .theme-choices button { position: relative; padding: 7px; border: 2px solid #bdc5b4; background: #fff; overflow: hidden; }
#editor .theme-choices button[aria-pressed=true] { padding: 7px; border: 2px solid #44532e; background: #e9efdf; }
#editor .theme-choices img { background: #f1f2eb; }
.selection-tag { display: none; }
#editor .theme-choices button[aria-pressed=true] .selection-tag { display: block; position: absolute; top: 7px; right: 7px; padding: 5px 8px; background: #44532e; color: #fff; font: 600 12px var(--studio-font); border-radius: 3px; }
#editor .theme-choices strong { padding-top: 10px; font-size: 13px; }
#editor .theme-choices span { font-size: 12px; line-height: 1.5; }
#editor #music-panel { margin-top: 20px; }
#editor #photo-list .photo { padding: 0; border: 0; background: transparent; }
#editor #project-privacy { background: #fff; padding: 0 20px; max-width: none; }
#editor .storyboard-actions { border: 1px solid #bac4ad; background: #f0f3e9; }
#editor .story-tile { border-color: #a8b49b; }
#editor .story-tile:has([aria-pressed=true]) { outline: 2px solid #44532e; outline-offset: -2px; background: #e9efdf; }
#editor #getting-started { border: 1px solid #bac4ad; }
@media(max-width:1100px) { .studio-workspace { grid-template-columns: minmax(310px,.9fr) minmax(0,1fr); gap: 18px; } .studio-controls { padding: 18px; } .studio-stage { padding: 16px; } }
@media(max-width:760px) {
 #editor .editor-heading h1 { font-size: 24px; }
 #editor .editor-nav { gap: 3px; margin-bottom: 20px; padding: 4px; }
 #editor .editor-nav a { min-height: 54px; padding: 10px 3px; font-size: 12px; }
 #editor .workspace-guide h2 { font-size: 21px; }
 .workspace-guide p { font-size: 14px; }
 .studio-controls, .studio-stage { padding: 16px; border-radius: 8px; }
 .studio-workspace { gap: 20px; }
 #editor details { padding-inline: 12px; }
 #editor .theme-choices { gap: 8px; }
 #editor .theme-choices strong { font-size: 12px; }
 #editor .theme-choices span { font-size: 12px; padding-inline: 2px; }
}
@media(max-width:760px) {
 /* Personalizing keeps a compact still nearby; scene navigation lives in Preview & edit. */
 body[data-step="personalize"] #editor #preview .frame-controls,
 body[data-step="personalize"] #editor #preview > label,
 body[data-step="personalize"] #editor #family-draft-review { display: none; }
}
#editor .motion-choice { padding: 14px; border: 1px solid #aeb9a2; border-radius: 6px; margin-top: 18px; background: #f5f7ef; }
#editor .motion-choice .check { margin: 0; }
#editor .motion-choice p { margin: 8px 0 0; font-size: 13px; }

/* Spacing rhythm: 8px within actions, 16px between controls, 24px between tasks. */
#editor { --control-gap: 16px; --action-gap: 8px; }
#editor input:not([type=checkbox]):not([type=range]):not([type=file]), #editor select, #editor textarea { margin-top: 8px; }
#editor #personalize > label { margin-bottom: var(--control-gap); }
#editor #personalize > h3 { margin-top: 8px; margin-bottom: 12px; }
#editor #personalize > .theme-choices { margin-top: 0; }
#editor #personalize > .motion-choice { margin-top: 0; }
#editor .two { gap: var(--control-gap); margin-bottom: var(--control-gap); }
#editor .two > label:not(.check) { display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 0; }
#editor details[open]:not(#add-media) { padding-bottom: var(--control-gap); }
#editor details[open]:not(#add-media) > :last-child { margin-bottom: 0; }
#editor details + label { margin-top: var(--control-gap); }
#editor button + p { margin-top: var(--action-gap); }
#editor .photo .tools { gap: var(--action-gap); margin: var(--control-gap) 0; }
#editor .photo label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 10px; min-height: 44px; }
#editor .photo label:has(input[type=checkbox]) input { order: -1; }
#editor #music-list { margin: var(--control-gap) 0; }
#editor #music-list > li > details { margin-bottom: 12px; }
#editor #music-status { margin-block: var(--control-gap); }
#editor #music-coverage { margin: 12px 0 var(--control-gap); }
#editor #match-music + .quiet { margin-top: var(--action-gap); margin-bottom: 20px; }
#editor #private-sharing > p:last-child { margin-top: 12px; }
@media(max-width:760px) {
 #editor #music-list > li { padding: 16px 12px; }
 #editor #music-list details { padding-inline: 10px; }
 #editor .two { column-gap: 12px; }
}

/* Three distinct tasks; keep advanced editing out of the default reading path. */
#editor .editor-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
#editor .editor-nav a { text-decoration: none; }
#editor .history-toolbar button { padding-inline: 14px; }
#editor button { background: #e8eddf; border-color: #52633e; font-weight: 600; }
#editor button:hover:not(:disabled) { background: #dce5ce; border-color: #354524; }
#editor button.primary, #editor #render-preview, #editor #render-export { background: #44532e; color: #fff; }
#editor input:not([type=checkbox]):not([type=range]):not([type=file]), #editor textarea { background: #fff; border-color: #87927b; }
#editor select { appearance: none; background: #f0f4e8 url("/static/select-chevron.svg") no-repeat right 12px center / 18px; border: 2px solid #52633e; padding-right: 40px; }
#editor details > summary { font-weight: 650; }
#editor #personalize > h2 { margin-bottom: 20px; }
#editor .step-next { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 12px 18px; margin-top: 24px; border-radius: 6px; background: #44532e; color: #fff; font-weight: 600; text-decoration: none; }
body:not([data-step="personalize"]) #continue-preview { display: none; }
body:not([data-step="export"]) #editor .preview-actions,
body:not([data-step="export"]) #editor #family-draft-review { display: none; }
body[data-step="export"] #editor #preview .frame-controls,
body[data-step="export"] #editor #preview > label { display: none; }
#editor #preview:has(#video:not([hidden])) .preview-hint { display: none; }
#editor .album-hint { font-size: 13px; }
#editor .photo .tools { border-top: 1px solid #c4cdb8; padding-top: 16px; }
@media(max-width:760px) {
 #editor .editor-nav a { min-height: 52px; font-size: 13px; line-height: 1.4; }
 body[data-step="export"] .studio-stage { order: -1; }
 #editor .step-next { margin-top: 20px; }
}
@media(forced-colors:active) { #editor select { appearance: auto; background-image: none; } }
body[data-step="export"] #editor .preview-actions { display: flex; }
#editor .storyboard-actions[data-empty="true"] { display: none; }
#editor #continue-personalize { margin-top: 20px; }
#editor #photo-tools .photo-actions { margin: 0; }
#editor #photo-tools { margin-block: 16px 20px; }
#editor .storyboard-navigation select { padding-inline: 8px 26px; background-position: right 6px center; background-size: 14px; }
