.book-editor {color:#152a43;background:#fff;font:1rem/1.45 system-ui,sans-serif;max-width:72rem;margin:1.5rem auto;padding:0 .85rem 2.5rem}
.book-editor *,.book-photo-picker *,.book-crop-dialog *,.book-preview-dialog * {box-sizing:border-box}
.book-editor .brand-mark {font:bold 1.3rem Georgia,serif;color:#143969;margin:0 0 .25rem}
.book-editor h1,.book-editor h2,.book-photo-picker h2,.book-crop-dialog h2,.book-preview-dialog h2 {font-family:Georgia,serif;color:#143969}
.book-editor h1 {margin:.15rem 0 .85rem;font-size:1.75rem}
.book-editor fieldset {min-width:0;border:0;margin:0;padding:0}
.book-editor legend {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.book-editor label {display:block;font-weight:600;font-size:.92rem;color:#152a43;margin-bottom:.75rem}
.book-editor input,.book-editor select {display:block;font:inherit;font-weight:400;min-height:44px;width:100%;max-width:100%;margin:.3rem 0 0;padding:.45rem .65rem;border:1px solid #8ea2bc;border-radius:.35rem;background:#fff;color:#152a43}
.book-editor button,.book-photo-picker button,.book-crop-dialog button,.book-preview-dialog button {font:inherit;min-height:44px;margin:.15rem .35rem .15rem 0;border:1px solid #9daec3;border-radius:.35rem;background:#fff;color:#143969;padding:.45rem .8rem;cursor:pointer;max-width:100%}
.book-editor button:disabled,.book-photo-picker button:disabled,.book-crop-dialog button:disabled,.book-preview-dialog button:disabled {color:#637185;border-color:#c8d2df;background:#f5f7fa;cursor:not-allowed}
.book-editor fieldset>button.primary-save,.book-crop-dialog button.primary-action {background:#123968;border-color:#123968;color:#fff}
.book-editor fieldset>button.primary-save:disabled {background:#637185;border-color:#637185;color:#fff}
.book-editor :focus-visible,.book-photo-picker :focus-visible,.book-crop-dialog :focus-visible,.book-preview-dialog :focus-visible {outline:3px solid #0768be;outline-offset:2px}

.book-guest-entry {box-sizing:border-box;max-width:32rem;margin:clamp(1rem,5vw,3rem) auto;padding:clamp(.9rem,3vw,1.5rem);border:1px solid #bdcde2;border-radius:.875rem;background:#f3f6fa;color:#143969;font:1rem/1.45 system-ui,sans-serif}
.book-guest-entry h1 {margin:0 0 .75rem;font:bold 1.65rem/1.2 Georgia,serif}
.book-guest-entry a {box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:.5rem .8rem;border:1px solid transparent;border-radius:.5rem;background:#123968;color:#fff;font-weight:600;text-align:center;text-decoration:none;overflow-wrap:anywhere}
.book-guest-entry a:hover {background:#0d2b52}
.book-guest-entry a:focus-visible {outline:3px solid #0768be;outline-offset:2px}

.editor-toolbar {display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}
.editor-status {margin:1rem 0 .5rem;font-weight:600;min-height:1.45rem}
.editor-recovery-actions {display:flex;flex-wrap:wrap;gap:.5rem}

.book-editor.book-session-retry {box-sizing:border-box;width:calc(100% - 1.6rem);max-width:32rem;margin:clamp(1rem,5vw,3rem) auto;padding:clamp(.9rem,3vw,1.5rem);border:1px solid #bdcde2;border-radius:.875rem;background:#f3f6fa}
.book-session-retry p {margin:0 0 .75rem}
.book-session-retry button {background:#123968;border-color:#123968;color:#fff}
.book-session-retry button[aria-disabled="true"] {cursor:wait}

.book-design-section {background:#f1f4f7;border:1px solid #d2dce7;border-radius:.6rem;padding:1rem;margin:1rem 0 1.25rem;min-width:0}
.book-design-section h2 {font-size:1.2rem;margin:0 0 .3rem}
.design-preview-note {margin:0 0 .8rem;font-size:.86rem;color:#394c63}
.design-setup-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:.85rem 1rem;align-items:start}
.design-setup-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:.65rem;min-width:0}
.design-setup-fields label {margin-bottom:0}
.design-pages-control {display:grid;gap:.35rem;min-width:0;align-content:start}
.design-pages-row {display:flex;flex-wrap:wrap;align-items:flex-end;gap:.4rem;min-width:0}
.design-pages-row label {flex:1 1 7.5rem;min-width:0}
.design-pages-row button {margin:0}
.design-pages-status {margin:0;font-size:.82rem;color:#394c63;overflow-wrap:anywhere}
.design-pages-feedback {margin:0;font-size:.82rem;font-weight:600;color:#143969;overflow-wrap:anywhere}
.design-pages-feedback[hidden] {display:none}
.book-design-section input[aria-invalid="true"] {border-color:#9a3412}
.spine-preview-wrap {background:#fff;border:1px solid #c2ccda;border-radius:.5rem;padding:.75rem .85rem;display:grid;gap:.45rem;min-width:0}
.spine-preview-caption {font-size:.82rem;font-weight:600;color:#394c63}
.spine-preview {display:flex;align-items:center;justify-content:center;min-height:3rem;padding:.45rem .85rem;border-radius:.35rem;border:1px solid var(--design-border,#c2ccda);background:var(--design-bg,#f8fafc);color:var(--design-heading,#143969);font:700 .95rem/1.3 Georgia,serif;letter-spacing:.03em;text-align:center;overflow-wrap:anywhere}
.spine-preview-text.is-empty {font-family:system-ui,sans-serif;font-weight:400;font-style:italic;color:var(--design-muted,#4a5d75)}

.decoration-controls {border:1px solid #d2dce7;border-radius:.45rem;padding:.7rem .75rem;margin:.25rem 0 .5rem;background:#f8fafc;display:grid;gap:.5rem;min-width:0}
.decoration-controls-title {margin:0;font-size:.88rem;font-weight:700;color:#143969}
.decoration-controls-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr));gap:.5rem;min-width:0}
.decoration-controls-grid label {margin-bottom:0;font-size:.85rem}

.design-theme-clean {--design-bg:#ffffff;--design-ink:#152a43;--design-heading:#143969;--design-muted:#4a5d75;--design-border:#c2ccda;--design-accent:#143969;--design-accent-soft:#e7eef7}
.design-theme-coastal {--design-bg:#f1f7fa;--design-ink:#123344;--design-heading:#124d66;--design-muted:#3d6475;--design-border:#a9cad6;--design-accent:#19647e;--design-accent-soft:#dceef5}
.design-theme-warm {--design-bg:#fcf7f0;--design-ink:#38251a;--design-heading:#6f3b21;--design-muted:#6c5142;--design-border:#ddc5ae;--design-accent:#8c4a27;--design-accent-soft:#f5e6d6}

.deco-bg-ivory {--design-bg:#faf6ed;--design-border:#d9ceb8}
.deco-bg-mist {--design-bg:#e7f0f5;--design-border:#adc4d2}
.deco-bg-sand {--design-bg:#f3e8d7;--design-border:#d4bca0}
.deco-bg-sage {--design-bg:#ebf2ec;--design-border:#b3cbb6}
.deco-bg-navy {--design-bg:#143969;--design-ink:#f8fafc;--design-heading:#ffffff;--design-muted:#d6e2f0;--design-border:#2a558f;--design-accent:#e9c46a;--design-accent-soft:rgba(255,255,255,.16)}

.cover-card.is-designed,.page-design-surface {background:var(--design-bg,#fff);color:var(--design-ink,#152a43);border:1px solid var(--design-border,#c2ccda);border-radius:.45rem;transition:background-color .15s,border-color .15s}
.page-design-surface {position:relative;display:flex;flex-direction:column;justify-content:center;gap:.65rem;padding:.85rem;width:100%;min-width:0}
.cover-card.is-designed .cover-copy strong,.cover-card.is-designed .cover-copy h3 {color:var(--design-heading,#143969)}
.cover-card.is-designed .cover-copy>span,.cover-card.is-designed .cover-empty-media,.page-design-surface .page-empty-note {color:var(--design-muted,#4a5d75);border-color:var(--design-border,#c2ccda)}
/* Populated editor cards must fit their photo tools. The layout proof still uses the selected page ratio. */
.page-design-surface:has(.placement-card) {aspect-ratio:auto}
.page-design-surface .placement-card {color:#152a43}

.design-shape-square {width:100%;max-width:26rem;margin-inline:auto;aspect-ratio:1/1}
.design-shape-landscape {width:100%;aspect-ratio:4/3}
.design-shape-portrait {width:100%;max-width:22rem;margin-inline:auto;aspect-ratio:3/4}
.cover-card.design-shape-portrait {max-width:25rem}

.deco-frame-hairline,.cover-card.deco-frame-hairline {border:2px solid var(--design-accent,#143969)}
.deco-frame-double,.cover-card.deco-frame-double {border:4px double var(--design-accent,#143969)}
.deco-frame-mat,.cover-card.deco-frame-mat {border:2px solid var(--design-border,#c2ccda);box-shadow:inset 0 0 0 7px rgba(255,255,255,.72),inset 0 0 0 8px var(--design-accent,#143969);padding:1.15rem}
.deco-frame-rounded,.cover-card.deco-frame-rounded {border:2px solid var(--design-accent,#143969);border-radius:1.1rem}

.design-accent-row {display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.55rem;min-width:0}
.design-accent-row[hidden] {display:none}
.decoration-text-badge {margin:0;display:inline-block;padding:.2rem .6rem;border-radius:999px;background:var(--design-accent-soft,#e7eef7);color:var(--design-heading,#143969);border:1px solid var(--design-border,#c2ccda);font-size:.82rem;font-weight:600;letter-spacing:.02em;overflow-wrap:anywhere}

.design-sticker {position:relative;display:inline-grid;place-items:center;width:2.1rem;height:2.1rem;flex:0 0 auto;pointer-events:none}
.design-sticker-core {display:block;pointer-events:none}
.sticker-diamond::before {content:'';width:1.35rem;height:1.35rem;background:var(--design-accent,#143969);transform:rotate(45deg);border-radius:.15rem}
.sticker-diamond .design-sticker-core {position:absolute;width:.6rem;height:.6rem;background:var(--design-bg,#fff);transform:rotate(45deg);border:1.5px solid var(--design-accent,#143969)}
.sticker-circle-ring {border-radius:50%;border:3px solid var(--design-accent,#143969);background:var(--design-accent-soft,#e7eef7)}
.sticker-circle-ring .design-sticker-core {width:.8rem;height:.8rem;border-radius:50%;background:var(--design-accent,#143969)}
.sticker-starburst::before,.sticker-starburst::after {content:'';position:absolute;width:1.45rem;height:1.45rem;background:var(--design-accent,#143969);border-radius:.12rem}
.sticker-starburst::after {transform:rotate(45deg)}
.sticker-starburst .design-sticker-core {position:relative;z-index:1;width:.55rem;height:.55rem;border-radius:50%;background:var(--design-bg,#fff)}
.sticker-corner-ribbon {width:2rem;height:2rem;background:linear-gradient(135deg,var(--design-accent,#143969) 50%,var(--design-accent-soft,#e7eef7) 50%);border:1.5px solid var(--design-accent,#143969);border-radius:.22rem}
.sticker-corner-ribbon .design-sticker-core {width:.48rem;height:.48rem;border-radius:50%;background:var(--design-bg,#fff);transform:translate(-.35rem,-.35rem)}
.sticker-arch {width:1.75rem;height:2rem;border-radius:999px 999px .15rem .15rem;background:var(--design-accent,#143969);align-items:end;padding-bottom:.22rem}
.sticker-arch .design-sticker-core {width:.8rem;height:1.08rem;border-radius:999px 999px 0 0;background:var(--design-bg,#fff)}

.book-cover-section {background:#f1f4f7;border:1px solid #d2dce7;border-radius:.6rem;padding:1rem;margin:1rem 0 1.25rem;min-width:0}
.book-cover-section h2,.section-heading {font-size:1.2rem;margin:0 0 .75rem}
.cover-editor-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;align-items:start}
.cover-fields,.cover-media,.cover-copy {min-width:0}
.cover-photo-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.35rem}
.cover-card {background:#fff;border:1px solid #c2ccda;border-radius:.5rem;padding:1rem;display:grid;gap:.85rem;align-items:center;text-align:center;min-width:0}
.cover-card.layout-cover-typographic .cover-copy {order:-1}
.cover-card .cover-copy strong,.cover-card .cover-copy h3 {display:block;font:bold 1.2rem/1.3 Georgia,serif;color:#143969;margin:0 0 .35rem;overflow-wrap:anywhere}
.cover-card .cover-copy>span,.cover-card .cover-copy>p {display:block;font-size:.95rem;color:#394c63;margin:0;overflow-wrap:anywhere}
.cover-empty-media {margin:0;padding:1.5rem .75rem;border:1px dashed #9daec3;border-radius:.35rem;color:#4a5d75;font-size:.9rem}

.book-editor .spreads {list-style:none;padding:0;margin:0 0 1rem}
.book-editor .spread-card {padding:1rem;margin:1rem 0;background:#f1f4f7;border:1px solid #d2dce7;border-radius:.6rem}
.spread-header {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.75rem}
.spread-header h2 {font-size:1.15rem;margin:0}
.spread-actions {display:flex;flex-wrap:wrap;gap:.35rem}

.book-editor .pages {display:flex;flex-direction:column;gap:.85rem}
.page-card {flex:1;min-width:0;background:#fff;border:1px solid #c2ccda;border-radius:.45rem;padding:.85rem;display:flex;flex-direction:column;gap:.75rem}
.page-header {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:.35rem}
.page-count {font-size:.85rem;color:#4a5d75}
.page-actions {display:flex;flex-wrap:wrap;gap:.25rem}
.page-actions button {font-size:.86rem;padding:.35rem .55rem;margin:0}
.page-settings {display:grid;grid-template-columns:1fr;gap:.5rem}
.page-settings label {margin-bottom:0}
.page-layout-control {display:flex;flex-wrap:wrap;align-items:flex-end;gap:.35rem;min-width:0}
.page-layout-control label {flex:1 1 9rem;min-width:0}
.page-layout-control button {margin:0}
.page-empty-note {margin:0;padding:1.25rem .75rem;text-align:center;border:1px dashed #c2ccda;border-radius:.35rem;color:#4a5d75;font-size:.9rem}

.page-canvas {display:grid;grid-template-columns:1fr;gap:.65rem;min-width:0}
.placement-card {border:1px solid #d2dce7;border-radius:.4rem;padding:.55rem;background:#f9fbfd;display:flex;flex-direction:column;gap:.45rem;min-width:0}
.placement-meta {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.35rem;font-size:.85rem}
.placement-title {font-weight:600;overflow-wrap:anywhere}
.placement-crop-badge {background:#e4ecf5;color:#143969;border-radius:.25rem;padding:.1rem .4rem;font-size:.78rem;font-weight:600}
.placement-actions {display:flex;flex-wrap:wrap;gap:.25rem}
.placement-actions button {font-size:.86rem;padding:.35rem .55rem;margin:0}
.crop-availability-note {display:block;font-size:.8rem;color:#4a5d75}

.photo-frame {position:relative;width:100%;aspect-ratio:4/3;overflow:hidden;border-radius:.3rem;background:#e8eef5;border:1px solid #c2ccda;display:grid;place-items:center}
.photo-frame img {width:100%;height:100%;object-fit:cover;display:block}
.photo-frame-unavailable {padding:.75rem;text-align:center;align-content:center;gap:.25rem}
.photo-slot-label {font-weight:600;font-size:.85rem;color:#152a43;overflow-wrap:anywhere}
.photo-slot-note {font-size:.78rem;color:#4a5d75}

dialog.book-photo-picker,dialog.book-crop-dialog,dialog.book-preview-dialog {color:#152a43;background:#fff;border:1px solid #8ea2bc;border-radius:.65rem;padding:1rem;width:min(94vw,52rem);max-width:calc(100vw - 1rem);max-height:92dvh;overflow-y:auto;font:1rem/1.45 system-ui,sans-serif}
dialog.book-preview-dialog {width:min(96vw,68rem)}
dialog::backdrop {background:rgba(15,32,54,.55)}

dialog.book-autofill-picker {box-sizing:border-box}
.picker-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr));gap:.65rem;margin:.75rem 0}
.picker-card {display:flex;align-items:center;gap:.65rem;border:1px solid #c2ccda;border-radius:.4rem;padding:.5rem;min-height:44px;cursor:pointer;background:#f9fbfd}
.picker-card input[type="checkbox"] {width:22px;height:22px;flex:0 0 auto;margin:0}
.picker-card span {font-size:.9rem;overflow-wrap:anywhere}
.picker-actions,.dialog-actions {display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.75rem}
.picker-first-upload a {display:inline-flex;align-items:center;min-height:44px;max-width:100%;color:#143969;font-weight:650}
.picker-first-upload p {margin:.25rem 0}
.picker-first-upload button[aria-disabled="true"] {cursor:wait}

.dialog-subtitle {margin:.25rem 0 .75rem;color:#394c63;font-size:.92rem}
.crop-preview-stage {max-width:24rem;margin:0 auto .75rem}
.crop-readout {margin:0 0 .75rem;font-size:.9rem;font-weight:600;text-align:center}
.crop-controls {display:grid;gap:.65rem}
.crop-control {display:block;font-weight:600;font-size:.9rem}
.crop-control input[type="range"] {display:block;width:100%;min-height:44px;margin-top:.2rem}

.preview-dialog-header {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem}
.preview-dialog-header h2 {margin:0;font-size:1.25rem;overflow-wrap:anywhere}
.preview-status {margin:.35rem 0 .65rem;font-weight:600}
.preview-nav {display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;margin-bottom:.85rem}
.preview-steps {display:flex;flex-wrap:wrap;gap:.35rem;flex:1;min-width:0}
.preview-steps button[aria-current="step"] {background:#123968;border-color:#123968;color:#fff}
.preview-view-select {display:none}
.preview-page-header {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.25rem .6rem}
.preview-page-header button {display:none}
@media (max-width:719px) {
 .preview-dialog-header {display:grid;grid-template-columns:minmax(0,1fr);align-items:start}
 .book-preview-dialog .preview-close {
  justify-self:end;min-width:44px;min-height:44px;margin:0;padding:0;font-size:0;
 }
 .preview-close::before {content:"×";font-size:1.25rem;line-height:1}
 .preview-nav {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .preview-nav button {margin:0;padding-inline:.3rem}
 .preview-steps {display:none}
 .preview-view-select {
  display:block;grid-column:1/-1;grid-row:1;min-width:0;width:100%;min-height:44px;
  padding:.3rem;font:inherit;color:#143969;background:#fff;border:1px solid #9daec3;border-radius:.35rem;
 }
 .preview-page-header button {display:block;margin:0}
}
.preview-stage {background:#f1f4f7;border:1px solid #d2dce7;border-radius:.5rem;padding:.85rem}
.preview-spread {display:grid;grid-template-columns:1fr;gap:.85rem}
.preview-page {background:#fff;border:1px solid #c2ccda;border-radius:.45rem;padding:.85rem;display:grid;gap:.6rem;min-width:0}
.preview-page-number {margin:0;font-size:.85rem;font-weight:700;color:#4a5d75}
.preview-blank {margin:0;padding:2rem 1rem;text-align:center;color:#4a5d75;border:1px dashed #c2ccda;border-radius:.35rem}
.preview-caption {margin:0;padding-top:.35rem;border-top:1px solid #e4ecf5;font-style:italic;color:#152a43;overflow-wrap:anywhere}

@media (min-width:440px){
 .page-canvas.layout-two-up-split,.page-canvas.layout-story-grid,.page-canvas.layout-feature-plus-two,.page-canvas.layout-single-feature {grid-template-columns:repeat(2,minmax(0,1fr))}
 .page-canvas.layout-single-feature>:first-child,.page-canvas.layout-feature-plus-two>:first-child {grid-column:1 / -1}
}

@media (min-width:540px){
 .cover-card.layout-cover-banner {grid-template-columns:1fr 1fr;text-align:left}
 .page-settings {grid-template-columns:minmax(0,16rem) minmax(0,1fr);align-items:end}
}

@media (min-width:720px){
 .design-setup-grid {grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
 .cover-editor-grid {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .book-editor .pages {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
 .preview-spread {grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (prefers-reduced-motion:reduce){
 .cover-card.is-designed,.page-design-surface {transition:none}
}

/* Book workspace */
body:has(.book-editor) {margin:0;background:#f3f6fa}
.book-editor {background:transparent;max-width:78rem;margin:0 auto;padding:0 clamp(.8rem,2.5vw,2rem) 3rem}
.book-editor [hidden] {display:none}
.book-editor h1 {font-size:clamp(1.42rem,2.5vw,2rem);line-height:1.15;margin:0;overflow-wrap:anywhere}
.book-editor label {font-weight:550}
.book-editor button,.book-photo-picker button,.book-preview-dialog button {border-radius:.55rem;overflow-wrap:anywhere}
.book-command-bar {
 display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.65rem 1.5rem;
 padding:.85rem 0 .75rem;border-bottom:1px solid #cedbec;
}
.book-command-bar > div,.book-page-tools,.book-pages-header > * {min-width:0}
.book-command-bar .brand-mark {font-size:1.12rem;margin:0 0 .2rem}
.book-command-bar .editor-toolbar:not([hidden]),.book-page-tools,.book-section-navigation {display:flex;flex-wrap:wrap;gap:.45rem;margin:0}
.book-command-bar button,.book-page-tools button,.book-section-navigation button,.cover-photo-actions button {margin:0}
.book-command-bar .primary-save:not(:disabled) {background:#17497c;border-color:#17497c;color:white;font-weight:650}
.editor-status {margin:.5rem 0 .35rem;color:#37536e;font-size:.88rem;font-weight:500;overflow-wrap:anywhere}
.book-section-navigation {padding:.2rem 0 .55rem}
.book-section-navigation button {border-color:transparent;background:transparent;text-decoration:underline;text-underline-offset:.18em;padding-inline:.45rem}
.book-quick-start {
 background:#fff;border:1px solid #b8cae0;border-radius:.9rem;
 padding:clamp(.6rem,2vw,1.1rem);margin:.35rem 0 .85rem;min-width:0;
}
.book-quick-start-header {display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.2rem .75rem;margin-bottom:.5rem}
.book-quick-start h2 {font-size:1.12rem;margin:0}
.book-quick-start-disclosure > summary {min-height:44px;padding-block:.45rem;color:#143969;cursor:pointer}
.book-quick-start-disclosure > summary h2 {display:inline}
.book-quick-start-disclosure[open] > summary {margin-bottom:.5rem}
.book-quick-start-steps {list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.45rem}
.book-quick-start-step {display:flex;align-items:center;gap:.5rem;min-width:0}
.quick-start-step-num {
 flex:0 0 auto;display:grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:999px;
 background:#e7eef7;border:1px solid #b8cae0;color:#143969;font-size:.82rem;font-weight:700;
}
.book-quick-start-style-step label {
 flex:1 1 0;min-width:0;margin:0;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem .5rem;
}
.quick-start-field-label {flex:0 0 auto}
.book-quick-start-style-step select {flex:1 1 8.5rem;width:auto;min-width:0;margin:0}
.book-quick-start-step button {margin:0;flex:1 1 0;min-width:0;text-align:center}
.book-quick-start .quick-start-autofill:not(:disabled) {
 color:#17497c;background:#f6f9ff;border-color:#6485a9;font-weight:600;
}
.book-quick-start .quick-start-review:not(:disabled) {
 color:#143969;background:#fff;border-color:#6485a9;font-weight:600;
}
@media (max-width:599px){
 .book-quick-start-steps {display:flex;flex-wrap:wrap}
 .book-quick-start-step {flex:1 1 7.75rem}
 .quick-start-step-num {display:none}
 .book-quick-start-style-step {flex-basis:100%}
 .book-quick-start-step button {align-self:stretch;padding-inline:.45rem}
}
@media (min-width:600px) and (max-width:719px){
 .book-quick-start-steps {display:flex;flex-wrap:wrap;align-items:center}
 .book-quick-start-step {flex:1 1 9rem}
 .book-quick-start-style-step {flex:1.25 1 14rem}
}
@media (min-width:720px){
 .book-quick-start-steps {display:flex;flex-wrap:wrap;align-items:center;gap:.55rem .85rem}
 .book-quick-start-step {flex:1 1 11rem}
 .book-quick-start-style-step {flex:1.25 1 15rem}
}
.book-title-field {max-width:33rem}
.book-cover-section,.book-design-section,.book-editor .spread-card {
 background:#fff;border-color:#cedbec;border-radius:.9rem;
 padding:clamp(.65rem,2.3vw,1.35rem);
}
.book-cover-section {margin:.75rem 0 1rem}
.book-cover-stage {
 display:grid;gap:.6rem;min-width:0;padding:clamp(.5rem,1.5vw,1rem);
 background:#e8eef6;border-radius:.7rem;
}
.book-cover-stage .cover-card {width:100%;max-width:27rem;margin-inline:auto}
.cover-photo-actions {justify-content:center}
@media (max-width:599px){
 .cover-photo-actions {align-items:stretch}
 .cover-photo-actions button {flex:1 1 max(7.75rem,calc((100% - .35rem) / 2));min-width:0;padding-inline:.45rem}
 .cover-photo-actions .crop-availability-note:not([hidden]) {flex-basis:100%}
}
.cover-photo-actions button:first-child:not(:disabled),.book-editor .book-add-page-photos:not(:disabled) {
 color:#17497c;background:#f6f9ff;border-color:#6485a9;font-weight:600;
}
.book-pages-header {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.45rem .9rem}
.book-pages-header h2 {margin:0}
.book-empty-pages {padding:.9rem;margin:.6rem 0 1rem;background:#fff;border:1px dashed #819ab5;border-radius:.6rem;color:#37536e;overflow-wrap:anywhere}
.book-editor .spread-card {margin:.65rem 0}
.book-editor .page-card {padding:clamp(.45rem,1.3vw,.9rem);border-color:#cedbec}
.book-add-page-photos {align-self:start;margin:0}
.book-page-photo-actions {display:flex;flex-wrap:wrap;gap:.4rem;align-items:start}
.book-page-photo-actions button {margin:0}
dialog.book-project-photos {width:min(34rem,calc(100% - 1rem));max-height:calc(100dvh - 1rem)}
.book-project-photos [hidden] {display:none}
.book-project-photos h2,.book-project-photos p {margin-block:.35rem .55rem}
.book-project-photo-choices {
 display:grid;grid-template-columns:repeat(auto-fill,minmax(min(7rem,100%),1fr));
 gap:.5rem;max-height:min(32dvh,16rem);padding:.45rem;overflow:auto;
 border:1px solid #cedbec;border-radius:.6rem;min-width:0;
}
.book-project-photo-choices legend {font-size:.9rem;font-weight:600;padding-inline:.3rem}
.book-project-photo {
 display:grid;grid-template-columns:auto 1fr;align-content:start;align-items:center;gap:.3rem;
 min-height:44px;margin:0;padding:.45rem;border:1px solid #a3b8d0;
 border-radius:.5rem;background:#f6f9ff;cursor:pointer;
}
.book-project-photo:has(input:checked) {border-color:#17497c;background:#e8f1fc;box-shadow:inset 0 0 0 1px #17497c}
.book-project-photo input {width:18px;height:18px;min-height:0;margin:0}
.book-project-photo:has(input:focus-visible) {outline:2px solid #0768be;outline-offset:2px}
.book-project-photo img {grid-column:1/-1;grid-row:1;width:100%;height:3.75rem;object-fit:contain}
.book-project-photo span {font-size:.85rem;overflow-wrap:anywhere}
.book-project-destination {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(10rem,100%),1fr));gap:.5rem;margin-top:.65rem}
.book-project-destination label {min-width:0;margin:0}
.book-project-destination select {width:100%;min-height:44px}
.book-project-photos .book-project-feedback {min-height:1.4em;font-size:.9rem}
.book-project-photos .picker-actions button {min-height:44px}
.book-project-photos .picker-actions button:last-child:not(:disabled) {background:#17497c;border-color:#17497c;color:#fff}
@media (max-height:500px) and (orientation:landscape) {
 dialog.book-project-photos[open]:has(.book-project-photo-choices:not([hidden])) {
  box-sizing:border-box;width:min(38rem,calc(100% - 1rem));padding:.75rem;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));
  gap:.35rem .75rem;align-content:start;align-items:start;
 }
 .book-project-photos > :is(h2,p,.picker-actions) {grid-column:1/-1;margin:0}
 .book-project-photos > h2 {font-size:1.125rem;line-height:1.25}
 .book-project-photos > p {font-size:.875rem;line-height:1.35}
 .book-project-photos .book-project-feedback {min-height:0}
 .book-project-photo-choices {min-inline-size:0;margin:0;grid-auto-flow:column;grid-auto-columns:minmax(7rem,1fr);grid-template-columns:none;max-height:min(46dvh,12rem)}
 .book-project-destination {grid-template-columns:minmax(0,1fr);margin:0}
}
.book-page-style {display:grid;gap:.65rem;min-width:0}
.book-editor label,.book-editor p,.book-editor h2,.book-editor .page-header {overflow-wrap:anywhere}
.book-editor :is(section,div,ol,li) {min-width:0}
.book-editor .page-design-surface {padding:clamp(.4rem,2vw,.8rem)}
.book-page-jump:not([hidden]) {display:flex;flex-wrap:wrap;align-items:end;gap:.35rem .55rem}
.book-page-jump label {display:flex;flex:1 1 8rem;min-width:0;max-width:100%;flex-wrap:wrap;align-items:center;gap:.35rem .55rem}
.book-page-jump select {flex:1 1 5rem;width:auto;min-width:0;margin:0;min-height:44px}
.book-page-jump button {margin:0}
dialog.book-page-reorder {width:min(94vw,25rem);margin:auto}
.book-page-reorder label:not([hidden]) {display:grid;gap:.3rem;margin:.55rem 0}
.book-page-reorder select {min-width:0;width:100%;min-height:44px;font:inherit}
@media (max-width:719px){
 .book-page-jump {
  position:sticky;top:0;z-index:2;
  background:#f3f6fa;border-block-end:1px solid #cedbec;padding:.35rem 0 .45rem;
 }
 .book-editor .page-card {scroll-margin-block-start:calc(var(--book-page-jump-height, 0px) + .5rem);gap:.55rem}
 .placement-card {scroll-margin-block-start:calc(var(--book-page-jump-height, 0px) + .5rem)}
 .book-add-page-photos {scroll-margin-block-end:.5rem}
 .placement-actions button[data-move-placement]:disabled {display:none}
}
dialog.book-preview-dialog {margin:auto;padding:clamp(.55rem,2vw,1rem);border-radius:.9rem;overscroll-behavior:contain}
.preview-dialog-header {gap:.35rem}
dialog.book-preview-start-review {scroll-padding-block-start:7rem}
.book-preview-start-review .preview-dialog-header {position:sticky;top:0;z-index:1;background:inherit;box-shadow:0 -1rem 0 #fff;padding-block:.35rem}
.preview-dialog-header h2 {font-size:clamp(1.12rem,2vw,1.45rem)}
.preview-status {font-size:.9rem;color:#37536e}
.preview-stage {background:#e8eef6;border-color:#cedbec;padding:clamp(.45rem,1.5vw,1rem)}
.preview-stage .preview-cover {width:100%;max-width:clamp(15rem,58vh,36rem);margin-inline:auto}
.preview-stage .preview-cover.design-shape-portrait {max-width:min(48vh,25rem)}
.preview-stage .preview-cover.design-shape-square {max-width:min(58vh,32rem)}
.preview-cover:not(.design-shape-square):not(.design-shape-landscape):not(.design-shape-portrait) .photo-frame {
 aspect-ratio:4/3;
}
.preview-stage .preview-spread:has(> :only-child) {grid-template-columns:minmax(0,1fr);max-width:36rem;margin-inline:auto}
.book-review-panel {margin-top:1rem;padding-top:.85rem;border-top:1px solid #cedbec;display:grid;gap:.6rem;min-width:0}
.book-review-panel h3 {margin:0;font-family:Georgia,serif;color:#143969;font-size:1.05rem}
.book-review-list {list-style:none;margin:0;padding:0;display:grid;gap:.55rem;min-width:0}
.book-review-item {
 padding:.6rem .75rem;border-radius:.5rem;border:1px solid #cedbec;background:#f8fafc;
 display:grid;gap:.45rem;min-width:0;overflow-wrap:anywhere;
}
.book-review-unavailable,.book-review-empty-pages,.book-review-empty-cover {
 background:#fff6ed;border-color:#e6b88a;color:#7c340b;
}
.book-review-ready {background:#f1f7f3;border-color:#b9d5c0;color:#1b4332}
.book-review-targets {display:flex;flex-wrap:wrap;gap:.45rem;min-width:0}
.book-review-target-actions {
 display:inline-flex;flex-wrap:wrap;align-items:center;gap:.3rem;padding:.2rem .3rem;
 border-radius:.45rem;background:rgba(255,255,255,.85);border:1px solid #d2dce7;max-width:100%;
}
.book-review-target-actions button {margin:0;font-size:.88rem;padding:.35rem .65rem}
.book-review-edit:not(:disabled) {color:#17497c;background:#f6f9ff;border-color:#6485a9;font-weight:600}
.book-review-actions {margin-top:.25rem}
.book-review-actions .primary-action:not(:disabled) {background:#17497c;border-color:#17497c;color:#fff;font-weight:650}
.proof-export-status {margin:0;font-size:.88rem;color:#37536e;min-height:1.3em;overflow-wrap:anywhere}
@media (min-width:720px){
 .cover-editor-grid {grid-template-columns:minmax(0,1.12fr) minmax(0,1fr)}
 .cover-fields {padding:.35rem}
 .book-editor .cover-heading-save {display:none}
}
@media (hover:hover){
 .book-editor button:not(:disabled):hover,.book-photo-picker button:not(:disabled):hover,.book-preview-dialog button:not(:disabled):hover {background:#e7effa;border-color:#6485a9}
 .book-command-bar .primary-save:not(:disabled):hover,.preview-steps button[aria-current="step"]:hover {background:#102e53;border-color:#102e53}
}
@media (prefers-reduced-motion:no-preference){
 .book-editor button,.book-photo-picker button,.book-preview-dialog button {transition:background-color .14s,border-color .14s}
}

/* Spread orientation and persistent current page; no new navigation state. */
.book-editor .page-header {
 display:flex;flex-wrap:wrap;align-items:center;gap:.2rem .5rem;
}
.book-editor .page-header [data-page-heading] {flex:1 0 auto;max-width:100%}
.book-editor .page-count {flex-basis:100%}
.page-current-marker {
 visibility:hidden;display:inline-block;flex:0 0 auto;padding:.1rem .45rem;border-radius:1rem;
 font-size:.75rem;line-height:1.5;font-weight:650;color:#fff;background:#17497c;
}
.book-editor .page-card[aria-current="page"] {border-color:#17497c;box-shadow:inset 0 0 0 1px #17497c}
.page-card[aria-current="page"] .page-current-marker {visibility:visible}
/* Keep the existing pair visible as a spread on short landscape phones. */
@media (min-width:600px) and (max-height:500px) and (orientation:landscape) {
 .book-editor .pages {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
 .book-editor .page-settings {grid-template-columns:minmax(0,1fr);align-items:stretch}
 .book-editor .page-canvas .photo-frame {max-width:12rem;margin-inline:auto}
}

/* Keep the photo and its controls together on short landscape screens. */
dialog.book-crop-dialog {box-sizing:border-box}
@media (max-height:500px) and (orientation:landscape) {
 dialog.book-crop-dialog {max-height:calc(100dvh - 1rem);padding:.75rem}
 .book-crop-dialog h2 {margin:0;font-size:1.125rem;line-height:1.25}
 .book-crop-dialog .dialog-subtitle {margin:.2rem 0 .6rem;font-size:.85rem;overflow-wrap:anywhere}
 .book-crop-dialog .crop-workspace {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:.75rem;align-items:start;
 }
 .book-crop-dialog .crop-preview-panel,.book-crop-dialog .crop-controls {min-width:0}
 .book-crop-dialog .crop-preview-stage {
  max-width:min(100%,max(8rem,calc((100dvh - 13rem)*1.333333)));margin:0 auto .35rem;
 }
 .book-crop-dialog .crop-readout {margin:0;font-size:.8rem;line-height:1.35}
 .book-crop-dialog .crop-controls {gap:.3rem}
 .book-crop-dialog .crop-control {
  display:grid;grid-template-columns:minmax(0,7rem) minmax(0,1fr);gap:.35rem;align-items:center;font-size:.85rem;
 }
 .book-crop-dialog .crop-control input[type="range"] {margin:0;min-width:0;max-width:100%}
 .book-crop-dialog .dialog-actions {margin:.6rem 0 0;gap:.45rem}
 .book-crop-dialog .dialog-actions button {margin:0}
}
.spread-card {content-visibility:auto;contain-intrinsic-block-size:auto 52rem}

/* Full current choice when enlarged text makes the native select truncate. */
.page-decoration-controls {container-type:inline-size;padding:clamp(.35rem,2vw,.75rem)}
.page-decoration-controls select {padding-block:.3rem}
.page-decoration-controls .decoration-current-choice {display:none;margin-top:.25rem;font-size:.85em;line-height:1.35;color:#37536e;overflow-wrap:anywhere}
@container (max-width:11em) {
 .page-decoration-controls .decoration-current-choice {display:block}
}

/* Leave room for the focused field and its full label on short screens. */
@media (max-width:719px) and (max-height:480px) {
 .book-editor:has(.page-decoration-controls:focus-within) .book-page-jump {position:static}
}

/* Studio surfaces frame the editor without styling the customer's book design. */
@font-face {
 font-family:"DM Sans";
 src:url("/assets/type/dm-sans-latin-wght.woff2") format("woff2");
 font-weight:100 1000;
 font-display:swap;
}
body:has(.book-command-bar) {
 --studio-ink:#17364B;
 --studio-ivory:#FAF8F3;
 --studio-muted:#52646A;
 --studio-edge:#DADBD5;
 --studio-sheet:#fff;
 --studio-stage:#F0EEE7;
 background:var(--studio-ivory);
}
.book-editor:has(.book-command-bar) {
 font-family:"DM Sans",system-ui,sans-serif;
 max-width:74rem;
 color:var(--studio-ink);
}
.book-command-bar {
 gap:.5rem 1.25rem;
 padding:.65rem 0 .6rem;
 border-color:var(--studio-edge);
}
.book-command-bar .brand-mark {color:var(--studio-ink);font-size:1rem;margin:0 0 .1rem}
.book-editor .book-command-bar h1 {
 color:var(--studio-ink);
 font-size:clamp(1.5rem,2.7vw,2.2rem);
 font-weight:500;
 letter-spacing:-.025em;
}
.book-command-bar .editor-toolbar button:not(:disabled) {
 color:var(--studio-ink);
 background:var(--studio-sheet);
 border-color:#9eafb6;
 font-weight:600;
}
.book-command-bar .editor-toolbar .primary-save:not(:disabled),
.book-command-bar .editor-toolbar:has(.primary-save:disabled) .secondary-action:not(:disabled) {
 color:#fff;
 background:var(--studio-ink);
 border-color:var(--studio-ink);
}
.book-editor:has(.book-command-bar) > .editor-status {margin:.35rem 0 .3rem;color:var(--studio-muted)}
.book-editor:has(.book-command-bar) .book-title-field {margin-bottom:.25rem}
.book-editor [id^="book-title-hint-"] {color:var(--studio-muted)}
.book-editor .book-section-navigation {
 gap:0 clamp(.1rem,1vw,.45rem);
 margin-top:.15rem;
 padding:0;
 border-bottom:1px solid var(--studio-edge);
}
.book-section-navigation button {
 color:var(--studio-ink);
 font-size:.9rem;
 font-weight:600;
}
.book-editor .book-quick-start {
 margin:.25rem 0 .6rem;
 border-color:var(--studio-edge);
 background:var(--studio-sheet);
}
.book-editor .book-quick-start:has(.book-quick-start-disclosure:not([open])) {
 padding:0 .45rem;
 border-color:transparent;
 background:transparent;
}
.book-quick-start-disclosure > summary {padding:.4rem 0;color:var(--studio-ink)}
.book-editor .book-quick-start h2 {color:var(--studio-ink);font-size:1rem;font-weight:600}
.book-editor :is(.book-cover-section,.book-design-section,.spread-card) {
 background:var(--studio-sheet);
 border-color:var(--studio-edge);
 border-radius:.85rem;
}
.book-editor .book-cover-section {margin:.45rem 0 1.25rem}
.book-cover-section > h2,.book-pages-header > h2,.book-design-section > h2 {
 color:var(--studio-ink);
 font-size:1.4rem;
 font-weight:500;
 letter-spacing:-.015em;
}
.book-cover-section > h2 {margin-bottom:.55rem}
.book-cover-stage {
 gap:.5rem;
 padding:clamp(.4rem,1.2vw,.9rem);
 background:var(--studio-stage);
}
.book-cover-stage .cover-card:not(.deco-frame-mat) {box-shadow:0 4px 14px #28372e1f,0 1px 2px #28372e24}
.book-cover-stage .cover-photo-actions {gap:.3rem}
.book-cover-stage .cover-photo-actions button {font-size:.875rem;line-height:1.2}
.book-cover-stage .cover-photo-actions button:not(:disabled),
.book-editor .book-add-page-photos:not(:disabled) {
 color:var(--studio-ink);
 background:#fff;
 border-color:#91a8b5;
}
.book-cover-stage .cover-photo-actions button:first-child:not(:disabled),
.book-editor .book-add-page-photos:not(:disabled) {background:#ecf3f5}
.book-editor .spread-card {
 background:var(--studio-stage);
 padding:clamp(.55rem,1.4vw,1.15rem);
}
.spread-header h2 {color:var(--studio-ink);font-weight:600}
.book-editor .page-card {
 background:var(--studio-sheet);
 border-color:#d3d6d0;
 box-shadow:0 2px 5px #28372e14;
}
.book-editor .page-card[aria-current="page"] {
 border-color:var(--studio-ink);
 box-shadow:inset 0 0 0 1px var(--studio-ink),0 2px 5px #28372e14;
}
.book-editor .page-card .placement-card {background:#fff;border-color:var(--studio-edge)}
.book-editor .page-card .crop-availability-note {color:var(--studio-muted)}
body:has(.book-command-bar) dialog.book-preview-dialog {
 color:var(--studio-ink);
 background:var(--studio-sheet);
 border-color:var(--studio-edge);
 font-family:"DM Sans",system-ui,sans-serif;
}
body:has(.book-command-bar) .book-preview-start-review .preview-dialog-header {
 box-shadow:0 -1rem 0 var(--studio-sheet);
}
body:has(.book-command-bar) .book-preview-dialog .preview-stage {
 background:var(--studio-stage);
 border-color:var(--studio-edge);
}
body:has(.book-command-bar) .book-preview-dialog .preview-dialog-header > h2,
body:has(.book-command-bar) .book-preview-dialog .book-review-panel > h3 {color:var(--studio-ink)}
@media (max-width:719px) {
 .book-editor .book-page-jump {background:var(--studio-ivory);border-color:var(--studio-edge)}
}
@media (max-width:599px) {
 .book-cover-stage .cover-photo-actions button {flex-basis:max(7rem,calc((100% - .3rem) / 2))}
}
@media (min-width:720px) {
 .book-editor .cover-editor-grid {grid-template-columns:minmax(0,1.22fr) minmax(0,1fr)}
 .book-cover-stage .cover-card {order:-1;max-width:30rem}
 .book-cover-stage .cover-card.design-shape-portrait {max-width:25rem}
 .book-editor .pages {gap:.45rem}
 .book-editor .page-card:first-child:not(:only-child) {
  border-start-end-radius:.2rem;
  border-end-end-radius:.2rem;
 }
 .book-editor .page-card:nth-child(2) {
  border-start-start-radius:.2rem;
  border-end-start-radius:.2rem;
 }
}
@media (min-width:960px) {
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
  align-items:start;
  gap:.25rem clamp(1.5rem,4vw,3rem);
  margin-top:.45rem;
 }
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) > .book-title-field {grid-area:1 / 1}
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) > [id^="book-title-hint-"] {grid-area:2 / 1}
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) > .book-section-navigation {grid-area:1 / 2}
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) > .book-quick-start {grid-area:2 / 2;margin:0}
 .book-editor > fieldset:has(> .book-title-field + [id^="book-title-hint-"] + .book-section-navigation) > :is(.book-cover-section,.book-pages-section,.book-design-section) {grid-column:1 / -1}
}
@media (hover:hover) {
 .book-command-bar .editor-toolbar button:not(:disabled):hover,
 .book-cover-stage .cover-photo-actions button:not(:disabled):hover,
 .book-editor .book-add-page-photos:not(:disabled):hover {background:#e1ecf0;border-color:#587f91}
 .book-command-bar .editor-toolbar .primary-save:not(:disabled):hover,
 .book-command-bar .editor-toolbar:has(.primary-save:disabled) .secondary-action:not(:disabled):hover {
  color:#fff;
  background:#112e42;
  border-color:#112e42;
 }
}
