:root{--surface:#fff}*{box-sizing:border-box}html{color-scheme:light;scroll-behavior:smooth}body{margin:0;color:var(--navy);font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(115deg,#e7f7ff 0%,#f8fbff 48%,#f2edff 100%);min-height:100svh}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.4}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #1677d2;outline-offset:3px}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.deck-header,main,footer{max-width:1500px;margin:auto;padding-left:40px;padding-right:40px}.deck-header{display:flex;align-items:center;justify-content:space-between;padding-top:20px;padding-bottom:8px;gap:20px}.deck-header a{display:block;width:205px}.deck-header img{width:100%;height:auto;display:block}.language-label{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted)}select,input{border:1px solid var(--line);background:#fff;border-radius:12px;min-height:44px;padding:10px 12px;min-width:0;font-size:14px}h1{font-size:clamp(28px,3vw,42px);letter-spacing:-1.2px;margin:16px 0 8px;line-height:1.15}.intro>p{margin:0 0 28px;color:var(--muted);font-size:17px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 355px;gap:30px;align-items:start}.catalog-panel{min-width:0}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}h2{font-size:20px;letter-spacing:-.4px;margin:0}h3{font-size:16px}.muted{color:var(--muted);font-size:12px}.filters{margin:18px 0}.search-label{display:block}.search-label input{width:100%;min-height:50px;border-color:#a9cdec;box-shadow:0 3px 12px #1677d20a;padding:12px 16px;font-size:15px}.filter-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.filter-row select{flex:1;max-width:100%}.filter-row #deck-rarity{flex:0 0 100px}.text-button{border:0;background:transparent;font-size:12px;font-weight:650;padding:10px 0;color:var(--blue)}.filter-row .text-button{padding:10px 6px}.catalog-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 12px}.catalog-card{min-width:0;background:#ffffffc9;border:1px solid #fff;border-radius:14px;padding:8px;transition:border-color .15s}.catalog-card.selected{border-color:var(--blue);background:#fff;box-shadow:0 0 0 1px var(--blue)}.art-button{display:block;padding:0;background:none;border:0;width:100%;border-radius:8px;overflow:hidden;aspect-ratio:367/512}.art-button img{width:100%;height:100%;object-fit:contain;display:block}.card-name{font-size:13px;font-weight:700;line-height:1.35;margin:9px 0 4px;overflow-wrap:anywhere}.card-meta{font-size:11px;color:var(--muted);margin:0 0 9px}.quantity{display:flex;align-items:center;justify-content:space-between;gap:5px}.quantity button{width:36px;height:34px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:22px;line-height:1}.quantity .add{background:var(--yellow);border-color:var(--yellow)}.quantity output{font-size:14px;font-weight:750}.secondary{border:1px solid var(--line);background:#fff;border-radius:10px;padding:12px 18px;font-size:14px;font-weight:600}.more{display:block;margin:25px auto}.composition{position:sticky;top:20px;background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px;box-shadow:0 12px 35px #102a5208}.deck-count{font-size:25px;white-space:nowrap}.deck-count>span+span{font-size:14px;color:var(--muted);font-weight:500}.rules,.session-note{font-size:12px;line-height:1.6;color:var(--muted)}.rules{margin:12px 0}progress{width:100%;height:6px;border:0;border-radius:6px;overflow:hidden;accent-color:var(--blue)}progress::-webkit-progress-bar{background:#eaf2fa}progress::-webkit-progress-value{background:var(--blue);border-radius:6px}#deck-status{font-size:12px;color:var(--blue);min-height:18px;margin:8px 0 18px}.empty-deck{text-align:center;padding:35px 0}.empty-card{display:grid;place-items:center;width:65px;height:90px;border:2px dashed #b4d3ed;border-radius:10px;color:#83b5de;font-size:28px;margin:0 auto 18px;transform:rotate(-8deg)}.empty-deck p{font-size:13px;color:var(--muted);line-height:1.6}.deck-list{display:flex;flex-direction:column;gap:10px;max-height:52vh;overflow:auto;overscroll-behavior:contain}.deck-row{display:grid;grid-template-columns:44px minmax(0,1fr) 88px;gap:10px;align-items:center;padding:6px 0;border-bottom:1px solid #edf3f8}.deck-row .art-button{width:44px}.deck-row .card-name{margin:0 0 4px;font-size:12px}.deck-row .card-meta{font-size:10px;margin:0}.deck-row .quantity button{width:27px;height:30px;font-size:19px}.deck-row .quantity output{font-size:12px}.deck-actions{display:flex;justify-content:space-between;border-top:1px solid var(--line);margin-top:18px;padding-top:8px}.session-note{font-size:11px;margin:8px 0 0}.composition.complete .deck-count{color:#167451}footer{margin-top:48px;padding-top:22px;padding-bottom:24px;border-top:1px solid var(--line);font-size:10px;color:var(--muted);line-height:1.6}.made-in-italy{text-align:center;font-size:12px;font-weight:600;color:var(--navy);margin-top:16px}dialog{border:1px solid var(--line);border-radius:20px;padding:20px;background:#fff;color:var(--navy);width:min(440px,92vw);max-height:92svh;overflow:auto}dialog::backdrop{background:#102a5288;backdrop-filter:blur(5px)}#preview-close{display:block;margin:0 0 14px auto}#preview-image{display:block;width:auto;max-width:100%;height:auto;max-height:60svh;margin:auto}#preview-name{margin-top:16px}#preview-meta{font-size:13px;color:var(--muted)}#catalog-status{font-size:14px;line-height:1.6;color:var(--muted)}@media(min-width:1400px){.catalog-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(max-width:1000px){.deck-header,main,footer{padding-left:24px;padding-right:24px}.workspace{grid-template-columns:minmax(0,1fr) 300px;gap:18px}.catalog-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.composition{padding:18px}}@media(max-width:760px){.deck-header,main,footer{padding-left:16px;padding-right:16px}.deck-header a{width:150px}.language-label>span{display:none}.language-label select{max-width:130px}.intro>p{font-size:14px;margin-bottom:22px}h1{font-size:30px}.workspace{display:flex;flex-direction:column;gap:24px}.composition{order:-1;position:static;width:100%;padding:18px;border-radius:16px}.catalog-panel{width:100%}.empty-deck{padding:4px 0}.empty-card{display:none}.empty-deck h3{margin:8px 0;font-size:14px}.empty-deck p{margin:6px 0}.rules{margin:7px 0}#deck-status{margin:5px 0 8px}.deck-actions{margin-top:10px;padding-top:2px}.deck-list{max-height:260px}.catalog-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 6px}.catalog-card{padding:5px;border-radius:10px}.card-name{font-size:11px}.card-meta{font-size:10px}.quantity button{width:30px;min-height:36px}.filter-row #deck-rarity{flex:0 0 76px}.filter-row select{font-size:12px;padding:8px}.filter-row .text-button{width:100%;text-align:right}.section-heading h2{font-size:18px}.deck-row .quantity button{min-height:36px}#deck-search{font-size:16px}footer{margin-top:28px}}@media(max-width:360px){.catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-row select{flex-basis:40%}.deck-header a{width:130px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Catalog filters share clear labels and a complete original type icon row. */
.filter-row{align-items:end}.filter-field{display:flex;flex:1;min-width:0;flex-direction:column;gap:6px}.filter-field>span,.type-filter legend{font-size:12px;font-weight:650;color:var(--muted)}.filter-field select{width:100%;flex:initial}.filter-field.rarity-field{flex:0 0 100px}.filter-row #deck-rarity{flex:initial}.type-filter{min-width:0;border:0;padding:0;margin:16px 0 0}.type-filter legend{padding:0;margin-bottom:8px}.type-options{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.type-option{display:grid;place-items:center;flex:0 0 auto;min-width:40px;min-height:40px;padding:6px;border:1px solid var(--line);border-radius:11px;background:#fff;transition:border-color .15s,box-shadow .15s}.type-option img{display:block;width:26px;height:26px}.type-all{font-size:12px;padding:6px 12px}.type-option[aria-pressed=true]{border-color:var(--blue);background:#e9f4ff;box-shadow:0 0 0 1px var(--blue)}.type-option:hover{border-color:var(--blue)}
@media(max-width:760px){.filter-row{gap:8px}.filter-field{flex-basis:35%}.filter-field.rarity-field{flex:0 0 76px}.filter-row #deck-rarity{flex:initial}.type-options{gap:6px}.type-option{min-width:44px;min-height:44px}.type-all{padding:6px 10px}.filter-row .text-button{padding-top:2px;padding-bottom:2px}.type-filter{margin-top:10px}}

/* Selected catalog cards show quantity controls directly over the artwork. */
.card-art{position:relative}.pick-card{cursor:pointer}.pick-card:disabled{opacity:1;cursor:default}.card-art>.quantity{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:flex;justify-content:center;gap:0;width:120px;max-width:calc(100% - 8px);padding:3px 4px;border-radius:999px;background:#303442f2;color:#fff;box-shadow:0 3px 12px #102a5225;z-index:1}.card-art>.quantity button,.card-art>.quantity .add{flex:1;min-width:0;width:36px;height:36px;min-height:36px;border:0;border-radius:50%;background:transparent;color:#fff;font-size:26px}.card-art>.quantity button:disabled{opacity:.35}.card-art>.quantity button:hover:enabled{background:#ffffff20}.card-art>.quantity output{flex:0 0 32px;text-align:center;font-size:22px;font-weight:700;line-height:36px}.card-art>.quantity button:focus-visible{outline-color:#ffd21f;outline-offset:-2px}.catalog-card .card-meta{margin-bottom:2px}
@media(max-width:760px){.card-art>.quantity{bottom:6px;padding:2px;max-width:calc(100% - 4px)}.card-art>.quantity button,.card-art>.quantity .add{height:36px;min-height:36px;font-size:24px}.card-art>.quantity output{flex-basis:24px;font-size:19px}}

/* Keep the four catalog selects readable on desktop and in two columns on phones. */
.filter-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,1fr) 100px;gap:10px}.filter-row .text-button{grid-column:1/-1;justify-self:end;padding-top:0;padding-bottom:0}.filter-field{width:100%}.filter-field.rarity-field{min-width:0}
@media(max-width:760px){.filter-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.filter-row .text-button{width:auto}.filter-field select{font-size:13px}.filter-field.rarity-field .rarity-picker-trigger{font-size:13px}}

/* One field height, including native Safari selects and the graphical rarity picker. */
body{--field-height:50px}.filters input:not([type="hidden"]),.filter-row select,.language-label select,.filter-field .rarity-picker-trigger{height:var(--field-height);min-height:var(--field-height);box-sizing:border-box}.filter-row select,.language-label select{appearance:none;-webkit-appearance:none;padding-right:34px;background-image:linear-gradient(45deg,transparent 50%,#587394 50%),linear-gradient(135deg,#587394 50%,transparent 50%);background-position:calc(100% - 18px) 22px,calc(100% - 13px) 22px;background-size:5px 5px;background-repeat:no-repeat}

/* The selected-card overlays replace the former deck sidebar. */
.workspace{display:block}.deck-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 24px;font-size:14px}.deck-toolbar>div{display:flex;gap:20px}.deck-toolbar strong{font-size:14px}.deck-toolbar .text-button{padding:8px 0}.catalog-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
@media(min-width:1200px){.catalog-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:1199px) and (min-width:1001px){.catalog-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:1000px) and (min-width:761px){.catalog-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:760px){.catalog-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.deck-toolbar{margin-bottom:22px}.deck-toolbar>div{gap:14px}.deck-toolbar strong{font-size:13px}.deck-toolbar .text-button{font-size:11px}}
@media(max-width:360px){.catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* All four catalog filters share the same anchored select and option list. */
.filter-field{position:relative}.deck-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:var(--field-height);min-height:var(--field-height);padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);text-align:left;font-size:14px}.deck-select-trigger::after{content:"";width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateY(-2px) rotate(45deg);flex:0 0 auto}.deck-select-trigger[aria-expanded=true]{border-color:var(--blue);box-shadow:0 0 0 2px #1677d218}.deck-select-trigger[aria-expanded=true]::after{transform:translateY(2px) rotate(225deg)}.select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value .card-rarity img{height:16px}.select-value .card-rarity{gap:0}.deck-select-menu{position:absolute;top:calc(100% + 7px);left:0;z-index:20;min-width:100%;width:max-content;max-width:min(380px,calc(100vw - 32px));max-height:320px;overflow:auto;overscroll-behavior:contain;padding:6px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 10px 30px #102a5222}.rarity-field .deck-select-menu{left:auto;right:0;min-width:190px}.deck-select-option{display:flex;align-items:center;gap:6px;min-height:44px;padding:10px 12px;border-radius:7px;font-size:14px;line-height:1.4;cursor:pointer;white-space:normal}.deck-select-option[aria-selected=true]{background:#e9f4ff;color:var(--blue);font-weight:650}.deck-select-option:hover,.deck-select-option.active{background:#eff6fd;box-shadow:inset 0 0 0 1px #b5d6f2}.deck-select-option .card-rarity{gap:4px}.deck-select-option .card-rarity img{height:23px}
@media(max-width:760px){.deck-select-trigger{font-size:13px;padding:10px 12px}.filter-field:nth-child(even) .deck-select-menu{left:auto;right:0}.deck-select-menu{max-width:calc(100vw - 32px);width:max-content}.deck-select-option{font-size:13px}.rarity-field .deck-select-menu{min-width:180px}}

/* Export sits after the four compact filters; all work remains in the browser. */
.filter-row{grid-template-columns:minmax(0,1.1fr) minmax(0,1.1fr) minmax(0,.95fr) 110px 110px}.primary{border:1px solid var(--blue);border-radius:12px;background:var(--blue);color:#fff;padding:12px 20px;font-size:14px;font-weight:700;min-height:50px}.primary:disabled{opacity:.4}.export-trigger{width:100%;height:50px;padding:10px}.export-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:18px}.export-heading h2{font-size:21px}#export-dialog{width:min(560px,calc(100vw - 32px));max-height:92svh;padding:24px;overflow:auto}.export-field{display:flex;flex-direction:column;gap:8px;margin-bottom:18px}.export-field>span,.export-key-field>span,.export-energy legend{font-size:13px;font-weight:650;color:var(--muted)}.export-field input{height:50px;width:100%;font-size:16px}.export-key-field{margin-bottom:18px}.export-key-field .deck-select-trigger{height:84px;min-height:84px}.key-choice{display:flex;align-items:center;gap:14px;white-space:normal}.key-choice img{display:block;width:92px;height:128px;object-fit:contain;flex:0 0 auto;border-radius:5px}.deck-select-trigger .key-choice img{width:46px;height:64px}.export-key-field .select-value{white-space:normal}.export-key-field .deck-select-menu{width:100%;max-width:100%;z-index:30}.export-key-field .deck-select-option{padding:8px}.export-key-field .deck-select-menu .key-choice{font-size:13px}.export-energy{border:0;margin:0 0 18px;padding:0}.export-energy legend{padding:0}.export-energy p,.export-note{font-size:12px;color:var(--muted);line-height:1.6}.export-energy .type-options{gap:8px}.export-energy .type-option{min-width:44px;min-height:44px}#generate-deck{width:100%}#export-error{font-size:13px;color:#aa2828;line-height:1.5}#export-result{text-align:center}#deck-qr{display:block;width:min(100%,320px);height:auto;margin:16px auto;background:white;image-rendering:pixelated}.export-cover{display:flex;align-items:center;justify-content:center;gap:12px}.export-cover img{object-fit:contain;border-radius:4px}.export-cover h3{margin:0;overflow-wrap:anywhere}#export-result>p{font-size:14px;line-height:1.6}#export-result>.export-note{font-size:12px}.qr-library{display:block;margin-top:16px;font-size:11px;color:var(--muted)}
@media(max-width:760px){.filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}.export-trigger{grid-column:2;grid-row:3}.filter-row .text-button{grid-column:1;grid-row:3;justify-self:start}.export-heading h2{font-size:18px}#export-dialog{padding:18px}.export-key-field .deck-select-trigger{font-size:13px}.export-energy .type-options{gap:7px}}

.draft-error{font-size:12px;line-height:1.5;color:#aa2828;margin:-12px 0 20px}

/* The key-card picker is a two-column gallery with no printed card metadata. */
.export-key-field .deck-select-menu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px}.export-key-field .deck-select-option{justify-content:center;padding:8px;min-width:0}.export-key-field .key-choice{justify-content:center;gap:0;width:100%}.export-key-field .select-value{flex:1}.export-key-field .deck-select-menu .key-choice img{width:92px;height:128px}.export-energy legend{margin-bottom:12px}.export-energy output{display:inline-block;min-width:34px;margin-left:7px;padding:2px 7px;border-radius:7px;background:#e9f4ff;color:var(--blue);font-size:12px;font-weight:700}.export-background{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;opacity:.3;pointer-events:none;z-index:0}#export-dialog.qr-mode{isolation:isolate;background:#fff}.qr-mode .export-heading,.qr-mode #export-result{position:relative;z-index:1}.qr-mode .export-heading{padding:10px 12px;border-radius:12px;background:#ffffffe6}.qr-mode .export-cover{display:inline-flex;padding:10px 16px;border-radius:12px;background:#ffffffe0}.qr-mode #export-result>p{padding:12px;border-radius:12px;background:#ffffffe6}.qr-mode #deck-qr{border-radius:8px}.qr-mode #edit-export{background:#fffffff0}


.deck-page:not(.browse-page) main{padding-left:max(40px,env(safe-area-inset-left));padding-right:max(40px,env(safe-area-inset-right))}
@media(max-width:760px){.deck-page:not(.browse-page) main{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right))}}
/* Keep the home and builder's search and primary filter geometry identical. */
.deck-page .hero-copy>.deck-tagline{margin-bottom:35px}
#deck-search-form{position:relative;z-index:5;width:min(100%,900px);margin-inline:auto}
.deck-page .hero #deck-search{border:0;outline:0;background:none;min-width:0;flex:1;width:0;font-size:19px;height:55px;min-height:0;padding:1px 2px;box-shadow:none;border-radius:0}
.deck-page .hero #deck-search:focus,.deck-page .hero #deck-search:focus-visible{outline:none;box-shadow:none}
#my-decks{display:flex;align-items:center;justify-content:center;text-decoration:none;color:var(--navy);line-height:normal}
.deck-page .filters{width:min(100%,900px);margin:5px auto 34px}
.deck-page .filter-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:0;align-items:end}
.deck-page .filter-field{gap:8px}
.deck-page .filter-row .deck-select-trigger{height:56px;min-height:56px;padding:12px 16px;font-size:15px;border-radius:16px;gap:12px}
.deck-page .filter-row .deck-select-trigger::after{width:7px;height:7px;margin:0 3px}
.deck-page .export-trigger{grid-column:3;grid-row:2;justify-self:end;width:110px;height:56px;font-size:15px;border-radius:16px}
.deck-page .filter-row .text-button{grid-column:2;grid-row:2;justify-self:end;align-self:end;min-height:56px}
.deck-page .section-heading{margin:0 0 18px}
.deck-page .section-heading #catalog-title{font-size:11px;font-weight:800;letter-spacing:1.3px;text-transform:uppercase;color:var(--muted)}
.deck-page .decks-link{display:flex;align-items:center;justify-content:center;min-height:50px;padding:10px;text-decoration:none;font-size:14px}
@media(max-width:760px){
 .deck-page .hero-copy>.deck-tagline{height:48px;display:flex;align-items:center;justify-content:center;margin:0}
 #deck-search-form{grid-column:1/-1;grid-row:3}
 .deck-page .hero #deck-search{font-size:16px;height:45px}
 .deck-page .filters{margin:5px auto 28px}
 .deck-page .filter-row{gap:8px}
 .deck-page .filter-row .deck-select-trigger{height:50px;min-height:50px;padding:10px 9px;gap:6px;font-size:12px;border-radius:12px}
 .deck-page .export-trigger{height:50px;min-height:50px;width:90px;font-size:12px;border-radius:12px}
 .deck-page .filter-row .text-button{min-height:50px;text-align:center;justify-self:center;font-size:11px}
 .deck-page .section-heading #catalog-title{font-size:9px;letter-spacing:.6px}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){.deck-page .hero #deck-search{height:43px;font-size:16px}}

/* Four selectors, then types and their trailing actions on a single row. */
.deck-page .filter-row{grid-template-columns:minmax(0,1.2fr) minmax(0,1.1fr) minmax(0,1fr) minmax(0,.8fr)}
.type-action-row{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap;margin-top:18px}
.deck-page .type-action-row .type-filter{flex:1 1 540px;margin:0}
.type-actions{display:flex;align-items:center;justify-content:flex-end;gap:18px;margin-left:auto}
.deck-page .type-actions .export-trigger{width:110px;height:56px;grid-area:auto}
.deck-page .type-actions .text-button{min-height:56px;white-space:nowrap}
@media(max-width:760px){
 .deck-page .filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 .type-action-row{gap:10px;margin-top:14px}
 .deck-page .type-action-row .type-filter{flex-basis:100%}
 .type-actions{gap:16px}
 .deck-page .type-actions .export-trigger{height:50px;min-height:50px;width:90px}
 .deck-page .type-actions .text-button{min-height:50px}
}

/* Decorative field icons share the homepage's blue outline style. */
.deck-filter-icon{width:21px;height:21px;fill:none;stroke:var(--blue);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.filter-row .select-value{flex:1}
@media(max-width:760px){.deck-filter-icon{width:18px;height:18px}}

.export-buttons{display:flex;gap:12px;align-items:stretch;margin-top:16px}.export-buttons>button{flex:1;min-width:0}.export-buttons #generate-deck{width:auto}.save-deck-status{position:relative;z-index:1;padding:12px;border-radius:12px;background:#edf8ff;color:var(--blue);font-size:14px;line-height:1.5}.save-deck-status.error{color:#aa2828}.saved-local-note{font-size:13px;color:var(--muted);line-height:1.6;margin:18px 0 24px}.saved-decks-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.saved-deck{min-width:0;padding:20px;border:1px solid var(--line);border-radius:22px;background:#ffffffd9;box-shadow:var(--shadow)}.saved-deck-header{display:flex;align-items:center;gap:20px}.saved-deck-cover{width:110px;height:154px;object-fit:contain;border-radius:8px}.saved-deck h2{font-size:22px;overflow-wrap:anywhere;margin:0 0 12px}.saved-deck-energies{display:flex;gap:8px}.saved-deck-energies img{width:26px;height:26px}.saved-deck details{margin-top:18px}.saved-deck summary{cursor:pointer;color:var(--blue);font-size:14px;font-weight:750;min-height:44px;padding-block:12px}.saved-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 8px;margin-top:12px}.saved-card-grid figure{margin:0;min-width:0}.saved-card-grid img{display:block;width:100%;height:auto;border-radius:6px}.saved-card-grid figcaption{font-size:11px;line-height:1.5;margin-top:6px;overflow-wrap:anywhere}
@media(max-width:760px){.saved-decks-grid{grid-template-columns:1fr}.saved-deck{padding:16px}.saved-deck-cover{width:88px;height:123px}.saved-deck h2{font-size:19px}.saved-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.export-buttons{gap:8px}.export-buttons>button{padding-inline:10px;font-size:13px}}

.deck-page .type-actions .export-trigger{width:auto;min-width:140px;padding-inline:16px;white-space:nowrap}@media(max-width:760px){.deck-page .type-actions .export-trigger{width:auto;min-width:124px}}

.auto-status{font-size:13px;line-height:1.5;color:var(--blue);margin:-10px 0 24px}.auto-status.error{color:#aa2828}#auto-complete{white-space:normal;text-align:right}.deck-toolbar>div{align-items:center}@media(max-width:760px){.deck-toolbar{flex-wrap:wrap}.deck-toolbar>div{margin-left:auto;gap:14px}.deck-toolbar #auto-complete{max-width:175px}}

/* The current deck stays above search results; selected cards appear only once. */
.pinned-grid{margin:0 0 28px}.deck-page #auto-complete{min-height:50px;padding:12px 18px;border-radius:16px;font-size:13px;text-align:center;font-weight:850}.deck-page #auto-complete:disabled{opacity:.6}@media(max-width:760px){.deck-page #auto-complete{font-size:12px;border-radius:12px;max-width:175px}.pinned-grid{margin-bottom:22px}}

/* Local navigation shares the subtitle row without moving the search field. */
.deck-page .page-nav{position:absolute;left:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:8px}
.deck-page:not(.browse-page) .home-tagline .page-nav .home-decks-button{position:static;transform:none;min-height:50px;width:auto;padding:12px 16px;font-size:14px;line-height:normal}
.deck-page:not(.browse-page) .home-tagline .page-nav .home-decks-button:hover{transform:translateY(-1px)}
@media(max-width:760px){
 .deck-page:not(.browse-page) .hero-copy>.home-tagline{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:12px;height:auto;min-height:48px}
 .deck-page .page-nav{position:static;transform:none;gap:6px}
 .deck-page:not(.browse-page) .home-tagline .page-nav .home-decks-button{min-height:48px;padding:10px 12px;font-size:12px}
 .deck-page:not(.browse-page) .hero-copy>.home-tagline .home-tagline-text{margin:0;min-width:0;font-size:14px;line-height:1.5}
 .saved-page:not(.browse-page) .hero-copy>.home-tagline{grid-template-columns:minmax(0,1fr);gap:14px}
 .saved-page .page-nav{justify-content:center;grid-row:2}
 .saved-page .home-tagline-text{grid-row:1}
}
@media(prefers-reduced-motion:reduce){.deck-page:not(.browse-page) .home-tagline .page-nav .home-decks-button:hover{transform:none}}

/* Strategy is an explicit choice; both actions keep the original user seed. */
.auto-complete-actions{display:flex;align-items:center;gap:8px}.deck-page .auto-complete-button{min-height:50px;min-width:100px;padding:12px 20px;border-radius:16px;font-size:14px;text-align:center}.deck-page .auto-complete-button.is-active{background:var(--navy);color:#fff}.deck-page .auto-complete-button.is-active:disabled{opacity:1}.auto-mode-hint{margin:-8px 0 22px;font-size:12px;line-height:1.6;color:var(--muted)}
@media(max-width:760px){.deck-toolbar>div{width:100%;justify-content:space-between}.auto-complete-actions{margin-left:auto;gap:8px}.deck-page .auto-complete-button{min-width:84px;padding:12px 14px;font-size:13px;border-radius:12px}.auto-mode-hint{font-size:11px;margin-top:-6px}}

/* Compact saved decks and icon actions. */
.saved-page .saved-decks-grid{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.saved-page .saved-deck{position:relative;padding:20px}
.saved-page .saved-deck-header{gap:14px;padding-right:22px}
.saved-page .saved-deck-header>div{min-width:0}
.saved-page .saved-deck h2{font-size:20px}
.saved-deck-actions{display:flex;margin-top:12px}
.deck-page .saved-deck-qr{display:grid;place-items:center;flex:none;width:50px;height:50px;min-height:50px;padding:11px;border-radius:12px}
.saved-deck-qr svg{display:block;width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.deck-page .saved-deck-remove{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:36px;height:36px;padding:4px;border:0;border-radius:50%;background:transparent;color:var(--blue);cursor:pointer}
.saved-deck-remove svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.deck-page .saved-deck-remove:hover{background:#1677d20d;color:var(--navy)}
.deck-page #export-close:focus{outline:none;box-shadow:none}
.deck-page #export-close:focus-visible{text-decoration:underline;text-underline-offset:5px}
@media(min-width:761px) and (max-width:1000px){.saved-page .saved-decks-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.saved-page .saved-decks-grid{grid-template-columns:1fr}.saved-page .saved-deck{padding:16px}.saved-page .saved-deck h2{font-size:19px}.deck-page .saved-deck-remove{width:44px;height:44px;top:3px;right:3px}}

/* Keep the QR action beside the cover, beneath the deck name and energies. */
.saved-page .saved-deck-header{align-items:stretch}
.saved-page .saved-deck-header>div{flex:1;display:flex;flex-direction:column;justify-content:center}
.saved-page .saved-deck-actions{justify-content:flex-end;margin-top:16px}

/* Match composition controls to the search/filter column. */
.deck-page:not(.beta-page) .deck-toolbar{width:min(100%,900px);margin-inline:auto}

.deck-page #card-dialog{width:calc(100% - 32px);max-width:920px;padding:42px 28px 28px;max-height:90svh}
.deck-page #card-detail{align-items:start}.deck-page .deck-detail-quantity{width:150px;max-width:100%;margin:18px 0;display:flex}
.deck-page .deck-card-detail-link{display:block;background:none;border:0;padding:0;text-align:left;color:inherit;width:100%}.deck-page .deck-card-detail-link:hover{text-decoration:underline}
@media(max-width:760px){.deck-page #card-dialog{padding:48px 20px 24px}.deck-page #card-detail{grid-template-columns:1fr;gap:20px}.deck-page #card-dialog .card-inspector{width:100%}}

/* Make deck quantity actions unmistakable in the card detail. */
.deck-page .deck-detail-quantity{display:grid;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr);gap:10px;align-items:center;width:100%;padding:12px;margin:18px 0;border:2px solid #ffd21f;border-radius:16px;background:#fff8d9}
.deck-page .deck-detail-quantity button{width:100%;height:56px;min-height:56px;min-width:0;padding:10px 8px;border-radius:11px;font-size:14px;font-weight:800;line-height:1.3;white-space:normal}
.deck-page .deck-detail-quantity .remove{border:1px solid #1677d2;background:#fff;color:#1677d2}.deck-page .deck-detail-quantity .add{border:1px solid #dfb400;background:#ffd21f;color:#102a52;box-shadow:0 3px 0 #d6ae15}
.deck-page .deck-detail-quantity output{display:grid;place-items:center;min-height:44px;border-radius:10px;background:#fff;color:#102a52;font-size:23px;font-weight:850}
@media(max-width:760px){.deck-page .deck-detail-quantity{padding:10px;gap:8px;grid-template-columns:minmax(0,1fr) 38px minmax(0,1fr)}.deck-page .deck-detail-quantity button{font-size:13px}}
