.collection-entry{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:18px 0 6px;padding:22px;border:1px solid #ccaf7480;border-radius:14px;background:radial-gradient(ellipse at right,#b59a4e20,transparent 65%),#152d25}.collection-eyebrow{font:10px monospace;letter-spacing:2.5px;color:#d6bc87}.collection-entry h3{font-size:22px;color:#f3e2bd;margin:7px 0}.collection-entry p{font-size:13px;line-height:1.6;color:#becbbd}.collection-entry>div:last-child{display:flex;flex-direction:column;gap:10px;flex:none}.collection-entry button{min-height:44px;padding:10px 18px;font-size:14px}.collection-dialog{position:fixed;inset:0;margin:auto;width:min(1440px,96vw);height:min(940px,94dvh);max-width:none;max-height:94dvh;padding:0;border:1px solid #b5a06a;border-radius:20px;background:#10231e;color:#eee5cc;box-shadow:0 20px 80px #000b;overflow:auto;font-family:inherit}.collection-dialog::backdrop{background:#06100de8;backdrop-filter:blur(7px)}.collection-dialog[open]{display:block}.collection-heading{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 26px;background:#173128f5;border-bottom:1px solid #bdac7c40}.collection-heading h2{margin:6px 0;font-size:30px;color:#f3e2bd}.collection-heading p{margin:0;color:#bfcbbb;font-size:13px}.collection-heading>div:last-child{display:flex;align-items:center;gap:18px}.collection-heading strong{font-size:15px;color:#e2cc91}.collection-dialog button{min-height:42px;padding:10px 15px;font-size:14px}.collection-dialog button:focus-visible,.collection-dialog select:focus-visible,.collection-dialog input:focus-visible{outline:3px solid #d8ef95;outline-offset:3px}.collection-layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:22px;padding:22px}.collection-preview{min-width:0;border:1px solid #9cb48a40;border-radius:14px;overflow:hidden;background:#081b16}.collection-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#1d392e;font-size:12px;color:#d6dfb8}.collection-image-wrap{display:flex;align-items:flex-start;justify-content:center;min-height:470px;padding:22px;background:radial-gradient(ellipse,#37534255,transparent 70%)}#collectionImage{display:block;max-width:100%;width:auto;height:auto;max-height:670px;box-shadow:0 12px 40px #0008}#collectionImage[hidden]{display:none}.collection-settings{min-width:0}.collection-settings h3{margin:0 0 10px;font-size:23px;line-height:1.4;color:#f1ddac}.collection-settings p{font-size:13px;line-height:1.7;color:#b8c8bb}.collection-settings fieldset{border:0;padding:0;margin:20px 0}.collection-settings legend{font-size:14px;font-weight:700;margin:0 0 12px;color:#e9d5a4}.collection-heroes{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px}.collection-heroes label{display:flex!important;align-items:center;gap:8px;padding:10px!important;border:1px solid #a0b28c50;border-radius:8px;min-height:45px;background:#1b382e;font-size:12px!important}.collection-heroes label:has(input:checked){border-color:#d6c183;background:#5f542f55}.collection-heroes input{accent-color:#d4ef8b;width:17px;height:17px;flex:none}.collection-settings label{display:block;margin:10px 0;color:#ddc997;font-size:13px}.collection-settings select{display:block;width:100%;min-height:46px;margin-top:7px;padding:9px 12px;border:1px solid #b7ac6d70;border-radius:8px;background:#173127;color:#f1e5c8;font-size:14px}.collection-settings small{display:block;font-size:11px;line-height:1.6;color:#b6c4aa}.collection-select-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}#collectionShuffle{width:100%;margin:10px 0}#collectionDownload{width:100%;font-size:16px;min-height:52px}.collection-rule{padding:12px 14px;border-left:2px solid #c6af7a;background:#d4be7e08}.collection-confirm{padding:18px;border:1px solid #e1c584;border-radius:12px;background:#293e29;margin-top:16px}.collection-confirm[hidden]{display:none}.collection-confirm h3{font-size:20px}.collection-confirm button{width:100%;margin-top:9px}#collectionStatus{min-height:40px;color:#e6d79e;font-size:13px}.collection-owned{padding:0 26px 28px}.collection-owned>h3{font-size:21px;color:#e6d1a5}.collection-owned>p{font-size:12px;line-height:1.7;color:#a9b9ad}#collectionGallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px;color:#bcc8b7;font-size:13px}#collectionGallery article{background:#1a342b;border:1px solid #b6b07c55;border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:10px}#collectionGallery img{width:100%;height:220px;object-fit:contain}#collectionGallery button{font-size:12px}.collection-zoomed .collection-layout{grid-template-columns:1fr}.collection-zoomed .collection-settings,.collection-zoomed .collection-owned{display:none}.collection-zoomed #collectionImage{max-height:none;width:min(100%,1200px)}.collection-zoomed .collection-image-wrap{padding:12px}.collection-dialog:has(#collectionConfirm:not([hidden])) .collection-image-wrap{opacity:.85}
.collection-ticket-term{display:inline-flex;align-items:center;gap:.25em;white-space:nowrap;vertical-align:baseline}.collection-ticket-icon{display:inline-block;width:1.55em;height:1.16em;flex:none;overflow:visible;vertical-align:-.2em;filter:drop-shadow(0 1px 2px #0003)}#collectionBalance .collection-ticket-icon{width:1.9em;height:1.42em}#collectionDownload .collection-ticket-icon,#collectionConfirmYes .collection-ticket-icon{width:1.7em;height:1.27em}
@media(max-width:1000px){.collection-layout{grid-template-columns:minmax(0,1fr) 300px;gap:14px;padding:16px}.collection-heading{padding:16px 20px}.collection-heading h2{font-size:25px}.collection-heading>div:last-child{gap:10px;flex-wrap:wrap;justify-content:flex-end}.collection-image-wrap{padding:14px;min-height:340px}}
@media(max-width:720px){.collection-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.collection-heading{padding:12px 15px;align-items:flex-start}.collection-heading h2{font-size:23px}.collection-heading p{font-size:11px}.collection-heading>div:last-child{flex-direction:column;align-items:flex-end}.collection-heading strong{font-size:12px}.collection-layout{grid-template-columns:1fr;padding:12px;gap:22px}.collection-image-wrap{min-height:260px;padding:14px}#collectionImage{max-height:65dvh}.collection-settings{padding:0 6px}.collection-heroes{grid-template-columns:1fr 1fr}.collection-owned{padding:0 18px 22px}.collection-entry{align-items:stretch;flex-direction:column;padding:18px;gap:10px}.collection-entry>div:last-child{flex-direction:row;flex-wrap:wrap}.collection-entry button{flex:1}#collectionGallery{grid-template-columns:repeat(2,minmax(0,1fr))}#collectionGallery img{height:180px}.collection-preview-heading{font-size:11px;padding:9px}.collection-dialog button{font-size:13px}.collection-heading button{min-width:64px}}
@media(prefers-reduced-motion:reduce){.collection-dialog *{scroll-behavior:auto!important}}

.collection-dialog .collection-heading{display:flex!important;width:auto;min-height:0;height:auto;max-width:none}
.collection-dialog button{color:#eee1c0;background:#203e31;border-color:#b7b57b70}.collection-dialog button.primary{background:#d3ee89;color:#182619;border:0}.collection-dialog button:disabled{opacity:.5}
.collection-composition{margin:18px 0;padding:15px;border:1px solid #e3c18366;border-radius:14px;background:#142b22b8}.collection-composition>strong{display:block;color:#efce85;margin-bottom:10px}.collection-composition h4{margin:17px 0 4px;font-size:15px}.collection-composition small{display:block;margin-top:12px;line-height:1.7;color:#b6c7b9}
/* Both columns stay inside the viewport. Only the settings column scrolls. */
.collection-dialog{overflow:hidden}.collection-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
.collection-dialog .collection-heading{position:relative;top:auto;background:#173128;margin:0;justify-self:stretch;align-self:stretch}
.collection-layout{min-height:0;overflow:hidden;align-items:stretch}
.collection-preview{display:flex;flex-direction:column;min-height:0}
.collection-preview-heading{flex:none}
.collection-image-wrap{flex:1;min-height:0;overflow:auto;align-items:center;overscroll-behavior:contain}
#collectionImage{width:100%;height:100%;max-height:100%;object-fit:contain;box-shadow:none}
.collection-settings{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:12px;scrollbar-gutter:stable}
.collection-settings .collection-owned{padding:20px 0 10px;margin-top:20px;border-top:1px solid #b7a77755}
.collection-settings #collectionGallery{grid-template-columns:repeat(2,minmax(0,1fr))}
.collection-settings #collectionGallery img{height:160px}
.collection-zoomed .collection-image-wrap{align-items:flex-start}
.collection-zoomed #collectionImage{width:min(100%,1200px);height:auto;max-height:none}
@media(max-width:720px){
 .collection-layout{grid-template-rows:minmax(160px,40%) minmax(0,1fr);gap:12px;padding:10px}
 .collection-heading{padding:10px 14px}.collection-heading h2{font-size:20px}.collection-heading p{display:none}
 .collection-image-wrap{min-height:0;padding:8px}.collection-settings{padding:0 6px 12px}
 .collection-zoomed .collection-layout{grid-template-rows:minmax(0,1fr)}
}
.collection-style-detail{display:flex;align-items:center;gap:10px;padding:10px 12px;margin:0 0 14px;border:1px solid #9da9ba44;border-radius:9px;background:#0d201a}#collectionStyleSample{display:flex;flex:none;gap:4px}#collectionStyleSample span{width:13px;height:26px;border:1px solid #ffffff40;border-radius:8px}.collection-style-detail #collectionStyleHint{font-size:12px;color:#d4dfd2;line-height:1.7}
.collection-note-editor{margin:16px 0;padding:14px;border:1px solid #d9c39455;border-radius:12px;background:#10281f}.collection-note-editor label{margin:0 0 8px!important}.collection-note-editor #collectionNote{box-sizing:border-box;width:100%;min-height:46px;padding:10px 12px;border:1px solid #bdab7977;border-radius:8px;background:#0a1e17;color:#f5e9d1;font:inherit;font-size:16px}.collection-note-editor #collectionNote:focus{outline:2px solid #d3ee89;outline-offset:2px}.collection-note-editor #collectionNote::placeholder{color:#aebcad}.collection-note-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.collection-note-meta #collectionNoteCount{font-variant-numeric:tabular-nums;color:#d8ddc0}.collection-note-meta #collectionNoteClear{min-height:32px;padding:4px 10px;font-size:12px}#collectionNoteHint{margin-top:5px}
.home-ticket-balances{flex-wrap:wrap}.collection-home-entry{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:5px 10px;border:1px solid #c6b58b70;border-radius:8px;background:#16352bd9;color:#f2dfb7;font:inherit}.collection-home-entry>span{font-size:20px;color:#e5c17d}.collection-home-entry>b{font-size:13px;font-weight:600}.collection-home-entry>small{font-size:11px;color:#d3e7b9}.collection-home-entry:hover{border-color:#edcf8f;background:#274b3bd9}.collection-home-entry:focus-visible{outline:3px solid #d8ef95;outline-offset:2px}

.collection-note-editor.at-limit #collectionNoteCount,.collection-note-editor.at-limit #collectionNoteHint{color:#ff9d9d;font-weight:700}.collection-note-editor.at-limit #collectionNote{border-color:#ef9999}.collection-note-editor.at-limit #collectionNote:focus{outline-color:#ff9d9d}

.collection-dialog:not(.collection-designer) #collectionZoom{display:none}.collection-dialog:not(.collection-designer) #collectionImage{width:min(100%,420px);height:auto;max-height:100%;object-fit:contain}

/* Keep entry actions together in reading and keyboard order. */
.collection-entry{flex-direction:column;align-items:stretch}.collection-entry>.collection-entry-actions:last-child{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.collection-entry-actions button{min-width:0;white-space:normal;line-height:1.5}.exchange-footer:has(#resourceExchangeStatus:empty){display:none}
@media(max-width:520px){.collection-entry>.collection-entry-actions:last-child{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-entry-actions #collectionOpen{grid-column:1/-1}}

#collectionNoteApply{display:block;width:100%;margin:12px 0 8px;min-height:44px}.collection-note-editor #collectionNoteState{margin:8px 0;color:#ccefad;font-size:14px;font-weight:700}.collection-note-editor #collectionNoteState.pending,#collectionNoteDownloadHint{color:#ffcb83;font-weight:700}.collection-note-proof{padding-top:10px;border-top:1px solid #b6b38c44}.collection-note-proof strong,.collection-preview-note strong{display:block;color:#d5cba5;font-size:12px;margin-bottom:5px}.collection-note-proof span,.collection-preview-note span{display:block;font-size:16px;line-height:1.6;color:#fff1cb;overflow-wrap:anywhere;white-space:pre-wrap}.collection-preview-note{flex:none;padding:10px 16px;background:#152e25;border-top:1px solid #9cb48a40}.collection-preview{display:flex;flex-direction:column}.collection-preview .collection-image-wrap{flex:1;min-height:0}.collection-preview-heading{flex:none}#collectionNoteDownloadHint[hidden]{display:none}

#collectionPreviewTitle{min-width:0;font-size:16px;font-weight:600;line-height:1.6;overflow-wrap:anywhere}.collection-preview-heading{flex-wrap:wrap}

/* The note below the preview stays centered; the empty reminder is red. */
.collection-preview-note{text-align:center}.collection-preview-note span.is-empty{color:#ff8f97;font-weight:700}

/* Keep card design and Return Tickets together, in that order, at every width. */
.collection-home-actions{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:8px;flex:none;max-width:100%}
.collection-home-actions>button{flex:none}
@media(max-width:620px){.collection-home-actions{gap:6px}}

/* Empty collection copy uses the full gallery row and stays on one line. */
#collectionGallery>.collection-gallery-empty{grid-column:1/-1;min-width:0;max-width:100%;margin:0;white-space:nowrap;overflow-x:auto;overflow-y:hidden}
