.collage-page { --accent: #e8a87c; }
.collage-page main { max-width: 1480px; margin: auto; padding: 0 28px; }
.collage-intro { padding: 36px 0 25px; }
.collage-intro .kicker { font-size: 11px; margin-bottom: 8px; }
.collage-intro h1 { font-size: clamp(27px, 3.3vw, 42px); letter-spacing: -.035em; margin-bottom: 10px; line-height: 1.15; }
.collage-intro > p:not(.kicker) { font-size: 15px; color: #bbb; line-height: 1.6; }
.workflow { display: flex; gap: 28px; list-style: none; padding: 0; margin: 22px 0 0; font-size: 12px; color: #c7c2ba; }
.workflow li { display: flex; gap: 8px; align-items: center; }
.workflow span { width: 23px; height: 23px; border: 1px solid #66513f; border-radius: 50%; text-align: center; line-height: 21px; color: var(--accent); }
.collage-editor { border: 1px solid #3d3c39; border-radius: 12px; background: #222; overflow: hidden; }
.editor-toolbar, .preview-heading, .page-nav, .export-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-toolbar { padding: 14px 18px; background: #292928; border-bottom: 1px solid #3d3c39; flex-wrap: wrap; }
.button-row { display: flex; gap: 7px; flex-wrap: wrap; }
.collage-page button, .collage-page input, .collage-page select { font: inherit; font-size: 12px; color: #eee9e1; }
.collage-page button { padding: 9px 12px; min-height: 38px; background: #333330; border: 1px solid #51504b; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.collage-page button:hover:enabled { background: #45433e; border-color: #a58c74; }
.collage-page .accent { background: var(--accent); border-color: var(--accent); color: #201a15; font-weight: 700; }
.collage-page .accent:hover:enabled { background: #f3bd94; }
.collage-page button:disabled { opacity: .4; cursor: default; }
.collage-page :focus-visible { outline: 3px solid #ffc58c; outline-offset: 3px; }
.editor-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.settings { padding: 22px; border-right: 1px solid #3d3c39; }
.collage-editor h2 { font-size: 14px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }
.settings h2:not(:first-child), #photoSettings h2 { margin-top: 24px; padding-top: 20px; border-top: 1px solid #44413c; }
.settings label, .export-actions label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: #c5c0b8; margin-bottom: 12px; }
.collage-page select, .collage-page input[type=number] { width: 100%; min-width: 0; border: 1px solid #56524c; border-radius: 5px; background: #1b1b1a; min-height: 38px; padding: 7px 8px; }
.collage-page input[type=range] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.collage-page input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.settings label.check { flex-direction: row; align-items: center; gap: 8px; margin: 12px 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: #ada79f; line-height: 1.5; margin-bottom: 12px; }
.selected-name { font-size: 11px; overflow-wrap: anywhere; color: var(--accent); margin-bottom: 12px; }
.settings .button-row { margin: 10px 0 14px; }
.workspace { min-width: 0; padding: 22px 28px; background: #252523; }
.preview-heading h2 { margin: 0; }
.preview-heading p, #summary { font-size: 11px; color: #b9b2a7; }
.print-size-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 7px; }
.print-size-row .hint { margin: 0; }
.print-size-row button { font-size: 11px; }
.space-panel { margin-top: 15px; padding: 13px; border: 1px solid #65533f; border-radius: 6px; }
.space-panel > p:first-child { font-size: 12px; margin-bottom: 5px; color: #e4c29f; }
.space-panel .hint { margin-bottom: 9px; }
.limits-help { margin-top: 14px; font-size: 11px; color: #b9b2a7; }
.limits-help summary { cursor: pointer; padding: 8px 0; }
.limits-help p { margin: 8px 0; line-height: 1.5; }
.private-badge { font-size: 10px; color: #bdcdb4; border: 1px solid #46533e; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.paper-stage { margin: 18px 0; padding: 20px; background: #30302d; background-image: radial-gradient(#4b4941 .7px, transparent .7px); background-size: 14px 14px; border-radius: 8px; min-height: 280px; }
.paper-stage.drag-over { outline: 3px dashed var(--accent); }
.paper-wrap { position: relative; width: min(100%, 530px); margin: auto; box-shadow: 0 8px 24px #0005; background: #fff; aspect-ratio:215.9 / 279.4; }
#preview { display: block; width: 100%; height: auto; touch-action: pan-y; }
#preview.manipulating { touch-action: none; cursor: move; }
.selection { position: absolute; pointer-events: none; border: 2px solid #bb662e; outline: 1px solid #fff8; transform-origin: center; }
#resizeHandle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; min-height: 18px; padding: 0; border-radius: 3px; background: #e8a87c; pointer-events: auto; touch-action: none; cursor: nwse-resize; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; color: #373731; }
.empty-state h3 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: #373731; }
.empty-state p { color: #655f55; font-size: 12px; max-width: 230px; margin: 12px 0; }
.empty-state .hint { font-size: 10px; margin-top: 16px; }
.empty-mark { font-size: 37px; font-weight: 200; border: 1px dashed #c9b8a5; width: 74px; height: 74px; border-radius: 12px; line-height: 68px; color: #c1895f; margin-bottom: 22px; }
.page-nav { justify-content: center; flex-wrap: wrap; font-size: 11px; }
.page-nav button { font-size: 11px; }
.tray-section { margin-top: 22px; border-top: 1px solid #45423b; padding-top: 17px; }
.tray-section .hint { margin: 6px 0 12px; }
.photo-tray { display: flex; overflow-x: auto; gap: 9px; padding: 4px 2px 10px; min-height: 75px; }
.photo-tray button { flex: 0 0 76px; padding: 4px; border: 2px solid #555047; background: #302e2a; }
.photo-tray button[aria-pressed=true] { border-color: var(--accent); background: #5b4130; }
.photo-tray img { width: 64px; height: 52px; object-fit: contain; background: #fff; display: block; border-radius: 2px; }
.photo-tray span { font-size: 10px; display: block; padding-top: 4px; white-space: nowrap; }
#unplacedCount { color: #ffc58c; }
.export-bar { border-top: 1px solid #45413a; padding: 20px 22px; background: #292825; align-items: flex-start; }
.export-summary { flex: 1; min-width: 0; }
.export-summary p, #preflight { font-size: 12px; line-height: 1.55; }
#preflight ul { padding-left: 16px; color: #ebc093; margin: 0 0 9px; }
#preflight .error { color: #ffb1a1; }
#status { color: #ddd5c9; }
#storageStatus { font-size: 10px; margin: 5px 0 0; }
.export-actions { width: 225px; flex: 0 0 auto; display: grid; gap: 8px; }
.export-actions label { margin: 0; }
.export-actions .accent { min-height: 44px; font-size: 14px; }
.export-actions progress { width: 100%; accent-color: var(--accent); }
.recovery { position:fixed; z-index:30; right:16px; bottom:16px; width:min(560px, calc(100vw - 32px)); max-height:45vh; overflow:auto; padding:16px; font-size:13px; line-height:1.5; background:#3f382d; color:#f0ede8; border:1px solid #b69a7b; border-radius:10px; box-shadow:0 6px 24px #0005; }
.recovery button { margin-left: 9px; }
.collage-notes { max-width: 1000px; margin: 36px auto; color: #bcb5aa; font-size: 13px; }
.collage-notes h2 { font-size: 20px; color: #e7dfd1; margin-bottom: 8px; }
.collage-notes h3 { font-size: 14px; color: #e7dfd1; margin-bottom: 7px; }
.collage-notes > section { margin-top: 36px; scroll-margin-top: 20px; }
.collage-notes p { line-height: 1.75; margin-bottom: 12px; }
.collage-notes a { color: #efb68d; text-underline-offset: 3px; }
.collage-notes h3 { margin-top: 22px; }
.collage-jump-links { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-bottom: 16px; border-bottom: 1px solid #45413a; }
.printing-steps { padding-left: 22px; line-height: 1.75; }
.printing-steps li { padding: 5px 0 8px 5px; }
.layout-explanations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.note-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 24px; }
.collage-footer { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; font-size: 11px; padding: 24px; border-top: 1px solid #34322e; }
.collage-footer a { color: #c8b59c; }
.skip-link { position: absolute; top: -100px; left: 10px; z-index: 10; padding: 10px; color: #171717; background: #e8a87c; }
.skip-link:focus { top: 10px; }
.collage-page [hidden] { display: none !important; }
.margin-guide { position: absolute; pointer-events: none; border: 1px dashed #82735e; }
.field-error { color: #ffb1a1; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.numeric-field-error { color: #ffb1a1; font-size: 12px; line-height: 1.45; }
.collage-page input[aria-invalid=true] { border-color: #ffb1a1; }
.show-preview { margin-bottom: 16px; }
.template-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.template-presets button { padding: 9px 5px; min-height: 80px; font-size: 12px; }
.template-presets button[aria-pressed=true] { border-color: var(--accent); background: #503e30; }
.template-icon { display: grid; gap: 3px; width: 56px; height: 42px; margin: 0 auto 7px; font-size: 30px; line-height: 36px; }
.template-icon span { border: 1px solid #d7b393; background: #796651; border-radius: 2px; }
.template-slots { position: absolute; inset: 0; pointer-events: none; }
.collage-page .empty-slot { position: absolute; pointer-events: auto; border: 1px dashed #83776b; border-radius: 0; color: #645444; background: #faf8f4; padding: 2px; min-height: 0; font-size: clamp(9px, 1vw, 13px); overflow: hidden; }
.collage-page .empty-slot:hover:enabled { background: #f0e2d2; }
.page-fitting { margin: 18px 0; padding-top: 15px; border-top: 1px solid #49443b; }
.settings label { font-size: 13px; }
.collage-page input[type=number] { font-size: 16px; }
@media (min-width: 1050px) { .settings { max-height: 1120px; overflow-y: auto; scrollbar-width: thin; } }
@media (max-width: 850px) { .collage-page main { padding: 0 14px; } .editor-body { grid-template-columns: 230px minmax(0, 1fr); } .settings { padding: 15px; } .workspace { padding: 17px; } .paper-stage { padding: 12px; } .private-badge { display: none; } }
@media (max-width: 650px) {
  .collage-page .nav { padding: 16px; align-items: flex-start; flex-direction: column; }
  .collage-page .nav-links { justify-content: flex-start; gap: 12px; }
  .collage-page .nav-link { font-size: 11px; }
  .collage-intro { padding-top: 24px; } .collage-intro > p:not(.kicker) { font-size: 13px; }
  .desktop-break { display: none; } .workflow { gap: 12px; font-size: 10px; margin-top: 18px; }
  .workflow li { gap: 5px; } .workflow span { width: 20px; height: 20px; line-height: 18px; }
  .editor-toolbar { padding: 12px; gap: 10px; } .editor-toolbar button { font-size: 11px; padding: 8px 10px; }
  .editor-body { display: flex; flex-direction: column; } .workspace { order: -1; padding: 14px; }
  .settings { border-right: 0; border-top: 1px solid #45413a; padding: 20px; }
  .settings > label, .settings > .field-pair { max-width: 100%; }
  .paper-stage { padding: 14px; } .empty-state { padding: 15px; } .empty-state h3 { font-size: 16px; } .empty-mark { margin-bottom: 8px; width: 52px; height: 52px; line-height: 46px; }
  .export-bar { flex-direction: column; padding: 20px; } .export-actions { width: 100%; }
  .note-columns { grid-template-columns: 1fr; gap: 20px; } .collage-notes { margin: 28px 6px; }
}
.import-options,.import-failures { padding: 12px 16px; border-bottom: 1px solid #d7dce5; }
.import-failures { border: 1px solid #a46c49; border-radius: 8px; background: #392b24; color: #f3d2bd; }
.import-failures .hint { color: #ddbaac; }
.import-failures p { overflow-wrap: anywhere; }
.import-failures button { margin: 0 8px 8px 0; }
.collage-page dialog { margin: auto; max-width: min(640px, calc(100vw - 40px)); max-height: 80vh; overflow: auto; color: #f7eee4; background: #302d27; border: 1px solid #a46c49; border-radius: 10px; padding: 22px; }
.collage-page dialog::backdrop { background: #0009; }
#retryMapping label { display: block; margin: 16px 0; overflow-wrap: anywhere; }
#retryMapping select, .import-failures select { display: block; width: 100%; margin: 8px 0; }
#retryMappingError { color: #ffc58c; }
.page-fill-presets { display: grid; gap: 8px; margin: 12px 0; }
.empty-slot.failed-slot { border-color: #a84424; background: #fff2e8d9; color: #813419; overflow-wrap: anywhere; font-size: 12px; }
