/* Customer-authored books have an explicit story approval before illustration. */
.custom-checkout-action{max-width:1100px;margin:24px auto;text-align:right}.custom-checkout-action .button{white-space:normal}
.custom-steps{display:flex;list-style:none;gap:24px;padding:0;margin:0 auto 38px;max-width:1100px;color:var(--muted,#797087);font-size:13px}.custom-steps li{display:flex;align-items:center;gap:9px;flex:1}.custom-steps li>span{display:grid;place-items:center;flex:0 0 30px;height:30px;border:1px solid #d9cef0;border-radius:50%;font-weight:800}.custom-steps li[aria-current]{color:#7257d8;font-weight:800}.custom-steps li[aria-current]>span,.custom-steps .complete>span{background:#7257d8;color:white;border-color:#7257d8}.custom-steps .complete{color:#7257d8}
#magic-home .custom-create{display:block;max-width:980px;padding-top:0}#magic-home .custom-create .custom-intro{text-align:center;max-width:none;margin-bottom:32px}#magic-home .custom-create .custom-intro h1{font-size:clamp(28px,3.5vw,44px);line-height:1.2;letter-spacing:-1.5px;color:var(--text,#2c253e);margin:12px auto 16px}#magic-home .custom-create .custom-intro>p:not(.eyebrow){max-width:630px;margin:auto;color:var(--muted,#797087);font-size:16px;line-height:1.75}#magic-home .custom-create .eyebrow{color:#7257d8}#magic-home .custom-create .story-builder{padding:32px;background:var(--surface,#fff);border:1px solid #e3d9f2;border-radius:24px;box-shadow:0 12px 48px #3c1e6809;max-width:760px;margin:auto;color:var(--text,#2c253e)}#magic-home .custom-create .builder-step{margin:0 0 28px;padding:0 0 28px;border-bottom:1px solid #e5ddf0}#magic-home .custom-create .builder-step:last-of-type{border:0;padding-bottom:0}#magic-home .custom-create .builder-step .builder-kicker{display:none}#magic-home .custom-create .story-summary{display:none}#magic-home .custom-create .builder-step h3{font-size:20px;color:inherit}#magic-home .custom-create .builder-step[data-step="2"]>h3{display:none}#magic-home .custom-create .summary-note{margin-top:14px}#magic-home .custom-create .builder-actions{margin-top:20px}#magic-home .custom-create #builderSubmit{width:100%;justify-content:center;background:#7257d8;color:white;border:0;min-height:52px}#magic-home .custom-create .book-language legend{font-weight:700}.custom-photo-guide{margin:24px 0 12px}.custom-photo-guide>strong{font-size:14px}.custom-photo-guide>p{font-size:12px;line-height:1.7;margin:6px 0 12px;color:#797087}.photo-examples{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.photo-examples figure{margin:0;min-width:0}.photo-examples figure>div{width:100%;aspect-ratio:3/5;max-height:150px;border-radius:12px;background-image:url('/api/shop/static-media/photo-guide-v1.webp');background-size:500% auto;background-position:var(--photo-position) center;border:2px solid #efdddd}.photo-examples .good-example>div{border-color:#76ba9e}.photo-examples figcaption{font-size:11px;line-height:1.5;margin-top:7px;display:flex;gap:4px;align-items:center}.photo-examples figcaption b{font-size:16px;color:#c45360}.photo-examples .good-example figcaption b{color:#247756}.custom-photo-guide>small{display:block;font-size:10px;color:#797087;margin-top:5px}#magic-home .custom-create .upload-field{display:flex;align-items:center;min-height:85px;border-radius:14px}#magic-home .custom-create #builderPhotoPreview{width:64px;height:64px;object-fit:cover;border-radius:12px;margin-left:auto}
.custom-workspace{--custom-border:#dfd5ef;--custom-muted:#7b718e;max-width:1100px;margin:auto;color:var(--text,#2c253e)}.custom-workspace h1{font-size:clamp(27px,3.2vw,42px);letter-spacing:-1px;line-height:1.2}.custom-workspace p{line-height:1.75}.custom-review-head{max-width:760px;margin-bottom:32px}.custom-review-head .eyebrow{color:#7257d8;font-size:12px;font-weight:700}.custom-review-head>p:last-child{color:var(--custom-muted);font-size:15px;margin-top:14px}.custom-story-editor{border:0;padding:0;margin:0;min-width:0}.custom-workspace label{display:block;font-size:13px;font-weight:600;line-height:1.6}.custom-workspace input:not([type=checkbox]):not([type=file]),.custom-workspace textarea{display:block;width:100%;font:inherit;font-size:15px;font-weight:400;color:inherit;border:1px solid var(--custom-border);border-radius:12px;padding:14px 16px;background:var(--surface,#fff);margin-top:8px;line-height:1.8;resize:vertical;box-sizing:border-box}.custom-workspace textarea:focus,.custom-workspace input:focus{outline:2px solid #7257d8;outline-offset:2px}.custom-workspace input[data-custom-title]{font-size:22px;font-weight:700}.custom-scenes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:26px}.custom-scene{padding:18px;background:var(--surface,#fff);border:1px solid var(--custom-border);border-radius:16px;min-width:0}.custom-scene>span{display:flex;align-items:center;justify-content:space-between;color:#7257d8}.custom-scene small{font-size:11px;font-weight:400;color:var(--custom-muted)}.custom-scene textarea{border-color:transparent!important;background:transparent!important;padding:8px 0!important;font-size:15px;min-height:124px}.custom-save-bar{position:sticky;bottom:16px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--surface,#fff);padding:16px 20px;border:1px solid var(--custom-border);border-radius:16px;box-shadow:0 8px 30px #3a22551a;margin:24px 0 44px}.custom-save-bar p{font-size:13px;color:var(--custom-muted);margin:0}.custom-workspace .button{font-size:13px;min-height:44px;white-space:normal}.custom-workspace button:disabled{opacity:.5;cursor:not-allowed}.custom-cast{padding:28px;border:1px solid var(--custom-border);background:var(--surface,#fff);border-radius:20px;margin:24px 0}.custom-cast h2{font-size:23px}.custom-cast h2>span{display:inline-grid;place-items:center;min-width:30px;height:30px;border-radius:50%;background:#eee8fa;color:#7257d8;font-size:15px;margin-left:5px}.custom-cast>p{font-size:14px;color:var(--custom-muted);max-width:750px;margin:12px 0 22px}.custom-cast-list{display:flex;flex-wrap:wrap;gap:26px}.custom-person{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;width:126px;font-size:13px}.custom-avatar{width:88px;height:88px;border:2px dashed #c9b7e8;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#f0eafa}.custom-avatar img{width:100%;height:100%;object-fit:cover}.custom-avatar>span{font-size:28px;color:#8d70c1}.custom-person>small{font-size:11px;color:var(--custom-muted)}.custom-photo-button{position:relative;color:#7257d8;cursor:pointer;font-size:11px!important;padding:5px 8px;border-radius:7px;border:1px solid #d9cbed;overflow:hidden}.custom-photo-button:has(input:disabled){opacity:.45;cursor:not-allowed}.custom-photo-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:inherit}.custom-photo-consent{display:flex!important;align-items:center;gap:9px;margin-top:24px;font-size:12px!important;color:var(--custom-muted)}.custom-photo-consent input{accent-color:#7257d8;width:16px;height:16px}.custom-feedback{padding:24px;border-radius:18px;background:#7257d80b;border:1px solid var(--custom-border)}.custom-feedback .button{margin-top:14px}.custom-approval{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:28px 0}.custom-approval>p{max-width:430px;font-size:13px;color:var(--custom-muted)}.custom-approval .button{flex-shrink:0}.custom-writing{padding:48px 24px;text-align:center;max-width:760px}.custom-spark{font-size:48px;color:#7257d8}.custom-writing h1{margin:20px 0 12px}.custom-progress{text-align:left;margin:28px 0;padding:24px;border:1px solid var(--custom-border);border-radius:16px;background:var(--surface,#fff)}.custom-progress>div{display:flex;justify-content:space-between;gap:16px;font-size:13px}.custom-progress progress{width:100%;height:8px;border:0;border-radius:99px;margin:16px 0 0;accent-color:#7257d8;overflow:hidden}.custom-progress progress::-webkit-progress-bar{background:#eee8fa;border-radius:99px}.custom-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#7257d8,#c85fdf);border-radius:99px;transition:width .6s}.custom-progress>p{font-size:12px;color:var(--custom-muted);margin:8px 0 0}
.custom-image-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:stretch}.custom-image-card{border:1px solid var(--custom-border);border-radius:20px;overflow:hidden;background:var(--surface,#fff);min-width:0;display:flex;flex-direction:column}.custom-image-art{aspect-ratio:1.4;background:#eee8fa;display:grid;place-items:center;padding:12px}.custom-image-art img{width:100%;height:100%;max-height:360px;object-fit:contain;border-radius:8px}.custom-image-art.is-cover img{max-width:75%;height:auto;aspect-ratio:1;box-shadow:4px 8px 16px #23142f30}.custom-image-info{padding:22px;display:flex;flex-direction:column;flex:1}.custom-image-info h2{font-size:18px}.custom-image-info>p{font-size:14px;color:var(--custom-muted);margin:10px 0 18px}.custom-image-info>label{margin-top:auto;font-size:12px}.custom-image-info textarea{font-size:13px}.custom-image-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}.custom-image-actions small{font-size:11px;color:var(--custom-muted)}.custom-image-actions .button{font-size:11px;padding:10px 14px}.custom-image-placeholder{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;color:#7257d8;min-height:180px;text-align:center;font-size:28px}.custom-image-placeholder strong{font-size:18px}.custom-image-placeholder small{font-size:12px}.custom-continue{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:28px;border-radius:20px;background:#7257d812;border:1px solid var(--custom-border);margin-top:30px}.custom-continue h2{font-size:23px}.custom-continue p{font-size:13px;color:var(--custom-muted);margin-top:8px;max-width:560px}.custom-continue .button{flex-shrink:0}.custom-back-books{display:inline-block;margin:0 0 28px;color:#7257d8}.custom-workspace .form-error:empty{display:none}
[data-theme=dark] .custom-workspace{--custom-border:#4c405f;--custom-muted:#bbb0cd}[data-theme=dark] .custom-scene,[data-theme=dark] .custom-cast,[data-theme=dark] .custom-progress,[data-theme=dark] .custom-save-bar,[data-theme=dark] .custom-image-card{background:#231d32}[data-theme=dark] .custom-workspace textarea,[data-theme=dark] .custom-workspace input:not([type=checkbox]):not([type=file]){background:#211b30}[data-theme=dark] .custom-image-art{background:#30263f}
@media(max-width:700px){.custom-steps{gap:8px;margin-bottom:26px;font-size:10px}.custom-steps li{flex-direction:column;text-align:center;gap:6px}.custom-steps li>span{flex-basis:26px;width:26px;height:26px}#magic-home .custom-create .story-builder{padding:20px 16px}#magic-home .custom-create .custom-intro>p:not(.eyebrow){font-size:14px}.photo-examples{gap:6px}.photo-examples figcaption{font-size:9px;gap:3px}.photo-examples figure>div{border-radius:8px}.custom-scenes,.custom-image-grid{grid-template-columns:1fr}.custom-scene{padding:16px}.custom-save-bar{bottom:8px;padding:12px;gap:12px}.custom-save-bar p{font-size:11px}.custom-save-bar .button{min-width:112px;padding:10px}.custom-cast{padding:20px 16px}.custom-cast-list{gap:20px 12px}.custom-person{width:calc((100% - 24px)/3);font-size:12px}.custom-avatar{width:72px;height:72px}.custom-feedback{padding:18px}.custom-approval,.custom-continue{flex-direction:column;align-items:stretch;gap:14px}.custom-approval .button,.custom-continue .button{width:100%;justify-content:center}.custom-image-info{padding:18px}.custom-writing{padding:25px 0}.custom-progress{padding:18px}.custom-image-art img{max-height:320px}.custom-workspace input[data-custom-title]{font-size:19px}.custom-continue{padding:22px}.custom-workspace .button{font-size:12px}}
@media(prefers-reduced-motion:reduce){.custom-progress progress::-webkit-progress-value{transition:none}}
/* A single, compact customer workspace. Sticky navigation belongs to this panel. */
.custom-app{--custom-border:#dfd5ef;--custom-muted:#7b718e;position:relative;max-width:1120px;margin:0 auto;border:1px solid var(--custom-border);border-radius:24px;background:var(--surface,#fff);box-shadow:0 16px 54px #3723570a;isolation:isolate}
.custom-app>.custom-steps,#customCreateSteps{position:sticky;top:0;z-index:12;background:var(--surface,#fff);border-radius:24px 24px 0 0;border-bottom:1px solid var(--custom-border);box-shadow:0 5px 16px #37235705}
.custom-app .custom-steps{max-width:none;margin:0;padding:20px 28px;gap:0;align-items:center}
.custom-app .custom-steps li{position:relative;gap:9px;flex:1;min-width:0;white-space:nowrap;font-size:12px}
.custom-app .custom-steps li:last-child{flex:0 0 auto}.custom-app .custom-steps li::after{content:'';height:1px;min-width:12px;flex:1;margin:0 18px;background:#e4ddef}.custom-app .custom-steps li.complete::after{background:#ad9ae5}.custom-app .custom-steps li:last-child::after{display:none}.custom-app .custom-steps b{font-weight:500}.custom-app .custom-steps [aria-current] b{font-weight:800}
.custom-app>.custom-workspace{padding:32px;max-width:none;margin:0}.custom-app>.custom-writing{min-height:380px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 32px}.custom-writing .custom-progress{width:100%;max-width:650px}.custom-app .custom-review-head{margin-bottom:24px}.custom-app .custom-feedback{margin:0 0 28px;background:linear-gradient(120deg,#7257d80c,#c85fdf08)}.custom-app .custom-feedback textarea{background:var(--surface,#fff);margin-top:10px}.custom-app .custom-feedback>label{font-size:15px;font-weight:800}.custom-app .custom-feedback .button{font-size:12px}.custom-app .custom-save-bar{margin-bottom:28px}
#magic-home .custom-create.custom-app{max-width:980px;padding:0 0 28px;border:1px solid var(--custom-border);border-radius:24px;background:var(--surface,#fff);gap:0}#magic-home .custom-create .custom-intro{padding:26px 24px 0;margin:0 auto 24px}#magic-home .custom-create .custom-intro h1{font-size:clamp(27px,3vw,36px);margin:8px auto 12px;letter-spacing:-1px}#magic-home .custom-create .custom-intro>p:not(.eyebrow){font-size:14px;line-height:1.65;max-width:580px}#magic-home .custom-create .custom-intro .eyebrow{font-size:11px;margin:0}#magic-home .custom-create .story-builder{min-height:0;height:auto;box-shadow:none;border:0;border-radius:0;padding:0 28px;max-width:800px;width:100%}#magic-home .custom-create .builder-step{min-height:0;height:auto;margin:0 0 20px;padding:0 0 20px}#magic-home .custom-create .builder-step h3{margin-bottom:16px;font-size:18px}#magic-home .custom-create .builder-step[data-step="2"]{padding-bottom:0;border:0;margin-bottom:18px}#magic-home .custom-create .builder-actions{margin-top:16px}#magic-home .custom-create .photo-consent{display:flex;align-items:flex-start;gap:10px;line-height:1.6;font-size:12px;margin:0}#magic-home .custom-create .photo-consent input{margin-top:3px;flex-shrink:0;accent-color:#7257d8}#magic-home .custom-create .form-error:empty{display:none}#magic-home .custom-create .summary-note{margin:10px 0 0}.custom-photo-guide{margin-top:20px}
.custom-percent{display:inline-flex;align-items:center;gap:10px;font-weight:700;color:#7257d8;white-space:nowrap}.custom-spinner{display:inline-block;flex:0 0 auto;width:17px;height:17px;border:2px solid #7257d829;border-top-color:#7257d8;border-right-color:#7257d8;border-radius:50%;animation:custom-spin .9s linear infinite}.custom-spinner-large{width:50px;height:50px;border-width:4px}.button .custom-spinner{border-color:#ffffff45;border-top-color:currentColor;border-right-color:currentColor;margin-right:8px}.custom-writing [data-custom-run]{margin-top:8px}
.custom-rewrite-overlay{position:absolute;inset:0;z-index:90;display:grid;place-items:start center;padding:24px;background:#eae4f15c;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);outline:none}.custom-overlay-card{position:sticky;top:calc(var(--custom-header-height,0px) + 24px);width:min(100%,460px);padding:30px;border-radius:24px;border:1px solid #d9ceeb;background:var(--surface,#fff);box-shadow:0 24px 100px #251c4130;text-align:center;color:var(--text,#2c253e)}.custom-overlay-card h2{font-size:23px;line-height:1.4;margin:18px 0 0}.custom-overlay-card .custom-progress{border:0;padding:0;margin:24px 0}.custom-overlay-card .form-error{font-size:13px;line-height:1.65;margin:12px 0}.custom-overlay-card .form-error:empty{display:none}.custom-overlay-card .button{font-size:13px;max-width:100%;white-space:normal}.custom-overlay-card .custom-progress>div{align-items:center;line-height:1.5}.custom-overlay-card .custom-progress p{line-height:1.6}
@keyframes custom-spin{to{transform:rotate(360deg)}}
[data-theme=dark] .custom-app{--custom-border:#4c405f;--custom-muted:#bbb0cd;background:#231d32}[data-theme=dark] .custom-app>.custom-steps,[data-theme=dark] #customCreateSteps,[data-theme=dark] .custom-overlay-card{background:#231d32}[data-theme=dark] .custom-rewrite-overlay{background:#17112066}
@media(max-width:700px){.custom-app{border-radius:18px}.custom-app>.custom-steps,#customCreateSteps{border-radius:18px 18px 0 0}.custom-app .custom-steps{padding:14px 8px;align-items:flex-start}.custom-app .custom-steps li,.custom-app .custom-steps li:last-child{flex:1;flex-direction:column;font-size:9px;gap:6px;white-space:normal}.custom-app .custom-steps li::after{position:absolute;left:calc(50% + 19px);top:13px;right:calc(-50% + 19px);margin:0;min-width:0}.custom-app .custom-steps b{line-height:1.4}.custom-app>.custom-workspace{padding:24px 16px}.custom-app>.custom-writing{min-height:340px}.custom-app .custom-review-head h1{font-size:27px}.custom-app .custom-feedback{padding:16px;margin-bottom:22px}.custom-app .custom-feedback>label{font-size:14px}#magic-home .custom-create.custom-app{border-radius:18px;padding-bottom:20px}#magic-home .custom-create .custom-intro{padding:22px 16px 0;margin-bottom:24px}#magic-home .custom-create .custom-intro h1{font-size:28px}#magic-home .custom-create .story-builder{padding:0 16px}.custom-overlay-card{padding:24px 20px}.custom-rewrite-overlay{padding:16px}.custom-app .custom-scenes{gap:14px}.custom-app .custom-scene{padding:14px}.custom-app .custom-progress{padding:18px 14px}}
@media(prefers-reduced-motion:reduce){.custom-spinner{animation-duration:2.5s}}
#magic-home .custom-create.custom-app{overflow:visible}.custom-app>.custom-steps,#customCreateSteps{top:var(--custom-header-height,0px)}.custom-progress.is-paused .custom-spinner,.custom-rewrite-overlay.is-paused .custom-spinner{animation-play-state:paused}
#magic-home .custom-create .upload-field{position:relative;overflow:hidden;min-width:0}#magic-home .custom-create .upload-field input[type=file]{inset:0;width:100%;max-width:100%;min-width:0}#magic-home .custom-create.custom-app{margin-inline:auto}
/* Story history, typed cast and separate text placement controls. */
.custom-back-step{display:inline-flex;align-items:center;gap:7px;border:0;background:transparent;color:#7257d8;font:inherit;font-size:13px;padding:8px 0;margin:0 0 16px;cursor:pointer}.custom-refresh{border:1px dashed #cbbbe9;border-radius:18px;background:linear-gradient(135deg,#7257d80a,#c85fdf0a);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:24px;gap:12px}.custom-refresh>button{display:flex;align-items:center;gap:14px;border:0;border-radius:50px;color:white;background:#7257d8;box-shadow:0 6px 22px #7257d826;padding:14px 32px;cursor:pointer;min-height:60px}.custom-refresh>button>span{font-size:36px;line-height:1}.custom-refresh>button>strong{font-size:18px;letter-spacing:1px}.custom-refresh>b{font-size:14px}.custom-refresh>p{font-size:12px;color:var(--custom-muted);margin:0;max-width:360px}.custom-history{margin:28px 0}.custom-history h2{font-size:20px;margin-bottom:14px}.custom-history>div{display:flex;gap:12px;overflow-x:auto;padding:3px 0 14px}.custom-history article{padding:18px;border:1px solid var(--custom-border,#dfd5ef);border-radius:14px;background:var(--surface,#fff);min-width:240px;max-width:360px;display:flex;flex-direction:column;gap:12px}.custom-history article>small{font-size:11px;color:var(--muted)}.custom-history article>strong{font-size:14px}.custom-history article>div{display:flex;gap:8px}.custom-history .button{font-size:12px;min-height:36px;padding:7px 14px}.custom-history-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;border-top:1px solid #dfd5ef;padding:14px 0}.custom-history-row strong{flex:1 1 100%}
.custom-cast-editors{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.custom-character-editor{display:flex;gap:14px;align-items:flex-start;background:var(--surface,#fff);border:1px solid var(--custom-border);padding:18px;border-radius:16px;min-width:0}.custom-character-fields{flex:1;min-width:0}.custom-character-fields label{font-size:11px}.custom-character-fields input,.custom-character-fields select{font-size:13px!important;line-height:1.5!important;padding:9px 10px!important;margin:5px 0 10px!important;min-width:0}.custom-person-photo{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px}.custom-photo-delete{position:absolute;top:-5px;right:-5px;display:grid;place-items:center;border-radius:50%;width:30px;height:30px;background:var(--surface,#fff);border:1px solid #e3cadd;color:#b13c66;cursor:pointer}.custom-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0}.custom-field-pair>*{min-width:0}.custom-character-fields select,.custom-new-character select{display:block;width:100%;font:inherit;color:inherit;background:var(--surface,#fff);border:1px solid #dfd5ef;border-radius:10px;padding:10px}.custom-cast [data-cast-add]{margin-top:20px}.custom-cast .custom-avatar{width:64px;height:64px}.custom-cast .custom-photo-button{max-width:84px;text-align:center}
.custom-image-card.is-locked .custom-image-art{aspect-ratio:2.2;background:linear-gradient(135deg,#f2eef9,#e9e2f4)}.custom-image-card.is-locked .custom-image-placeholder{min-height:120px;color:#9986b4}.custom-image-card.is-locked .custom-image-info{padding:18px}.custom-image-card.is-locked .custom-image-info p{font-size:13px;margin-bottom:0}.custom-payment{grid-column:1/-1;margin:0 0 8px}.custom-workspace .custom-review-head>small{color:#7257d8;font-size:11px}
#customHistoryDialog{width:min(90vw,760px);max-height:85vh;border:1px solid #dfd5ef;border-radius:20px;padding:30px;color:var(--text);background:var(--surface,#fff)}#customHistoryDialog::backdrop{background:#21173170;backdrop-filter:blur(4px)}#customHistoryDialog h2{margin:24px 0}#customHistoryDialog h3{font-size:13px;color:#7257d8;margin-top:22px}#customHistoryDialog p{font-size:15px;line-height:1.9;margin-top:10px}
.custom-new-cast-section{margin-top:24px}.custom-new-cast-section>p{font-size:12px;color:var(--muted);line-height:1.7;margin-bottom:14px}.custom-new-character{padding:18px;border:1px solid #dfd5ef;border-radius:14px;background:var(--surface,#fff);margin-bottom:16px}.custom-new-character label{display:block;font-size:12px;margin-bottom:12px}.custom-new-character input{width:100%;margin-top:5px}.custom-new-photo{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.custom-new-photo img{width:60px;height:60px;object-fit:cover;border-radius:50%}.custom-new-photo>button{border:1px solid #dfd5ef;background:var(--surface,#fff);color:#b13c66;border-radius:50%;width:30px;height:30px}.custom-new-photo label{flex:1;min-width:0}.custom-new-photo input{max-width:100%;font-size:11px}.custom-new-character .custom-back-step{font-size:11px;margin:0}
@media(max-width:800px){.custom-cast-editors{grid-template-columns:1fr}.custom-character-editor{padding:14px;gap:12px}.custom-cast{padding:16px}.custom-cast .custom-avatar{width:54px;height:54px}.custom-cast .custom-photo-button{max-width:65px}.custom-refresh{padding:22px 16px}.custom-person-photo{max-width:65px}.custom-character-fields .custom-field-pair{gap:8px}.custom-character-fields select{font-size:11px!important}.custom-image-actions{align-items:flex-start;flex-direction:column}.custom-image-actions .button{width:100%}.custom-new-character{padding:14px}.custom-new-photo input{width:100%}}
/* Each scene owns its progress; the rest of the workspace stays usable. */
.custom-save-state{font-size:12px;color:var(--custom-muted);margin:0 0 20px}.custom-field-message{display:block!important;color:#c42f46!important;font-size:12px!important;line-height:1.5!important;margin:5px 0 10px!important}.custom-field-error{border-color:#d53e51!important}.custom-field-error input,.custom-field-error textarea,.custom-field-error select,[aria-invalid=true]{border-color:#d53e51!important;outline-color:#d53e51!important;background-color:#fff4f4!important}.custom-photo-consent.custom-field-error,.custom-photo-button.custom-field-error{padding:10px;border:1px solid #d53e51;border-radius:10px;color:#c42f46}.custom-image-card.custom-field-error,.custom-position.custom-field-error{border:2px solid #d53e51!important}.custom-position.custom-field-error{padding:10px;border-radius:12px}.custom-approval .button .custom-spinner{vertical-align:middle}.custom-approval .button{white-space:normal}
.custom-image-toolbar{display:flex;flex-wrap:wrap;gap:10px;padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--surface,#fff)}
.custom-toolbar-hint{font-size:13px;color:var(--muted);margin:12px 0 20px}.custom-image-art{position:relative;overflow:hidden}.custom-image-art.is-working img{filter:blur(5px);opacity:.55;transition:filter .2s,opacity .2s}.custom-card-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:rgba(248,245,255,.65);backdrop-filter:blur(3px);text-align:center;padding:20px;z-index:1}.custom-card-loading strong{font-size:14px;line-height:1.5;color:var(--ink)}
.custom-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.custom-card-heading h2{margin:0}.custom-play{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border:1px solid var(--line);border-radius:50%;background:var(--surface,#fff);color:var(--purple,#7852ca);cursor:pointer}.custom-play:disabled{opacity:.4;cursor:default}.custom-image-story{display:block;font-size:12px;margin-top:16px;color:var(--muted)}.custom-image-story textarea{display:block;width:100%;margin:7px 0;font-size:14px;line-height:1.7;min-height:115px;resize:vertical}.custom-save-scene{background:none;border:0;color:var(--purple,#7852ca);font-weight:600;padding:6px 0 14px;cursor:pointer}.custom-save-scene:disabled{opacity:.45}.custom-placement-needed{color:var(--purple,#7852ca);font-size:13px;line-height:1.6}.custom-image-actions{display:block}.custom-image-actions>div{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.custom-image-actions .button{font-size:12px;padding:10px 14px;min-height:42px}.custom-position small{display:block;margin-top:8px}
@media(max-width:600px){.custom-image-toolbar{gap:8px;padding:12px}.custom-image-toolbar .button{flex:1 1 100%;font-size:13px}.custom-image-actions>div .button{width:auto;flex:1 1 120px}}
.custom-workspace .custom-save-scene{display:flex;align-items:center;justify-content:center;align-self:center;min-width:148px;min-height:42px;padding:10px 20px;margin:2px 0 20px;border:1px solid transparent;border-radius:12px;background:var(--purple,#7852ca);color:#fff;transition:opacity .2s,background-color .2s;cursor:pointer}.custom-workspace .custom-save-scene:disabled{opacity:.35;cursor:default}.custom-image-history{margin-top:22px;padding-top:20px;border-top:1px solid var(--custom-border)}.custom-image-history h3{font-size:14px;display:flex;align-items:center;gap:8px}.custom-image-history h3 span{font-size:11px;border-radius:20px;padding:3px 7px;background:#7257d81a;color:var(--purple)}.custom-image-history>p{font-size:11px;line-height:1.6;color:var(--custom-muted);margin:8px 0 12px}.custom-image-history>div{display:flex;flex-direction:column;gap:12px}.custom-image-history article{display:flex;gap:12px;align-items:center;padding:10px;background:#7257d806;border:1px solid var(--custom-border);border-radius:14px}.custom-history-thumb{width:88px;height:76px;flex:0 0 88px;border:0;border-radius:9px;overflow:hidden;background:#eee8fa;padding:3px;cursor:pointer}.custom-history-thumb img{width:100%;height:100%;object-fit:contain}.custom-image-history article>div{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.custom-image-history article small{flex-basis:100%;font-size:10px;color:var(--custom-muted);margin-bottom:3px}.custom-image-history .button{font-size:10px;padding:7px 10px;min-height:34px}#customImageHistoryDialog{width:min(94vw,1100px);max-height:92vh;border:1px solid var(--line);border-radius:20px;background:var(--surface,#fff);padding:20px;color:var(--text)}#customImageHistoryDialog::backdrop{background:#21173180;backdrop-filter:blur(5px)}#customImageHistoryDialog header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:16px}#customImageHistoryDialog>img{display:block;max-width:100%;max-height:70vh;margin:auto;object-fit:contain;border-radius:8px}#customImageHistoryDialog>p{font-size:12px;color:var(--muted);margin:14px 0 0}@media(max-width:420px){.custom-history-thumb{width:68px;flex-basis:68px}.custom-image-history article{gap:8px}.custom-image-history .button{padding:7px 8px}}

.custom-image-card>.custom-image-history{margin:0 22px;padding:18px 0;border-top:0;border-bottom:1px solid var(--custom-border)}@media(max-width:700px){.custom-image-card>.custom-image-history{margin:0 18px}}

.new-personalization-dialog{width:min(92vw,520px);max-height:90dvh;overflow:auto;padding:28px;border:1px solid var(--line,#ddd2ef);border-radius:24px;background:var(--surface,#fff);color:var(--text,#30283f)}.new-personalization-dialog::backdrop{background:#22133370;backdrop-filter:blur(5px)}.new-personalization-dialog h2{font-size:24px;line-height:1.3;margin:0 0 14px}.new-personalization-dialog p{font-size:14px;line-height:1.7;margin:0 0 18px;color:var(--muted,#786c8a)}.previous-book-summary{display:flex;flex-direction:column;gap:6px;padding:16px;margin:0 0 20px;background:#7257d80b;border:1px solid var(--line,#ddd2ef);border-radius:14px;overflow-wrap:anywhere}.previous-book-summary span{font-size:12px;color:var(--muted)}.new-personalization-actions{display:flex;flex-wrap:wrap;gap:10px}.new-personalization-actions .button{white-space:normal;justify-content:center;flex:1 1 auto}.new-personalization-actions p{flex-basis:100%;font-size:12px;margin:6px 0 0}@media(max-width:480px){.new-personalization-dialog{padding:22px}.new-personalization-actions .button{flex-basis:100%}}

.custom-image-art>.responsive-picture{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.custom-image-art:not(.is-working):has(img[data-customer-src]:not([src])):after{content:"";position:absolute;width:24px;height:24px;border:2px solid #d9cef2;border-top-color:#7257d8;border-radius:50%;animation:book-reader-loading .8s linear infinite}.custom-image-art img[data-customer-src]:not([src]){opacity:0}

/* Compact shared year/month controls for customer creation and saved characters. */

/* Match the admin's six positions, aligned to the actual panoramic image. */
.custom-position-image{position:relative;width:100%;aspect-ratio:2;display:grid;place-items:center}
.custom-position-image>.responsive-picture{display:flex;width:100%;height:100%;align-items:center;justify-content:center}
.custom-text-dots{position:absolute;inset:0;z-index:3;pointer-events:none}
.custom-text-dot{position:absolute;pointer-events:auto;width:32px!important;height:32px!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;display:grid!important;place-items:center;transform:translate(-50%,-50%);box-shadow:none!important;cursor:pointer}
.custom-text-dot span{display:block;width:13px;height:13px;border:2px solid #fff;border-radius:50%;background:#2456ed;box-shadow:0 1px 7px #12235180;transition:transform .15s}
.custom-text-dot:hover span,.custom-text-dot:focus-visible span{transform:scale(1.35)}
.custom-text-dot[aria-pressed=true] span{box-shadow:0 0 0 4px #2456ed55}
.custom-text-dot:disabled{pointer-events:none;opacity:.45}
.custom-text-dot.top_left{left:23%;top:17%}.custom-text-dot.top_right{left:77%;top:17%}.custom-text-dot.middle_left{left:23%;top:50%}.custom-text-dot.middle_right{left:77%;top:50%}.custom-text-dot.bottom_left{left:23%;top:83%}.custom-text-dot.bottom_right{left:77%;top:83%}
.custom-position-hint{margin:8px 0 22px;font-size:12px}.custom-position-hint strong{display:block;font-weight:500}.custom-position-hint small{display:block;margin-top:8px}

/* Illustration editor: one cover summary, then compact scene cards. */
.custom-app>.custom-images-workspace{padding:20px 24px}
.custom-images-workspace .custom-back-step{margin-bottom:12px;padding:4px 0}
.custom-cover-summary{display:grid;grid-template-columns:168px minmax(0,1fr);gap:22px;padding:18px;border:1px solid var(--custom-border);border-radius:16px;background:var(--surface,#fff);align-items:start}
.custom-cover-summary .custom-image-art{width:168px;aspect-ratio:1;padding:0;border-radius:10px}
.custom-cover-summary .custom-image-art.is-cover img{max-width:100%;width:100%;height:100%;max-height:168px;object-fit:contain;border-radius:8px;box-shadow:none}
.custom-cover-info{min-width:0}
.custom-cover-label{display:block;color:var(--custom-muted);font-size:11px;margin-bottom:4px}
.custom-cover-info h1{font-size:clamp(20px,2.2vw,28px);line-height:1.25;letter-spacing:-.5px;margin:0}
.custom-cover-info .custom-book-meta{font-size:12px;line-height:1.6;color:var(--custom-muted);margin:7px 0}
.custom-cover-info .custom-cover-hint{font-size:12px;line-height:1.5;color:var(--custom-muted);margin:0 0 10px}
.custom-images-workspace .custom-image-toolbar{padding:0;border:0;border-radius:0;margin:18px 0 0;gap:8px}
.custom-images-workspace .custom-image-toolbar .button{min-height:40px;padding:9px 16px;font-size:13px;flex:0 1 auto}
.custom-images-workspace .custom-toolbar-hint{font-size:11px;line-height:1.5;margin:7px 0 14px}
.custom-images-workspace [data-custom-error]:empty{display:none}
.custom-images-workspace .custom-image-grid{gap:16px;align-items:start}
.custom-images-workspace .custom-image-card{border-radius:16px}
.custom-scene-header{padding:12px 14px 10px}
#magic-home .custom-scene-header h2{font-size:17px;line-height:1.3;margin:0 0 4px}
.custom-scene-header small{display:block;font-size:11px;line-height:1.5;color:var(--custom-muted)}
.custom-scene-header small span{color:var(--purple,#7852ca)}
.custom-images-workspace .custom-image-card .custom-image-art{aspect-ratio:2;padding:0}
.custom-images-workspace .custom-image-art img{border-radius:0;max-height:none}
.custom-images-workspace .custom-image-info{padding:12px 14px 14px;gap:10px}
.custom-images-workspace .custom-position-hint{display:block;margin:0;font-size:11px;line-height:1.4}
.custom-images-workspace .custom-image-story{margin:0;font-size:11px}
.custom-image-story .custom-scene-word-count{float:inline-end;color:var(--custom-muted);font-size:11px;font-weight:400}
.custom-workspace .custom-scene-word-count[data-limit-hit]{color:var(--danger,#a42c48)}
.custom-images-workspace .custom-image-story textarea{font-size:13px;line-height:1.6;min-height:84px;padding:9px 11px;margin:5px 0 0;border-radius:9px}
.custom-images-workspace .custom-save-scene{font-size:12px;min-width:0;min-height:34px;margin:0;padding:7px 14px;align-self:flex-start}
.custom-images-workspace .custom-save-scene[hidden]{display:none}
.custom-image-feedback,.custom-image-versions{border-top:1px solid var(--custom-border);padding-top:9px}
#magic-home .custom-image-feedback summary,#magic-home .custom-image-versions summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--purple,#7852ca);line-height:1.5;min-height:24px}
.custom-image-feedback summary:focus-visible,.custom-image-versions summary:focus-visible{outline:2px solid #7257d8;outline-offset:3px;border-radius:4px}
.custom-image-feedback textarea{font-size:13px;line-height:1.6!important;padding:9px 11px!important;margin:6px 0 0!important;min-height:72px}
.custom-images-workspace .custom-image-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;margin-top:0}
.custom-cover-info .custom-image-actions{margin-top:8px}
.custom-images-workspace .custom-image-actions small{font-size:11px;color:var(--custom-muted)}
.custom-images-workspace .custom-image-actions .button{min-height:38px;padding:8px 15px;font-size:12px;width:auto;flex:none}
.custom-image-versions .custom-image-history{margin:8px 0 0;padding:0;border:0}
.custom-image-versions .custom-image-history h3,.custom-image-versions .custom-image-history>p{display:none}
[data-theme=dark] .custom-cover-summary{background:#231d32}
@media(max-width:700px){.custom-app>.custom-images-workspace{padding:16px}.custom-cover-summary{grid-template-columns:112px minmax(0,1fr);gap:14px;padding:14px}.custom-cover-summary .custom-image-art{width:112px}.custom-cover-summary .custom-image-art.is-cover img{max-height:112px}.custom-cover-info h1{font-size:20px}.custom-cover-info .custom-cover-hint{font-size:11px}.custom-images-workspace .custom-image-grid{gap:14px}}
@media(max-width:440px){.custom-app>.custom-images-workspace{padding:12px}.custom-cover-summary{grid-template-columns:86px minmax(0,1fr);gap:12px;padding:12px}.custom-cover-summary .custom-image-art{width:86px}.custom-cover-summary .custom-image-art.is-cover img{max-height:86px}.custom-cover-info h1{font-size:18px}.custom-cover-info .custom-book-meta{font-size:11px}.custom-cover-info .custom-image-feedback,.custom-cover-info .custom-image-actions,.custom-cover-info .custom-image-versions{margin-left:-98px}.custom-cover-info .custom-image-feedback{margin-top:12px}.custom-images-workspace .custom-image-toolbar .button{padding:8px 12px;font-size:12px}.custom-image-actions small{max-width:45%}}
/* Explicit image controls and immediate, non-destructive text placement. */
.custom-app .custom-image-toolbar [data-custom-stop]{background:#bd3344;color:#fff;border-color:#bd3344}
.custom-app .custom-image-toolbar [data-custom-scenes]{background:#16804d;color:#fff;border-color:#16804d}
.custom-image-toolbar .button:disabled,.custom-finish .button:disabled{background:#e9e7ed!important;color:#8b8595!important;border-color:#e9e7ed!important;opacity:1;cursor:not-allowed}
.custom-position-image{container-type:inline-size}
@font-face{font-family:SceneComfortaa;src:url('/fonts/comfortaa.ttf') format('truetype');font-style:normal;font-weight:300 700;font-display:swap}
.custom-live-text{position:absolute;z-index:2;isolation:isolate;width:29%;max-height:86%;padding:1.2% .7%;color:#fff;text-align:center;font-family:SceneComfortaa,Comfortaa,sans-serif;font-weight:400;font-size:1.38cqw;line-height:1.25;letter-spacing:normal;text-shadow:0 .04cqw .12cqw #17312760;pointer-events:none;overflow-wrap:normal;transform:translate(-50%,-50%)}
.custom-live-text::before{content:"";position:absolute;z-index:-1;inset:0;background:rgb(39 34 27 / .52);-webkit-backdrop-filter:blur(1.1cqw);backdrop-filter:blur(1.1cqw);border-radius:2.75cqw;filter:blur(1.65cqw)}
.custom-live-text>span{font:inherit;color:inherit;letter-spacing:inherit}
.custom-live-text[hidden]{display:none}
.custom-live-text.top_left{left:17%;top:17%}.custom-live-text.top_right{left:83%;top:17%}.custom-live-text.middle_left{left:17%;top:50%}.custom-live-text.middle_right{left:83%;top:50%}.custom-live-text.bottom_left{left:17%;top:83%}.custom-live-text.bottom_right{left:83%;top:83%}
.custom-finish{margin-top:22px;padding:22px;gap:18px;align-items:center}
.custom-finish h2{font-size:20px!important;margin:0 0 6px}.custom-finish p{font-size:14px;line-height:1.5;margin:0;max-width:580px}.custom-finish .button{flex-shrink:0;min-height:44px}
.custom-thanks{text-align:center;padding:44px 24px!important}.custom-thanks h1{font-size:28px!important;margin:18px 0 10px}.custom-thanks>p{max-width:530px;margin:0 auto;color:var(--muted);line-height:1.6}.custom-thanks-check{display:grid;place-items:center;width:60px;height:60px;border-radius:50%;background:#e3f4eb;color:#16804d;font-size:30px;margin:auto}.custom-thanks-book{display:flex;align-items:center;gap:20px;max-width:420px;margin:24px auto;text-align:left}.custom-thanks-book picture{width:90px;flex:none}.custom-thanks-book img{width:100%;height:auto;border-radius:8px}
.book-payment-dialog{width:min(440px,calc(100vw - 32px));padding:32px;border:1px solid var(--line);border-radius:24px;background:var(--surface,#fff);color:var(--ink,#2c2540);text-align:center;box-shadow:0 24px 90px #22133530}.book-payment-dialog::backdrop{background:#1f143666}.book-payment-dialog h2{font-size:24px;margin:18px 0 10px}.book-payment-dialog p{line-height:1.6;color:var(--muted)}.book-payment-dialog .button{margin-top:12px;min-width:150px}
@media(max-width:600px){.custom-finish{flex-direction:column;align-items:stretch}.custom-finish .button{width:100%}.custom-thanks h1{font-size:24px!important}}

/* Keep the receipt on one center axis, including inside the account shell. */
#magic-home .custom-app>.custom-thanks{display:flex;flex-direction:column;align-items:center;gap:0;text-align:center;padding:40px 24px!important}
#magic-home .custom-thanks>h1{width:100%;max-width:760px;margin:18px auto 10px;font-size:clamp(24px,2.5vw,30px)!important;line-height:1.3;text-align:center}
#magic-home .custom-thanks>p{width:100%;max-width:530px;margin:0 auto;text-align:center;font-size:16px;line-height:1.65}
#magic-home .custom-thanks-book{display:flex;align-items:center;justify-content:center;gap:20px;width:fit-content;max-width:100%;margin:26px auto;text-align:left}
#magic-home .custom-thanks-book>strong{min-width:0;max-width:310px;font-size:17px;line-height:1.5}
#magic-home .custom-thanks-book>picture,#magic-home .custom-thanks-book>.responsive-picture{display:block;width:90px;min-width:90px;flex:0 0 90px}
#magic-home .custom-thanks>.button{align-self:center;margin:0 auto}
@media(max-width:600px){#magic-home .custom-app>.custom-thanks{padding:30px 18px!important}#magic-home .custom-thanks>p{font-size:14px}#magic-home .custom-thanks-book{gap:14px}#magic-home .custom-thanks-book>strong{font-size:15px}}

/* Keep placement targets available without covering the selected text. */
.custom-text-dot[aria-pressed="true"]{opacity:.12}
.custom-text-dot[aria-pressed="true"]:hover,.custom-text-dot[aria-pressed="true"]:focus-visible{opacity:1}
.custom-enlarge{position:absolute;right:8px;bottom:8px;border:1px solid #ffffff70;border-radius:99px;padding:7px 11px;color:#fff;background:#201832bc;font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;cursor:pointer;z-index:3}
.custom-position-hint button{font:inherit;color:inherit;text-decoration:underline;background:none;border:0;cursor:pointer}
.custom-finish [data-completion-hint]{max-width:62ch;font-size:13px;line-height:1.7}
.custom-finish [data-go-scene]{white-space:nowrap;text-decoration:underline}
#customSceneDialog{width:min(1200px,96vw);max-width:96vw;max-height:94dvh;overflow:auto;padding:18px;border:1px solid var(--border);border-radius:20px;background:var(--surface,#fff);color:var(--ink,#29223d)}
#customSceneDialog::backdrop{background:#141024b8;backdrop-filter:blur(5px)}
#customSceneDialog header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.custom-scene-zoom-scroll{overflow:visible;border-radius:12px}
#customSceneDialog .custom-position-image{min-width:0;width:100%;max-width:130dvh;margin:0 auto;container-type:inline-size;position:relative}
#customSceneDialog .custom-position-image>img{width:100%;display:block}
.custom-readable-scene{font:400 16px/1.7 SceneComfortaa,Comfortaa,sans-serif;max-width:68ch;margin:18px auto}
.custom-zoom-positions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.custom-zoom-positions [aria-pressed="true"]{background:#2857ef;color:white}
.custom-order-receipt{display:flex;flex-wrap:wrap;gap:14px 30px;justify-content:center;margin:20px auto 30px}
.custom-order-receipt dt{font-size:12px;color:var(--muted)}
.custom-order-receipt dd{margin:4px 0 0;font-weight:600;font-size:15px}
.saved-person-summary{display:flex;align-items:center;gap:12px;padding:12px;margin:10px 0;border:1px solid var(--border);border-radius:14px}
.saved-person-summary img{width:64px;height:64px;object-fit:cover;border-radius:12px}
.saved-person-summary div{flex:1;display:grid;gap:4px}
.saved-person-summary small{color:var(--muted)}

.custom-enlarge{display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:50%}.custom-enlarge:focus-visible{outline:3px solid #8aa7ff;outline-offset:2px}

/* The cover has no scene-text controls and stays fully visible on phones. */
#customSceneDialog.is-cover-preview{width:min(760px,94vw)}
#customSceneDialog .custom-cover-zoom{display:flex;justify-content:center;min-width:0}
#customSceneDialog .custom-cover-zoom img{display:block;max-width:100%;width:auto;height:auto;max-height:75dvh;object-fit:contain;border-radius:10px}

/* Private dialogs share the decoded WebP used by cards; never stretch a phone preview. */
.custom-history-thumb{position:relative}
.custom-history-thumb>.customer-image-frame{width:100%;height:100%}
.custom-history-open{position:absolute;inset:0;z-index:2;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:pointer}
.custom-history-thumb:has([data-failed=true]) .custom-history-open{pointer-events:none}
.custom-history-thumb .customer-image-error{font-size:10px;gap:2px;padding:2px}
.custom-history-thumb .customer-image-error>span{display:none}
.custom-history-thumb .customer-image-error button{font-size:10px;padding:3px;min-height:32px}
#customSceneDialog .customer-image-frame,#customImageHistoryDialog .customer-image-frame{display:block;width:100%;height:auto;background:var(--surface-soft,#f3effa);border-radius:10px;overflow:hidden}
#customSceneDialog .customer-image-frame>img,#customImageHistoryDialog .customer-image-frame>img{display:block;width:100%;height:auto;object-fit:contain}
#customSceneDialog .custom-cover-zoom>.customer-image-frame{width:min(100%,65dvh)}
#customImageHistoryDialog .custom-history-image{width:100%;margin:auto}
#customImageHistoryDialog .custom-history-image.is-cover{max-width:65dvh}
#customSceneDialog,#customImageHistoryDialog{box-sizing:border-box}

/* Keep the full price beside the free-preview form on every viewport. */
#magic-home .custom-create .custom-intro .custom-price{color:var(--ink,#2c253e);display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 14px;padding:14px 16px;border:1px solid var(--line,#e1d7f2);border-radius:16px;background:var(--surface,#fff);margin:18px 0}
#magic-home .custom-create .custom-intro .custom-price strong{color:var(--ink,#2c253e);font-size:1.5rem;white-space:nowrap}
#magic-home .custom-create .custom-intro .custom-price span{color:var(--muted,#656576);flex-basis:100%;font-size:.85rem;line-height:1.5}
#builderSavedCharacterSummary{display:flex;align-items:center;gap:12px;padding:10px 0;min-width:0}
#builderSavedCharacterSummary[hidden]{display:none}
#builderSavedCharacterSummary picture{flex:0 0 64px}
#builderSavedCharacterSummary img{width:64px;height:64px;object-fit:cover;border-radius:12px}
#builderSavedCharacterSummary span{font-size:.9rem}

#magic-home .custom-create .custom-intro .custom-price small{color:var(--muted,#656576)}

/* A single quiet price, aligned with the creator introduction. */
#magic-home .custom-create .custom-intro .custom-price{display:flex;justify-content:center;align-items:center;width:max-content;max-width:100%;margin:18px auto 0;padding:9px 19px;border:0;border-radius:999px;background:var(--lavender,#f0eafa);gap:0}
#magic-home .custom-create .custom-intro .custom-price strong{font-size:1.25rem;font-weight:800;line-height:1.4;color:var(--ink,#2e2542);font-variant-numeric:tabular-nums}

/* A light, non-destructive book mockup. Text and placement targets share the
   original image coordinate space; the fold is only a display overlay. */
.custom-images-workspace .custom-image-card .custom-image-art:has(.custom-book-spread){aspect-ratio:auto;padding:16px 12px 22px;background:radial-gradient(ellipse at center,#faf8ff,#eee8fa)}
.custom-book-spread{isolation:isolate;border-radius:3px;background:#fff;box-shadow:0 2px 0 #d6d1dc,0 4px 0 #faf9fc,0 6px 1px #ccc5d5,0 12px 16px -7px #21152b75}
.custom-book-spread>.responsive-picture{overflow:hidden;border-radius:3px}
.custom-book-spread::after{content:'';position:absolute;inset:0;z-index:1;border-radius:inherit;background:linear-gradient(90deg,transparent 44%,#14101c1a 48%,#100b2373 49.8%,#ffffff38 50.25%,#1a102421 52%,transparent 56%);pointer-events:none}
.custom-scene-zoom-scroll:has(.custom-book-spread){padding:12px 6px 20px}
[data-theme=dark] .custom-images-workspace .custom-image-card .custom-image-art:has(.custom-book-spread){background:radial-gradient(ellipse at center,#3c304c,#2b223a)}
@media(max-width:700px){.custom-images-workspace .custom-image-card .custom-image-art:has(.custom-book-spread){padding:12px 9px 18px}}

@media (max-width: 760px) {
  #magic-home .shop-page-main > .custom-create.custom-app {
    width: 100%;
  }

  #magic-home .custom-create .custom-intro {
    padding: 20px 16px 0;
    margin-bottom: 18px;
  }

  #magic-home .custom-create .custom-intro .eyebrow {
    display: none;
  }

  #magic-home .custom-create .custom-intro h1 {
    margin-top: 0;
    font-size: clamp(23px, 6.4vw, 29px);
    line-height: 1.22;
  }

  #magic-home .custom-app .custom-steps {
    padding: 10px 6px;
  }

  #magic-home .custom-app .custom-steps li {
    font-size: 11px;
  }

  #magic-home .custom-create .story-builder :is(input:not([type="checkbox"]):not([type="file"]), textarea, select),
  #magic-home .custom-workspace :is(input:not([type="checkbox"]):not([type="file"]), textarea, select),
  #magic-home .custom-image-feedback textarea {
    font-size: 16px;
    scroll-margin-block: 90px 24px;
  }

  .custom-images-workspace .custom-image-actions {
    flex-wrap: wrap;
  }

  #magic-home .custom-images-workspace :is(.custom-image-toolbar .button, .custom-image-actions .button, .custom-save-scene),
  #magic-home :is(.custom-image-feedback, .custom-image-versions) summary {
    min-height: 44px;
  }

  #magic-home :is(.custom-image-feedback, .custom-image-versions) summary {
    padding-block: 12px;
  }

  #magic-home .custom-workspace .custom-back-step {
    min-height: 44px;
    margin-bottom: 8px;
  }

  .custom-images-workspace .custom-enlarge {
    width: 44px;
    height: 44px;
  }
}

/* Two side-by-side covers for comparing the personalized art. */
.custom-cover-summary.has-cover-options{grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:clamp(16px,3vw,30px);align-items:center}
.customer-cover-options{min-width:0}
.customer-cover-options h2{margin:0 0 10px;font-size:16px;line-height:1.3}
.customer-cover-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.customer-cover-option{min-width:0;overflow:hidden;border:1px solid var(--custom-border,var(--border,#ded4ef));border-radius:12px;background:var(--surface,#fff)}
.customer-cover-option[data-selected=true]{border-color:var(--purple,#7852ca);box-shadow:0 0 0 1px var(--purple,#7852ca)}
.customer-cover-art{position:relative;aspect-ratio:1;background:var(--shop-bg,#f3eef8)}
.customer-cover-art .customer-image-frame,.customer-cover-art img{display:block;width:100%;height:100%}
.customer-cover-art img{object-fit:contain}
.custom-enlarge.customer-cover-zoom{top:6px;right:6px;bottom:auto;width:36px;height:36px;padding:0}
.customer-cover-choice{display:flex;justify-content:space-between;align-items:center;gap:5px;width:100%;min-height:44px;padding:7px 9px;border:0;background:transparent;color:inherit;text-align:left;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.customer-cover-choice:focus-visible{outline:2px solid var(--purple,#7852ca);outline-offset:-3px;border-radius:4px}
.customer-cover-choice-state{color:var(--purple,#7852ca);font-size:11px;text-align:right}
.customer-cover-choice:disabled{cursor:wait}
.customer-cover-placeholder{display:grid;place-content:center;justify-items:center;gap:8px;min-height:0;padding:12px;text-align:center;font-size:12px;color:var(--ink-muted,#655972);background:var(--shop-bg,#f3eef8)}
.customer-cover-dialog{box-sizing:border-box;width:min(calc(100vw - 28px),calc(100dvh - 48px),720px);max-width:none;max-height:none;padding:0;border:0;border-radius:12px;background:var(--surface,#fff);color:inherit}
.customer-cover-dialog::backdrop{background:#151024bb}
.customer-cover-dialog .customer-image-frame,.customer-cover-dialog img{display:block;width:100%;aspect-ratio:1;object-fit:contain}
.customer-cover-dialog>button{position:absolute;z-index:2;top:8px;right:8px;width:44px;height:44px;padding:0;border:1px solid var(--custom-border,#ded4ef);border-radius:50%;background:var(--surface,#fff);color:inherit;font:inherit;font-size:24px;cursor:pointer}
[data-theme=dark] .customer-cover-art,[data-theme=dark] .customer-cover-placeholder{background:#2b223b}
[data-theme=dark] .customer-cover-placeholder{color:#ddd1ee}
@media(max-width:700px){.custom-cover-summary.has-cover-options{grid-template-columns:minmax(0,1fr)}}
@media(max-width:440px){.has-cover-options .custom-cover-info :is(.custom-image-feedback,.custom-image-actions,.custom-image-versions){margin-left:0}.customer-cover-choice{flex-direction:column;align-items:flex-start;justify-content:center}.customer-cover-choice-state{text-align:left}}
