.photo-book-catalog { container: photo-book-catalog / inline-size; margin: 24px 0; padding: 20px; background: #f7f9fb; border: 1px solid #dce2e8; border-radius: 8px; line-height: 1.7; }
.photo-book-catalog h2 { font-size: 1.2rem; margin: 0 0 8px; }
.photo-book-catalog-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; margin: 16px 0; }
@container photo-book-catalog (min-width: 540px) { .photo-book-catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@container photo-book-catalog (min-width: 840px) { .photo-book-catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.photo-book-product { background: #fff; border: 1px solid #e0e5ea; border-radius: 6px; padding: 16px; min-width: 0; overflow-wrap: anywhere; }
.photo-book-product img { width: 100%; height: 170px; object-fit: contain; }
.photo-book-product h3 { font-size: 1rem; margin: 12px 0 6px; }
.photo-book-product a { display: block; margin-top: 12px; text-align: center; }
.photo-book-note { font-size: .85rem; line-height: 1.7; }
.photo-book-page > .container > .main_column,
.photo-book-page .main_column:has(#photo-book-form) { min-width: 0; max-width: 100%; }
.photo-book-editor { container: photo-book-editor / inline-size; padding-bottom: 40px; min-width: 0; line-height: 1.7; }
.photo-book-heading { margin-bottom: 24px; }
.photo-book-kicker { margin: 0 0 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: #64748b; }
.photo-book-editor h1.heading_border { margin: 0 0 20px; }
.photo-book-specs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; margin: 12px 0; }
.photo-book-specs strong { font-size: 1.35rem; font-weight: 700; }
.photo-book-specs small { font-size: .8rem; }
.photo-book-intro { margin: 16px 0 0; font-size: .9rem; line-height: 1.9; }
.photo-book-editor h2.photo-book-section-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 18px; padding: 0 0 12px; border-bottom: 1px solid #dce2e8; }
.photo-book-editor button,.photo-book-editor input { font: inherit; }
.photo-book-editor button:not([data-book-submit]) { min-height: 44px; padding: 8px 14px; border: 1px solid #aeb9c5; border-radius: 5px; background: #fff; cursor: pointer; }
.photo-book-editor button:disabled { opacity: .5; cursor: default; }
.photo-book-editor :focus-visible { outline: 3px solid #2772bd; outline-offset: 3px; }
.photo-book-editor input[type=search] { display: block; width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #aeb9c5; border-radius: 5px; }
.photo-book-error { color: #b02128; }
.photo-book-error:empty { display: none; }
.photo-book-covers { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-book-cover-picker { margin: 18px 0; padding: 12px; border: 1px solid #dce2e8; border-radius: 6px; }
.photo-book-cover-picker summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-book-cover-picker summary img { width: 44px; height: 44px; object-fit: contain; }
.photo-book-cover-picker summary span { margin-left: auto; text-decoration: underline; font-size: .85rem; }
.photo-book-cover-picker[open] .photo-book-covers { margin-top: 14px; }
.photo-book-cover { display: grid; grid-template-columns: auto 80px minmax(0,1fr); align-items: center; gap: 8px; padding: 12px; border: 1px solid #aeb9c5; border-radius: 6px; cursor: pointer; max-width: 260px; }
.photo-book-cover:has(input:checked) { border: 2px solid #2772bd; background: #f0f6fc; }
.photo-book-cover img { width: 80px; height: 80px; object-fit: contain; }
.photo-book-cover span { overflow-wrap: anywhere; }
.photo-book-workspace { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; align-items: start; margin-top: 24px; }
@container photo-book-editor (min-width: 800px) { .photo-book-workspace { grid-template-columns: minmax(0,1fr) 300px; } }
.photo-book-gallery { min-width: 0; padding: 20px; border: 1px solid #dce2e8; border-radius: 8px; }
.photo-book-gallery-tools { padding: 14px; margin-bottom: 16px; border-radius: 6px; background: #f7f9fb; }
.photo-book-selection { min-width: 0; padding: 20px 14px; border: 1px solid #dce2e8; border-radius: 8px; margin: 0; background: #f7f9fb; scroll-margin-top: 100px; }
.photo-book-selection [data-book-status] { font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
.photo-book-filters { display: grid; grid-template-columns: minmax(0,1fr); min-width: 0; gap: 6px; margin-bottom: 12px; }
.photo-book-filters select { font: inherit; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 10px; border: 1px solid #aeb9c5; border-radius: 5px; background: #fff; }
.photo-book-search { font-size: .9rem; }
.photo-book-search summary { cursor: pointer; min-height: 36px; }
.photo-book-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-book-pagination input { width: 65px; min-height: 40px; box-sizing: border-box; }
.photo-book-selected { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; max-height: none; overflow: visible; margin: 16px 0; padding: 0; list-style: none; }
.photo-book-selected li, .photo-book-drag-ghost { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 10px; padding: 12px 10px; background: #fff; border: 1px solid #cdd6df; border-radius: 7px; box-sizing: border-box; overflow-wrap: anywhere; }
.photo-book-selected img, .photo-book-drag-ghost img { display: block; width: 100%; height: 170px; object-fit: contain; }
.book-selected-media { grid-column: 2; position: relative; min-width: 0; }
.book-selected-info { grid-column: 2; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .8rem; }
.book-selected-info p { margin: 0; }
.book-selected-number { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 50%; background: #e9eff6; font-weight: 700; font-size: .9rem; }
.photo-book-selected .book-reorder, .photo-book-drag-ghost .book-reorder { cursor: grab; touch-action: none; padding: 3px; width: 30px; min-height: 52px; background: #edf2f7; border: 1px solid #d5dee8; color: #52677e; }
.book-reorder svg { width: 22px; height: 28px; display: block; }
.photo-book-dragging, .photo-book-dragging * { cursor: grabbing !important; user-select: none !important; }
.photo-book-selected .is-drag-placeholder { opacity: .35; border: 2px dashed #6489af; background: #e9f1f9; }
.photo-book-drag-ghost { position: fixed; z-index: 10000; pointer-events: none; margin: 0; box-shadow: 0 12px 30px #243e5e40; border: 2px solid #6489af; transform: rotate(1deg); }
.photo-book-drag-ghost button { font: inherit; }
.photo-book-selected .photo-book-empty { display: block; padding: 22px 14px; border-style: dashed; background: transparent; color: #64748b; font-size: .85rem; }
.photo-book-selected .book-move { padding: 5px; font-size: .8rem; }
.book-item-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-book-images { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 16px 0; }
.photo-book-editor .book-candidate { display: flex; flex-direction: column; align-items: stretch; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.book-candidate img { width: 100%; height: 150px; object-fit: contain; }
.book-candidate[aria-pressed=true] { border: 2px solid #2772bd; background: #f0f6fc; }
.book-candidate span { font-size: .85rem; }
.book-candidate-card { position: relative; min-width: 0; }
.book-candidate-card .book-candidate { width: 100%; height: 100%; box-sizing: border-box; gap: 8px; }
.photo-book-editor .book-zoom { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 8px; border: 1px solid #a8b9cb; border-radius: 50%; color: #304860; background: #fff; box-shadow: 0 2px 6px #0002; }
.book-zoom svg { display: block; width: 20px; height: 20px; }
.book-selected-media .book-zoom { top: auto; bottom: 0; right: 0; }
.photo-book-preview { width: min(900px, 92vw); max-height: 90vh; padding: 0; border: 1px solid #dce2e8; border-radius: 10px; color: #25364b; background: #fff; }
.photo-book-preview::backdrop { background: #0f172abf; }
.photo-book-preview-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.photo-book-preview-header h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.photo-book-preview-header button { min-height: 44px; padding: 8px 14px; border: 1px solid #a8b9cb; border-radius: 6px; background: #f0f4f8; color: #25364b; font: inherit; cursor: pointer; }
.photo-book-preview > img { display: block; width: 100%; height: min(65vh, 650px); object-fit: contain; background: #f5f7fa; }
.photo-book-preview > p { padding: 14px 18px; margin: 0; overflow-wrap: anywhere; }
.photo-book-action-bar { position: sticky; bottom: 0; z-index: 5; padding: 14px; margin-top: 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: #fff; box-shadow: 0 -3px 15px #0002; border-radius: 6px; }
.photo-book-action-bar [data-book-progress] { flex: 1 0 100%; font-size: .85rem; }
.photo-book-quantity { display: flex; gap: 10px; align-items: center; }
.photo-book-quantity label { font-weight: 700; font-size: .9rem; }
.photo-book-stepper { display: flex; align-items: stretch; border: 1px solid #8fa4b9; border-radius: 6px; overflow: hidden; background: #edf2f7; }
.photo-book-editor .photo-book-stepper button { width: 42px; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: #e6edf5; color: #253f5c; font-size: 1.2rem; font-weight: 700; }
.photo-book-action-bar .photo-book-stepper input { width: 56px; min-width: 0; padding: 8px 2px; border: 0; border-left: 1px solid #b8c7d6; border-right: 1px solid #b8c7d6; border-radius: 0; background: #fff; color: #1e293b; font-weight: 700; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.photo-book-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.photo-book-amount { display: grid; gap: 2px; }
.photo-book-amount span { font-size: .75rem; }
.photo-book-amount strong { font-size: 1.25rem; font-weight: 700; }
.photo-book-editor [data-book-submit] { min-width: 180px; min-height: 44px; padding: 10px 18px; font-weight: 700; }
.photo-book-cart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
@media(max-width:600px) { .photo-book-gallery { padding: 14px; } .photo-book-images { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .book-candidate img { height: 110px; } .photo-book-action-bar { gap: 12px; padding: 12px; } .photo-book-action-bar [data-book-submit] { flex: 1 0 100%; } }

/* Editor controls override the shared button defaults only within this screen. */
.photo-book-editor .photo-book-stepper button,
.photo-book-editor .photo-book-selected .book-reorder,
.photo-book-drag-ghost .book-reorder { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex-shrink: 0; line-height: 1; text-align: center; }
.photo-book-editor .photo-book-selected .book-reorder { padding: 0; }
.photo-book-editor .book-candidate[aria-pressed="true"] { border: 2px solid #2772bd; background: #e4f0fc; color: #183f66; }
.photo-book-editor .book-candidate[aria-pressed="true"] [data-state] { font-weight: 700; }
.photo-book-editor .book-candidate[aria-pressed="true"] [data-state]::before { content: '✓ '; }
.photo-book-editor .photo-book-gallery-tools { padding: 20px; margin-bottom: 24px; }
.photo-book-editor .photo-book-filters { gap: 10px; margin-bottom: 20px; }
.photo-book-editor .photo-book-search summary { display: flex; align-items: center; min-height: 44px; }
.photo-book-editor .photo-book-search summary::before { content: '▸'; margin-right: 8px; }
.photo-book-editor .photo-book-search[open] summary::before { content: '▾'; }
.photo-book-editor .photo-book-search label { display: block; margin: 12px 0 8px; }
.photo-book-editor [data-book-load-status] { margin: 0 0 24px; line-height: 1.8; }
.photo-book-editor .photo-book-pagination { justify-content: center; gap: 12px 20px; margin: 24px 0; }
.photo-book-page-links, .photo-book-page-jump { display: flex; align-items: center; justify-content: center; gap: 8px; }
.photo-book-editor .photo-book-pagination button { border-radius: 50px; min-width: 44px; min-height: 44px; padding: 8px 12px; background: #f3f4f5; border: 1px solid #e0e3e6; color: inherit; text-align: center; }
.photo-book-page-jump label { display: flex; align-items: center; gap: 8px; }
.photo-book-editor .photo-book-pagination input { padding: 8px; border: 1px solid #d4dae0; border-radius: 4px; background: #fff; text-align: center; }
dialog.photo-book-preview { position: fixed; inset: 0; margin: auto; box-sizing: border-box; }
@media(max-width:600px) { .photo-book-editor .photo-book-gallery-tools { padding: 16px; } .photo-book-page-links { gap: 6px; } .photo-book-editor .photo-book-pagination button { padding: 8px 10px; font-size: .85rem; } }
