.collection-dialog{color-scheme:light;box-sizing:border-box;width:min(1040px,calc(100vw - 32px));max-width:calc(100vw - 16px);max-height:92dvh;margin:auto;padding:0;overflow:hidden;border:2px solid #e0bca0;border-radius:28px;background:#fff4e9;color:#70435c;box-shadow:0 22px 80px #24162b99;font-family:"Yu Gothic UI","Meiryo",sans-serif}
.collection-dialog[open]{display:flex;flex-direction:column}
.collection-dialog::backdrop{background:#40283dd6}
.collection-dialog *{box-sizing:border-box}
.collection-dialog [hidden]{display:none!important}
.collection-header{display:flex;flex:none;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px 28px 18px;border-bottom:1px solid #ebcfd0;background:linear-gradient(115deg,#fff6e9,#ffedf0)}
.collection-heading-copy{min-width:0}
.collection-eyebrow{margin:0 0 6px;color:#8b5b71;font-size:12px;line-height:1.6;letter-spacing:.08em}
.collection-header h1{margin:0;font-size:clamp(23px,3vw,32px);line-height:1.4;letter-spacing:.05em}
.collection-intro{max-width:40em;margin:8px 0 0;font-size:14px;line-height:1.75;overflow-wrap:anywhere}
.collection-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:9px 16px;border:1px solid #bc839d;border-radius:13px;background:#fff8ee;color:#70435c;font:600 14px/1.45 "Yu Gothic UI","Meiryo",sans-serif;cursor:pointer;touch-action:manipulation;overflow-wrap:anywhere}
.collection-button:disabled{cursor:default;opacity:.5}
.collection-close{flex:none}
.collection-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding-block:16px;padding:18px 28px 22px}
.collection-summary{display:table;margin:0 0 16px;padding:6px 13px;border:1px solid #e9c899;border-radius:999px;background:#fff0d7;color:#775138;font-size:14px;font-weight:600;line-height:1.5;font-variant-numeric:tabular-nums}
.collection-groups{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:20px}
.collection-group{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;min-height:52px;padding:11px 12px;border:1px solid #d9b2c0;border-radius:14px;background:#fffaf2;color:#70435c;font:600 14px/1.5 "Yu Gothic UI","Meiryo",sans-serif;text-align:left;cursor:pointer;touch-action:manipulation}
.collection-group[aria-pressed="true"]{border:2px solid #a55c7d;padding:10px 11px;background:#f6dfe8;box-shadow:0 3px 0 #a55c7d1a}
.collection-group-label{min-width:0;overflow-wrap:anywhere}
.collection-group-count{flex:none;min-width:2.7em;padding:2px 6px;border-radius:999px;background:#fff8ee;font-size:12px;text-align:center;font-variant-numeric:tabular-nums}
.collection-group-title{margin:0 0 12px;font-size:18px;line-height:1.5;scroll-margin-block:16px}
.collection-empty{margin:8px 0 20px;font-size:14px;line-height:1.7}
.collection-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0;padding:0;list-style:none}
.collection-card{min-width:0;overflow:hidden;border:1px solid #e4bdc4;border-radius:16px;background:#fffaf4;box-shadow:0 3px 8px #80536b0a}
.collection-card-open{display:block;width:100%;height:100%;min-width:0;margin:0;padding:0;border:0;border-radius:15px;background:transparent;color:#70435c;text-align:left;font:inherit;cursor:pointer;touch-action:manipulation}
.collection-card-picture{display:grid;place-items:center;aspect-ratio:4/3;overflow:hidden;background:#f7e6e6}
.collection-thumbnail{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;transition:filter .16s,transform .16s}
.collection-picture-fallback{padding:12px;color:#85536e;font-size:14px}
.collection-card-title{display:block;min-height:3.8em;padding:10px 12px;font-size:13px;font-weight:600;line-height:1.55;overflow-wrap:anywhere}
.collection-card-locked{display:grid;min-height:0;border-style:dashed;border-color:#d9bbc3;background:#f8eeeb;box-shadow:none}
.collection-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;aspect-ratio:1/1;padding:14px;color:#80576b;text-align:center}
.collection-placeholder-ornament{display:grid;place-items:center;width:56px;height:56px;border:1px solid #dec3c9;border-radius:18px;background:#fff7f0;color:#ad7b8f;font-size:36px;line-height:1}
.collection-placeholder-title{font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.collection-pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:20px}
.collection-page-label{min-width:7em;margin:0;color:#85546d;font-size:13px;line-height:1.5;text-align:center;font-variant-numeric:tabular-nums}
.collection-preview{display:grid;justify-items:start;gap:12px}
.collection-preview-title{margin:2px 0;font-size:20px;line-height:1.5;overflow-wrap:anywhere}
.collection-full-picture{width:100%;margin:0;padding:12px;border:1px solid #e5c3cc;border-radius:18px;background:#fffaf3}
.collection-full-image{display:block;width:100%;height:auto;max-height:56dvh;aspect-ratio:4/3;object-fit:contain;border-radius:10px;background:#faeee9}
.collection-image-status{margin:8px 0 0;color:#80536c;font-size:14px;line-height:1.7;text-align:center;overflow-wrap:anywhere}
.collection-image-status:empty{display:none}
.collection-footer{display:grid;flex:none;gap:10px;padding:12px 28px 18px;border-top:1px solid #ebcfd0;background:#fff4e9}
.collection-storage-hint{margin:0;padding:8px 12px;border:1px solid #d8b7b8;border-radius:10px;background:#fff9ed;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.collection-return{justify-self:center;min-width:min(280px,100%);background:#f6dde6}
.collection-dialog button:focus-visible{outline:3px solid #bd7a26;outline-offset:3px;box-shadow:0 0 0 6px #f7dba955}
.collection-card-open:focus-visible{outline-offset:-5px;box-shadow:inset 0 0 0 8px #f7dba999}
.collection-dialog h1:focus-visible,.collection-dialog h2:focus-visible{outline:2px solid #a55c7d;outline-offset:4px;border-radius:4px}
@media(hover:hover) and (pointer:fine){
 .collection-button:hover:enabled,.collection-group:hover:enabled{background:#ffe7bd;box-shadow:0 4px 14px #d49a5f38;transform:translateY(-1px)}
 .collection-card-open:hover:enabled{background:#fff0df;box-shadow:inset 0 0 16px #e8b56255}
 .collection-card-open:hover:enabled .collection-thumbnail{filter:brightness(1.06);transform:scale(1.025)}
}
html[data-motion="reduced"] .collection-thumbnail{transform:none!important;transition:filter .12s}
@media(prefers-reduced-motion:reduce){html:not([data-motion="full"]) .collection-thumbnail{transform:none!important;transition:filter .12s}}
@media(max-width:720px){.collection-dialog{width:calc(100vw - 20px);max-height:94dvh;border-radius:22px}.collection-header{padding:18px 18px 14px;gap:12px}.collection-scroll{padding:16px 18px 18px}.collection-footer{padding:12px 18px 16px}.collection-groups{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:18px}.collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.collection-card-title{font-size:13px}.collection-placeholder{aspect-ratio:4/3;min-height:164px}.collection-pagination{gap:10px}.collection-pagination .collection-button{padding-inline:12px}.collection-full-picture{padding:8px}}
@media(max-width:390px){.collection-header{padding:15px 13px 12px}.collection-eyebrow{font-size:11px;letter-spacing:.02em}.collection-header h1{font-size:22px;letter-spacing:.02em}.collection-intro{font-size:13px}.collection-close{padding-inline:10px}.collection-scroll{padding:14px 13px 16px}.collection-footer{padding:10px 13px 13px}.collection-group{font-size:13px;padding-inline:9px}.collection-group[aria-pressed="true"]{padding-inline:8px}.collection-grid{gap:9px}.collection-card-title{padding:9px;font-size:12px}.collection-placeholder{min-height:142px;padding:9px;gap:8px}.collection-placeholder-title{font-size:11px}.collection-placeholder-ornament{width:44px;height:44px;font-size:28px}.collection-pagination{gap:7px}.collection-pagination .collection-button{padding-inline:8px;font-size:12px}.collection-page-label{min-width:6em;font-size:12px}}
@media(max-height:520px){.collection-dialog{max-height:96dvh;border-radius:18px}.collection-header{padding-block:11px}.collection-eyebrow{display:none}.collection-header h1{font-size:23px}.collection-intro{margin-top:4px;font-size:12px}.collection-scroll{padding-top:12px;padding-bottom:14px}.collection-footer{padding-top:9px;padding-bottom:9px}.collection-summary{margin-bottom:12px}.collection-full-image{max-height:52dvh}.collection-preview-title{font-size:17px}}

/* A preview uses the remaining dialog height; the picture itself stays whole. */
.collection-dialog[data-view="preview"]{width:min(1120px,calc(100vw - 16px));height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);border-radius:20px}
.collection-dialog[data-view="preview"] .collection-header{align-items:center;gap:12px;padding:8px 16px}
.collection-dialog[data-view="preview"] .collection-eyebrow,.collection-dialog[data-view="preview"] .collection-intro,.collection-dialog[data-view="preview"] .collection-summary{display:none}
.collection-dialog[data-view="preview"] .collection-header h1{font-size:18px;line-height:1.4;letter-spacing:.02em}
.collection-dialog[data-view="preview"] .collection-scroll{display:flex;flex:1 1 0;flex-direction:column;min-width:0;overflow:hidden;scrollbar-gutter:auto;padding:6px 14px}
.collection-dialog[data-view="preview"] .collection-preview{display:grid;flex:1 1 0;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-items:center;justify-items:stretch;gap:8px 12px;min-width:0;min-height:0;width:100%}
.collection-dialog[data-view="preview"] .collection-preview-back{grid-column:1;grid-row:1;justify-self:start;min-height:44px;white-space:nowrap}
.collection-dialog[data-view="preview"] .collection-preview-title{grid-column:2;grid-row:1;min-width:0;margin:0;font-size:17px;line-height:1.4}
.collection-dialog[data-view="preview"] .collection-full-picture{display:flex;grid-column:1/-1;grid-row:2;flex-direction:column;min-width:0;min-height:0;height:100%;padding:6px;border-radius:14px;overflow:hidden}
.collection-dialog[data-view="preview"] .collection-full-image{flex:1 1 0;min-height:0;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:contain}
.collection-dialog[data-view="preview"] .collection-image-status{flex:none;max-height:4.5em;margin:4px 0 0;overflow:auto;font-size:12px;line-height:1.5}
.collection-dialog[data-view="preview"] .collection-footer{gap:6px;padding:8px 14px}
.collection-dialog[data-view="preview"] .collection-storage-hint{max-height:4.5em;padding:4px 6px;overflow:auto;font-size:12px;line-height:1.5}
.collection-dialog[data-view="preview"] .collection-close,.collection-dialog[data-view="preview"] .collection-return{min-height:44px}
@media(max-width:390px){
 .collection-dialog[data-view="preview"] .collection-header{padding:6px 10px}
 .collection-dialog[data-view="preview"] .collection-header h1{font-size:16px}
 .collection-dialog[data-view="preview"] .collection-scroll{padding:6px 8px}
 .collection-dialog[data-view="preview"] .collection-preview{gap:6px 8px}
 .collection-dialog[data-view="preview"] .collection-preview-title{font-size:15px}
 .collection-dialog[data-view="preview"] .collection-preview-back{padding-inline:10px}
 .collection-dialog[data-view="preview"] .collection-footer{padding:6px 10px}
}
/* On a low landscape screen, controls use a side rail rather than picture height. */
@media(max-height:420px) and (min-width:480px){
 .collection-dialog[data-view="preview"][open]{display:grid;grid-template-columns:128px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:16px}
 .collection-dialog[data-view="preview"] .collection-header{grid-column:1;grid-row:1;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;padding:8px;border-right:1px solid #ebcfd0;border-bottom:0}
 .collection-dialog[data-view="preview"] .collection-header h1{font-size:16px}
 .collection-dialog[data-view="preview"] .collection-close{width:100%}
 .collection-dialog[data-view="preview"] .collection-scroll{grid-column:2;grid-row:1/-1;padding:8px}
 .collection-dialog[data-view="preview"] .collection-preview{gap:8px}
 .collection-dialog[data-view="preview"] .collection-preview-title{font-size:15px}
 .collection-dialog[data-view="preview"] .collection-preview-back{padding-inline:10px;font-size:13px}
 .collection-dialog[data-view="preview"] .collection-footer{grid-column:1;grid-row:2;padding:8px;border-top:0;border-right:1px solid #ebcfd0}
 .collection-dialog[data-view="preview"] .collection-return{min-width:0;width:100%;padding-inline:4px;font-size:13px}
}
