:root{--navy:#041E42;--blue:#28618b;--bg:#f3f6f9;--ink:#243447}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px system-ui,sans-serif}header{background:var(--navy);color:white;padding:20px max(20px,calc((100% - 1150px)/2));font-weight:750;letter-spacing:1px}main{max-width:1200px;margin:24px auto;padding:0 16px}section,details{background:white;border:1px solid #dce4eb;border-radius:12px;padding:20px;margin-bottom:16px}h1{font-size:28px}h2{font-size:21px}.login{max-width:420px;margin:9vh auto;padding:30px}.login button{width:100%}label{display:block;font-size:14px;font-weight:600}input,select,button{font:inherit;border-radius:7px;padding:12px;border:1px solid #c8d3de;max-width:100%}input,select{width:100%;background:white;margin:6px 0 12px}button{background:var(--blue);color:white;border:0;cursor:pointer;font-weight:600}a{color:var(--blue)}.stats,.fields,.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.stats strong{display:block;font-size:32px;color:var(--navy);margin:8px 0}.logout{float:right}.tablewrap{overflow:auto}table{border-collapse:collapse;width:100%;white-space:nowrap}td,th{text-align:left;padding:12px;border-bottom:1px solid #e3e9ee}th button{background:transparent;color:var(--navy);padding:0;font-size:14px}.muted{color:#627385;font-size:13px}summary{cursor:pointer;font-weight:700}.error,.danger{color:#a22}.danger{background:#fbe9e9}@media(max-width:600px){.fields,.filters{grid-template-columns:1fr}.stats strong{font-size:23px}section,details{padding:14px}.login{margin:5vh auto}.stats{gap:8px}}

.nav-actions{display:flex;align-items:center;gap:12px;letter-spacing:0;font-size:14px}.site-brand{cursor:default}.account-page{max-width:560px;margin:auto}.account-page section button{width:100%}.account-page h2{margin-top:0}@media(max-width:480px){.site-brand{font-size:12px;letter-spacing:0}.nav-actions{font-size:12px;gap:6px}.site-nav .nav-logout button{font-size:12px}}

.card-editor .fields{gap:8px 12px}.card-editor label{min-width:0}.card-editor input{margin:4px 0 2px;padding:9px 10px;min-height:42px;font-size:16px}.card-editor .wide{grid-column:1/-1}.card-editor .sale-heading{border-top:1px solid #dce4eb;padding-top:12px;margin-top:4px}.card-editor .sale-heading h2{font-size:16px;margin:0 0 4px}.card-editor .sale-heading p{margin:0}.card-editor .optional-url{padding:0;border:0;margin:0}.card-editor .optional-url summary{font-size:13px;color:var(--blue);font-weight:500}.card-editor .save-card{min-height:44px;margin-top:4px}.card-editor .card-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}.card-editor .card-actions form{margin:0}.card-editor .records{padding:10px 0 0;border:0;border-top:1px solid #dce4eb;border-radius:0;margin:12px 0 0}.card-editor .records p{font-size:14px;overflow-wrap:anywhere}.card-editor>summary{margin-bottom:10px}@media(max-width:600px){.card-editor .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.card-editor .player-field,.card-editor .set-field{grid-column:1/-1}.card-editor input{width:100%;min-width:0}.card-editor .card-actions{flex-wrap:wrap}}
.card-editor .pricing-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px}.card-editor .pricing-row input{box-sizing:border-box;width:100%;min-width:0}@media(max-width:600px){.card-editor .pricing-row{gap:6px}.card-editor .pricing-row label{font-size:12px}.card-editor .pricing-row input{padding:8px 5px}}
.card-editor form.fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr) minmax(0,1.4fr) minmax(0,.8fr) minmax(0,.8fr)}.card-editor .field-season,.card-editor .field-card_set,.card-editor .field-card_no{grid-column:span 2}.card-editor .field-player{grid-column:1/-1}.card-editor .field-company,.card-editor .field-grade{grid-column:span 3}.card-editor form.fields input:not([type=hidden]){width:100%;min-width:0;box-sizing:border-box}.card-editor .field-season{grid-column:1/3}.card-editor .field-card_set{grid-column:3/5}.card-editor .field-card_no{grid-column:5/7}@media(max-width:600px){.card-editor form.fields{gap:8px 6px}.card-editor .field-season input,.card-editor .field-card_set input,.card-editor .field-card_no input{padding:8px 5px}}
#cards{table-layout:fixed;white-space:normal;width:100%}#cards th,#cards td{overflow-wrap:anywhere}#cards th:nth-child(1){width:13%}#cards th:nth-child(2){width:24%}#cards th:nth-child(3){width:34%}#cards th:nth-child(4){width:11%}#cards th:nth-child(5){width:18%}#cards td:last-child,#cards th:last-child{text-align:right}#cards td:last-child{font-weight:600}@media(max-width:700px){#cards{font-size:12px}#cards th,#cards td{padding:9px 3px;vertical-align:top}#cards th button{font-size:11px}.filters select{min-height:44px}}
body{min-height:100vh;display:flex;flex-direction:column}.site-nav{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;background:#041E42}.site-nav a{color:white;text-decoration:none}.site-footer{margin-top:auto;background:#041E42;color:white;text-align:center;padding:18px;font-size:13px}main{width:100%;box-sizing:border-box}
.site-nav{position:sticky;top:0;flex-shrink:0;min-height:60px;padding:12px max(18px,calc((100% - 1150px)/2))}.site-nav .nav-logout{margin:0}.site-nav .nav-logout button{background:transparent;padding:8px;color:white}.site-nav+main{margin:24px auto;flex:1;min-width:0}.auth-tabs{display:flex;gap:4px;background:#eef3f7;border-radius:8px;padding:4px;margin:0 0 20px}.auth-tabs a{flex:1;text-align:center;padding:10px 4px;text-decoration:none;border-radius:6px;font-size:14px;font-weight:600}.auth-tabs a.active{background:#041E42;color:white}.auth-links{text-align:center;margin:16px 0 0}.site-footer{flex-shrink:0}.login h1{margin-top:0}

/* Compact responsive account layout */
.account-page{max-width:1000px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px;align-items:start}
.account-page>a,.account-page>h1,.account-page>p,.account-page>details,.account-page>section:nth-of-type(3){grid-column:1/-1}
.account-page>h1{margin:0;font-size:26px;line-height:1.2}
.account-page>a{font-size:14px;text-decoration:none;width:fit-content}
.account-page>section,.account-page>details{margin:0;padding:18px 20px;min-width:0}
.account-page>section:nth-of-type(-n+2){align-self:stretch;display:flex;flex-direction:column}
.account-page h2{font-size:19px;margin:0 0 14px}
.account-page form{display:grid;gap:10px;flex:1;align-content:start}
.account-page>section:first-of-type form{grid-template-columns:repeat(2,minmax(0,1fr))}
.account-page>section:first-of-type form> :not(label:nth-of-type(1)):not(label:nth-of-type(2)){grid-column:1/-1}
.account-page label{min-width:0;font-size:13px}
.account-page input:not([type=hidden]){display:block;width:100%;min-width:0;margin:4px 0 0;padding:8px 10px;min-height:40px;font-size:16px}
.account-page button{min-height:42px;padding:9px 12px}
.account-page .muted{margin:0;font-size:12px}
.account-page>section:nth-of-type(3){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px}
.account-page>section:nth-of-type(3) h2{grid-column:1/-1;margin:0 0 4px}
.account-page>section:nth-of-type(3) p{margin:0;font-size:14px;overflow-wrap:anywhere}
.account-page>p{margin:0}
@media(max-width:700px){.account-page{grid-template-columns:minmax(0,1fr);gap:12px}.account-page>section,.account-page>details{padding:16px}.account-page input:not([type=hidden]),.account-page button{min-height:44px}}
@media(max-width:360px){.account-page>section:first-of-type form,.account-page>section:nth-of-type(3){grid-template-columns:minmax(0,1fr)}}

/* Mobile authentication refresh; desktop and account layout preserved. */
@media (max-width:700px){
 .site-nav{min-height:76px;padding:14px 18px;background:linear-gradient(115deg,#041e42,#123e68);box-shadow:0 3px 12px #041e421a}
 .site-nav .site-brand{font-size:15px;letter-spacing:.7px}
 .site-nav:not(:has(.nav-actions)){justify-content:center;min-height:84px}
 .site-nav:not(:has(.nav-actions)) .site-brand{font-size:19px;letter-spacing:1.1px;text-align:center}
 .site-nav+main:has(>.login){margin:0 auto;padding:22px 16px 24px;display:flex;flex-direction:column;justify-content:center;max-width:480px}
 main>.login{width:100%;max-width:420px;margin:0 auto;padding:24px 20px;border-radius:20px;border:1px solid #dce4eb;box-shadow:0 10px 30px #041e4210}
 .login h1{font-size:28px;line-height:1.15;letter-spacing:-.7px;margin:0 0 18px;text-align:center}
 .login .auth-tabs{margin:0 0 20px;padding:4px;border-radius:12px;background:#edf2f7;gap:4px}
 .login .auth-tabs a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 4px;border-radius:9px;font-size:14px}
 .login .auth-tabs a.active{box-shadow:0 2px 5px #041e4226}
 .login label{font-size:14px;line-height:1.3}
 .login input:not([type=hidden]){font-size:16px;min-height:46px;padding:10px 12px;margin:6px 0 14px;border-radius:10px}
 .login input:focus{outline:2px solid #28618b;outline-offset:1px}
 .login button{min-height:48px;border-radius:10px;background:linear-gradient(110deg,#28618b,#17466e);box-shadow:0 4px 10px #17466e22;font-size:16px}
 .login .auth-links{margin:14px 0 0;font-size:14px;line-height:1.4}
 .login .auth-links a{display:inline-block;padding:6px 0;text-underline-offset:3px}
 body{min-height:100vh;min-height:100dvh}
}
@media (max-width:700px) and (max-height:650px){
 .site-nav+main:has(>.login){justify-content:flex-start;padding-top:14px;padding-bottom:14px}
 main>.login{padding:18px 16px}
 .login h1{margin-bottom:12px;font-size:25px}
 .login .auth-tabs{margin-bottom:12px}
 .login input:not([type=hidden]){margin-bottom:10px}
 .login .auth-links{margin-top:8px}
}

.mobile-sort,.mobile-heading,.mobile-note,.mobile-empty{display:none}
@media(max-width:700px){
 body.collection-page .site-nav{position:relative;top:auto;min-height:70px;padding:12px 14px;gap:8px}
 body.collection-page .site-nav+main{margin:12px auto;padding:0 10px}
 .collection-page main>h1{font-size:24px;margin:0 0 10px;letter-spacing:-.6px}
 .collection-page main>details,.collection-page .stats section{margin:0 0 8px;padding:12px;border-radius:12px}
 .collection-page .stats section{font-size:12px}.collection-page .stats strong{font-size:24px;margin:4px 0}
 .collection-page .collection-panel{padding:12px 8px;margin:0 0 10px;border-radius:16px;box-shadow:0 3px 12px #041e420b}
 .collection-panel .filters{display:grid;grid-template-columns:1fr;gap:8px;margin:0 4px}
 .collection-panel .filters input,.collection-panel .filters select{margin:0;min-height:44px;font-size:16px;padding:9px 10px;border-radius:10px;min-width:0}
 .collection-panel .mobile-sort{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:8px;margin:10px 4px 8px;padding:0;background:none}
 .mobile-sort label{font-size:13px;min-width:0;color:var(--navy)}
 .mobile-sort select,.mobile-sort button{display:block;width:100%;min-width:0;min-height:44px;font-size:16px;margin:4px 0 0;padding:8px;border-radius:10px;white-space:nowrap}
 .mobile-sort button{background:var(--navy);letter-spacing:-.4px}
 .collection-panel .desktop-note{display:none}.collection-panel .mobile-note{display:block;font-size:12px;color:#627385;margin:8px 4px 12px}
 #cards th button{display:none}#cards .mobile-heading{display:block;font-size:12px;line-height:1.2;white-space:normal;overflow-wrap:normal;word-break:normal}
 #cards th{background:#edf3f8;color:var(--navy);padding:10px 3px;vertical-align:middle}
 #cards th:first-child{border-radius:8px 0 0 8px;width:15%}#cards th:nth-child(2){width:22%}#cards th:nth-child(3){width:29%}#cards th:nth-child(4){width:14%}#cards th:last-child{width:20%;border-radius:0 8px 8px 0}
 #cards td{font-size:14px;padding:12px 3px;line-height:1.3;overflow-wrap:anywhere}#cards td a{font-weight:650}
 .collection-panel .mobile-empty{display:block;text-align:center;font-size:14px;color:#627385;margin:18px 8px}
}

@media(max-width:700px){
 .collection-panel .mobile-sort{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 4px 12px;align-items:stretch}
 .collection-panel .mobile-sort button{margin:0;min-height:48px;padding:6px 2px;font-size:15px;letter-spacing:-.35px;white-space:normal;line-height:1.15;background:#e8eef4;color:#041e42;border:1px solid #dce4eb}
 .collection-panel .mobile-sort button:first-child{background:#28618b;color:white;border-color:transparent}
 .collection-panel .mobile-sort button[aria-pressed="true"]{background:#041e42;color:white;border-color:transparent}
 #cards th button{display:none!important}#cards .mobile-heading{display:block;overflow-wrap:normal;word-break:normal}
 #cards th:nth-child(4){width:16%}#cards th:nth-child(3){width:27%}
 #cards th:nth-child(4) .mobile-heading{white-space:nowrap}
 .collection-panel .desktop-note{display:none!important}
}
/* Collection-first dashboard */
.collection-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.collection-title h1{margin:0;font-size:26px}.csv-export{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border:1px solid #d5dfe7;border-radius:8px;background:white;text-decoration:none;font-size:13px;font-weight:650;min-height:40px}.stats{grid-template-columns:minmax(0,2fr) minmax(0,1.4fr) minmax(0,1fr);gap:10px;margin-bottom:12px}.stats section{margin:0;padding:14px 16px;font-size:14px}.stats strong{margin:4px 0;font-variant-numeric:tabular-nums}.add-card-button{display:flex;align-items:center;justify-content:center;gap:6px;background:var(--blue);color:white;border-radius:12px;text-decoration:none;font-weight:750;font-size:19px}.add-card-button span{font-size:28px}.collection-panel .filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:12px;margin:0 0 12px}.collection-panel .filters input{margin:0;min-height:44px;font-size:16px}.collection-panel .mobile-sort{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;padding:0}.collection-panel .mobile-sort button{margin:0;min-height:44px;padding:6px 3px;font-size:15px;background:#e8eef4;color:var(--navy);border-radius:8px}.collection-panel .mobile-sort button:first-child{background:var(--blue);color:white}.collection-panel .mobile-sort button[aria-pressed=true]{background:var(--navy);color:white}.collection-panel .desktop-note{display:none}.compact-value{display:none}#cards td:last-child{white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}#cards tbody tr:hover{background:#f1f6fa}.editor-dialog{border:1px solid #dce4eb;border-radius:14px;padding:0;width:min(760px,95vw);max-height:90dvh;overflow:auto;color:var(--ink);background:white}.editor-dialog::backdrop{background:#041e4280}.editor-dialog .card-editor{margin:0;border:0;position:relative;padding:24px}.editor-close{position:absolute;right:16px;top:12px;font-size:28px;text-decoration:none;line-height:1}.collection-panel .tablewrap{overflow:visible}
@media(max-width:700px){.collection-title{margin-bottom:10px}.collection-title h1{font-size:24px}.csv-export{min-height:44px;padding:7px 9px}.collection-page .stats{grid-template-columns:minmax(0,1.8fr) minmax(0,1fr) minmax(0,.75fr);gap:6px}.collection-page .stats section{margin:0;padding:9px 7px;font-size:11px;line-height:1.3}.collection-page .stats strong{font-size:clamp(16px,5.4vw,24px);overflow-wrap:anywhere}.add-card-button{flex-direction:column;gap:0;font-size:14px}.add-card-button span{font-size:30px;line-height:1}.collection-panel .filters{grid-template-columns:minmax(0,1fr);gap:8px;margin:0 0 10px}.collection-panel .mobile-sort{margin:0;gap:5px}.collection-panel .mobile-sort button{min-height:48px;font-size:15px}.collection-page .collection-panel{padding:10px 6px}.full-value{display:none}.compact-value{display:inline}#cards th:first-child{width:13%}#cards th:nth-child(2){width:18%}#cards th:nth-child(3){width:29%}#cards th:nth-child(4){width:13%}#cards th:last-child{width:27%}#cards td{font-size:14px;padding:10px 2px}#cards td:last-child{font-size:14px;letter-spacing:-.4px}#cards .mobile-heading{font-size:12px} .editor-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0;margin:0}.editor-dialog .card-editor{padding:18px 12px}.collection-page .stats section:first-child{overflow:hidden}}
/* Navy glass card editor */
.editor-dialog{width:min(680px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;border:1px solid #ffffff45;border-radius:20px;background:rgba(10,34,70,.88);color:#fff;box-shadow:0 24px 80px #020b2366;backdrop-filter:blur(22px) saturate(125%);-webkit-backdrop-filter:blur(22px) saturate(125%);overflow:auto;padding:0}
.editor-dialog::backdrop{background:rgba(3,15,35,.48);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.editor-dialog .card-editor{padding:0 24px 24px;background:transparent;color:white;border:0;margin:0}
.editor-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:center;min-height:72px;margin:0 -24px 20px;padding:12px 64px;border-bottom:1px solid #ffffff30;background:rgba(12,35,71,.96);border-radius:19px 19px 0 0}
.editor-header h2{font-size:24px;line-height:1.2;margin:0;color:white;text-align:center;letter-spacing:-.4px}
.editor-dialog .editor-close{display:grid;place-items:center;position:absolute;right:16px;top:14px;width:44px;height:44px;border-radius:50%;background:#ffffff18;color:white;font-size:30px;line-height:1;text-decoration:none}
.editor-dialog .editor-close:hover{background:#ffffff30}.editor-dialog .fields{gap:16px 12px}.editor-dialog label{color:#f1f5fb;font-size:14px;font-weight:600}.editor-dialog input:not([type=hidden]){background:#f8fafc;color:#132c4b;border:1px solid #ffffff70;border-radius:9px;min-height:46px;margin:7px 0 0;padding:10px 12px;font-size:16px}.editor-dialog input:focus-visible,.editor-dialog a:focus-visible,.editor-dialog button:focus-visible{outline:2px solid #9fd4ff;outline-offset:3px}
.editor-dialog .adding-card .field-company,.editor-dialog .adding-card .field-grade,.editor-dialog .adding-card .field-cost{grid-column:span 2}.editor-dialog .editor-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding-top:18px;margin-top:4px;border-top:1px solid #ffffff30}.editor-dialog .editor-buttons a,.editor-dialog .editor-buttons button{display:flex;align-items:center;justify-content:center;min-height:48px;border-radius:10px;font-size:16px;font-weight:700;text-decoration:none;margin:0}.editor-dialog .editor-cancel{color:white;border:1px solid #ffffff65;background:#ffffff0b}.editor-dialog .save-card{background:#f8fafc;color:#102c50}.editor-dialog .card-actions a,.editor-dialog .records a{color:#c5e5ff}.editor-dialog .records{background:transparent;border-top-color:#ffffff30;color:white}.editor-dialog .danger{background:#ffe4e4;color:#8e1c1c}
@media(max-width:600px){.editor-dialog{width:calc(100% - 20px);max-width:calc(100% - 20px);height:auto;max-height:calc(100dvh - 24px);margin:auto;border-radius:16px}.editor-dialog .card-editor{padding:0 14px 18px}.editor-header{margin:0 -14px 16px;min-height:64px;border-radius:15px 15px 0 0}.editor-dialog .editor-close{top:10px;right:10px}.editor-dialog .card-editor form.fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px}.editor-dialog .card-editor .field-season,.editor-dialog .card-editor .field-card_no,.editor-dialog .card-editor .field-grade,.editor-dialog .adding-card .field-cost{grid-column:span 1}.editor-dialog .card-editor .field-card_set,.editor-dialog .card-editor .field-player,.editor-dialog .card-editor .field-company{grid-column:1/-1}.editor-dialog .card-editor .pricing-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.editor-dialog .card-editor .pricing-row label:last-child{grid-column:1/-1}}

/* Hablo parity: final theme values from hablo-modal-theme.css. */
body dialog.editor-dialog[open] {
 position:fixed !important; inset:24px !important; margin:0 !important;
 box-sizing:border-box !important; width:calc(100vw - 48px) !important;
 max-width:none !important; height:calc(100vh - 48px) !important;
 height:calc(100dvh - 48px) !important; max-height:none !important;
 padding:0 !important; border:1px solid rgba(255,255,255,.35) !important;
 border-radius:18px !important; background:rgba(21,45,92,.65) !important;
 color:white !important; box-shadow:0 18px 55px rgba(0,0,0,.25) !important;
 backdrop-filter:none !important; -webkit-backdrop-filter:none !important; overflow:hidden !important;
}
body dialog.editor-dialog::backdrop {background:rgba(0,0,0,.15) !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important;}
body dialog.editor-dialog .card-editor {display:flex !important;flex-direction:column;height:100%;max-height:100%;min-height:0;width:100%;max-width:none;margin:0 !important;padding:0 !important;background:transparent !important;box-shadow:none !important;color:white !important;border:0 !important;overflow:hidden;}
body dialog.editor-dialog .editor-header {flex:0 0 auto;position:relative;margin:0 !important;background:transparent !important;border-radius:0;min-height:68px;border-bottom:1px solid rgba(255,255,255,.35);}
body dialog.editor-dialog .editor-header h2 {color:white !important;text-align:center;}
body dialog.editor-dialog .editor-body {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px;-webkit-overflow-scrolling:touch;}
body dialog.editor-dialog .editor-body label,body dialog.editor-dialog .records,body dialog.editor-dialog .records summary,body dialog.editor-dialog .records h3,body dialog.editor-dialog .card-actions a {color:white !important;}
body dialog.editor-dialog .editor-body input:not([type=hidden]) {background:white !important;color:#152d5c !important;width:100% !important;max-width:none !important;}
body dialog.editor-dialog .card-editor form.fields {grid-template-columns:repeat(6,minmax(0,1fr));gap:16px 12px;}
body dialog.editor-dialog .adding-card .field-company,body dialog.editor-dialog .adding-card .field-grade,body dialog.editor-dialog .adding-card .field-cost {grid-column:span 2 !important;}
body dialog.editor-dialog .editor-buttons {grid-column:1/-1;display:grid !important;grid-template-columns:1fr 1fr;gap:12px;}
body dialog.editor-dialog .editor-cancel {color:white !important;}
body dialog.editor-dialog .save-card {background:white !important;color:#152d5c !important;}
@media(max-width:575.98px){
 body dialog.editor-dialog[open]{inset:16px 10px !important;width:calc(100vw - 20px) !important;height:calc(100vh - 32px) !important;height:calc(100dvh - 32px) !important;}
 body dialog.editor-dialog .editor-body{padding:14px;}
 body dialog.editor-dialog .card-editor form.fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px;}
 body dialog.editor-dialog .card-editor .field-season,body dialog.editor-dialog .card-editor .field-card_no,body dialog.editor-dialog .adding-card .field-grade,body dialog.editor-dialog .adding-card .field-cost{grid-column:span 1 !important;}
 body dialog.editor-dialog .card-editor .field-card_set,body dialog.editor-dialog .card-editor .field-player,body dialog.editor-dialog .adding-card .field-company,body dialog.editor-dialog .editing-card .field-company,body dialog.editor-dialog .editing-card .field-grade{grid-column:1/-1 !important;}
}

/* Fixed set selector and two-step deletion. */
body dialog.editor-dialog .editor-body select[name="season"],
body dialog.editor-dialog .editor-body select[name="card_set"]{display:block;box-sizing:border-box;width:100%;max-width:none;min-height:46px;margin:7px 0 0;padding:10px 12px;border:1px solid #ffffff70;border-radius:9px;background:white;color:#152d5c;font-size:16px;}
.editor-dialog .delete-trigger{width:auto;min-height:44px;padding:8px 14px;font-size:14px;border-radius:8px;}
.editor-dialog .delete-confirm[hidden]{display:none!important;}
.editor-dialog .delete-confirm{margin:12px 0;padding:16px;border:1px solid #ffc4c4;border-radius:10px;background:#fff0f0;color:#701b1b;}
.editor-dialog .delete-confirm p{margin:0 0 10px;color:#701b1b;}
.editor-dialog .delete-buttons{display:flex;justify-content:flex-end;gap:10px;}
.editor-dialog .delete-buttons button{width:auto;min-height:44px;padding:10px 20px;border-radius:8px;}
.editor-dialog .delete-buttons .danger{background:#a51d2d;color:white;}

body dialog.editor-dialog .adding-card .field-company,body dialog.editor-dialog .adding-card .field-grade,body dialog.editor-dialog .adding-card .field-cost,body dialog.editor-dialog .adding-card .field-value{grid-column:span 3 !important;}
body dialog.editor-dialog .pricing-row{grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:575.98px){body dialog.editor-dialog .adding-card .field-company,body dialog.editor-dialog .adding-card .field-grade,body dialog.editor-dialog .adding-card .field-cost,body dialog.editor-dialog .adding-card .field-value{grid-column:span 1 !important;}body dialog.editor-dialog .pricing-row{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Match native dropdowns to card editor text fields on every viewport. */
body dialog.editor-dialog .editor-body select[name="season"],
body dialog.editor-dialog .editor-body select[name="card_set"],
body dialog.editor-dialog .editor-body select[name="company"],
body dialog.editor-dialog .editor-body select[name="grade"] {
 display:block !important; box-sizing:border-box !important;
 width:100% !important; min-width:0 !important; max-width:none !important;
 height:46px !important; min-height:46px !important;
 margin:7px 0 0 !important; padding:10px 32px 10px 12px !important;
 border:1px solid #ffffff70 !important; border-radius:9px !important;
 background-color:#fff !important; color:#152d5c !important;
 font-family:inherit !important; font-size:16px !important; font-weight:400 !important; line-height:normal !important;
 appearance:none !important; -webkit-appearance:none !important;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23152d5c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
 background-repeat:no-repeat !important; background-position:right 12px center !important;
}
body dialog.editor-dialog .editor-body select:focus-visible {outline:2px solid #9fd4ff;outline-offset:3px;}
body dialog.editor-dialog .editor-body input:not([type=hidden]) {box-sizing:border-box;height:46px;min-height:46px;}

/* Keep the card identity row together on phones. */
@media(max-width:600px){
 body dialog.editor-dialog .card-editor form.fields{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px 8px;}
 body dialog.editor-dialog .card-editor form.fields .field-season{grid-column:1/3 !important;}
 body dialog.editor-dialog .card-editor form.fields .field-card_set{grid-column:3/5 !important;}
 body dialog.editor-dialog .card-editor form.fields .field-card_no{grid-column:5/7 !important;}
 body dialog.editor-dialog .card-editor form.fields .field-player{grid-column:1/-1 !important;}
 body dialog.editor-dialog .card-editor form.fields .field-company,body dialog.editor-dialog .card-editor form.fields .field-grade,body dialog.editor-dialog .card-editor form.fields .field-cost,body dialog.editor-dialog .card-editor form.fields .field-value{grid-column:span 3 !important;}
 body dialog.editor-dialog .card-editor form.fields label{min-width:0;}
 body dialog.editor-dialog .editor-body select[name="season"],
body dialog.editor-dialog .editor-body select[name="card_set"]{padding-left:6px !important;padding-right:20px !important;background-position:right 4px center !important;}
 body dialog.editor-dialog .editor-body select[name="company"],body dialog.editor-dialog .editor-body select[name="grade"]{padding-left:8px !important;padding-right:24px !important;background-position:right 6px center !important;}
}

/* Explicit rectangular select styling, including iOS Safari. */
body dialog.editor-dialog .editor-body select[name="season"],
body dialog.editor-dialog .editor-body select[name="card_set"],
body dialog.editor-dialog .editor-body select[name="company"],
body dialog.editor-dialog .editor-body select[name="grade"] {
 -webkit-appearance:none !important; appearance:none !important;
 -webkit-border-radius:9px !important; border-radius:9px !important;
 border:1px solid #ffffff70 !important;
 height:46px !important; min-height:46px !important; max-height:46px !important;
 box-sizing:border-box !important; background-clip:padding-box !important;
}

/* Authenticated navbar buttons */
.site-nav .nav-actions{flex:0 0 auto;gap:8px;white-space:nowrap}
.site-nav .nav-actions .nav-account-button,.site-nav .nav-actions .nav-logout button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 14px;border:1px solid #fff;border-radius:9px;font:600 14px/1.2 system-ui,sans-serif;letter-spacing:0;text-decoration:none;white-space:nowrap;box-sizing:border-box}
.site-nav .nav-actions .nav-account-button{background:#fff;color:#041e42}
.site-nav .nav-actions .nav-logout button{background:transparent;color:#fff}
.site-nav .nav-actions .nav-account-button:hover{background:#e6edf7}
.site-nav .nav-actions .nav-logout button:hover{background:#ffffff20}
.site-nav .nav-actions :focus-visible{outline:2px solid #a9d4ff;outline-offset:3px}
@media(max-width:700px){.site-nav:has(.nav-actions){padding:10px 10px;gap:8px}.site-nav:has(.nav-actions) .site-brand{font-size:12px;letter-spacing:0;min-width:0}.site-nav .nav-actions{gap:6px}.site-nav .nav-actions .nav-account-button,.site-nav .nav-actions .nav-logout button{min-height:44px;padding:8px 9px;font-size:12px}}
@media(max-width:360px){.site-nav:has(.nav-actions) .site-brand{font-size:11px}.site-nav .nav-actions .nav-account-button,.site-nav .nav-actions .nav-logout button{padding:8px 6px}}

/* Compact type field beside player; identical layout on all screens. */
body dialog.editor-dialog .card-editor form.fields{grid-template-columns:repeat(12,minmax(0,1fr)) !important;}
body dialog.editor-dialog .card-editor form.fields .field-season{grid-column:1/5 !important;}
body dialog.editor-dialog .card-editor form.fields .field-card_set{grid-column:5/9 !important;}
body dialog.editor-dialog .card-editor form.fields .field-card_no{grid-column:9/13 !important;}
body dialog.editor-dialog .card-editor form.fields .field-player{grid-column:1/10 !important;min-width:0;}
body dialog.editor-dialog .card-editor form.fields .field-card_type{grid-column:10/13 !important;min-width:0;}
body dialog.editor-dialog .card-editor form.fields .field-company,body dialog.editor-dialog .card-editor form.fields .field-grade,body dialog.editor-dialog .card-editor form.fields .field-cost,body dialog.editor-dialog .card-editor form.fields .field-value{grid-column:span 6 !important;}
body dialog.editor-dialog .editor-body select[name="card_type"]{appearance:none !important;-webkit-appearance:none !important;width:100%;min-width:0;height:46px !important;box-sizing:border-box;border-radius:9px !important;border:1px solid #ffffff70 !important;color:#152d5c;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23152d5c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 6px center;padding:0 20px 0 7px;font:inherit;}

/* Compact unrealized gain replaces the existing value subtitle. */
.stats .collection-gain{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:inherit;line-height:inherit;font-weight:650;font-variant-numeric:tabular-nums}.stats .gain-positive{color:#16713b}.stats .gain-negative{color:#b42318}
@media(max-width:700px){.stats .collection-gain{font-size:10px}}

/* Six-column collection: compact card number between set and player. */
#cards th:nth-child(1){width:12%}
#cards th:nth-child(2){width:20%}
#cards th:nth-child(3){width:8%}
#cards th:nth-child(4){width:32%}
#cards th:nth-child(5){width:10%}
#cards th:nth-child(6){width:18%}
#cards th:nth-child(3),#cards td:nth-child(3){text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:700px){
 #cards th:nth-child(1){width:13%}
 #cards th:nth-child(2){width:15%}
 #cards th:nth-child(3){width:10%}
 #cards th:nth-child(4){width:25%}
 #cards th:nth-child(5){width:12%}
 #cards th:nth-child(6){width:25%}
 #cards td:nth-child(3){font-size:13px;padding-left:1px;padding-right:1px}
 #cards th:nth-child(4) .mobile-heading{white-space:normal}
}

/* Collection viewport: fixed controls, one native scrolling table. */
body.collection-page{height:100vh;height:100dvh;min-height:0;overflow:hidden}
body.collection-page .site-nav{flex:0 0 auto}
body.collection-page .site-nav+main{display:flex;flex-direction:column;min-height:0;flex:1 1 0;overflow:hidden}
body.collection-page main>.collection-title,body.collection-page main>.stats,body.collection-page main>.error{flex:0 0 auto}
body.collection-page .collection-panel{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden}
body.collection-page .collection-panel>.filters{flex:0 0 auto}
body.collection-page .collection-panel>.tablewrap{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch}
body.collection-page .tablewrap::-webkit-scrollbar{display:none}
body.collection-page #cards{border-collapse:separate;border-spacing:0}
body.collection-page #cards thead th{position:sticky;top:0;z-index:2;background:#fff}
body.collection-page .tablewrap:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
/* Very short windows (including landscape): keep all controls reachable. */
@media(max-height:440px){body.collection-page{height:auto;min-height:100vh;overflow:visible}body.collection-page .site-nav+main{overflow:visible;flex:1 0 auto}body.collection-page .collection-panel{flex:0 0 auto;overflow:visible}body.collection-page .collection-panel>.tablewrap{flex:0 0 auto;max-height:55vh;max-height:55dvh}}

/* Eight desktop columns. */
@media(min-width:701px){
 #cards th:nth-child(1){width:8%}
 #cards th:nth-child(2){width:10%}
 #cards th:nth-child(3){width:6%}
 #cards th:nth-child(4){width:28%}
 #cards th:nth-child(5){width:8%}
 #cards th:nth-child(6){width:8%}
 #cards th:nth-child(7){width:18%}
 #cards th:nth-child(8){width:14%}
 #cards th,#cards td{padding-left:6px;padding-right:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #cards th button{font-size:13px;white-space:nowrap}
 #cards td:nth-child(7){font-variant-numeric:tabular-nums}
}
@media(max-width:700px){
 /* Native two-axis scrolling; the header shares the same horizontal offset. */
 body.collection-page .collection-panel>.tablewrap{width:100%;min-width:0;max-width:100%;overflow:auto;touch-action:pan-x pan-y;}
 body.collection-page .site-nav+main,body.collection-page .collection-panel{min-width:0;max-width:100%;}
 #cards{width:100%;min-width:680px;table-layout:fixed;}
 #cards .desktop-card-detail{display:table-cell!important;}
 #cards th:nth-child(1){width:8%}
 #cards th:nth-child(2){width:10%}
 #cards th:nth-child(3){width:6%}
 #cards th:nth-child(4){width:26%}
 #cards th:nth-child(5){width:8%}
 #cards th:nth-child(6){width:8%}
 #cards th:nth-child(7){width:19%}
 #cards th:nth-child(8){width:15%}
 #cards th,#cards td{padding-left:6px;padding-right:6px;vertical-align:middle;}
 #cards td:nth-child(7){font-variant-numeric:tabular-nums;overflow-wrap:anywhere;}
 #cards .mobile-heading{white-space:nowrap;}

}

/* Custom single-axis touch dragging; preserve pinch zoom and desktop scrolling. */
@media(max-width:700px){
 body.collection-page .collection-panel>.tablewrap{touch-action:pinch-zoom;scroll-behavior:auto;}
}

/* Nine-column collection, including exact purchase price. */
#cards th:nth-child(1){width:8%}
#cards th:nth-child(2){width:10%}
#cards th:nth-child(3){width:5%}
#cards th:nth-child(4){width:22%}
#cards th:nth-child(5){width:7%}
#cards th:nth-child(6){width:7%}
#cards th:nth-child(7){width:15%}
#cards th:nth-child(8){width:13%}
#cards th:nth-child(9){width:13%}
#cards th:nth-child(8),#cards td.paid-column{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}
@media(max-width:700px){#cards{min-width:820px;}#cards td.paid-column{overflow-wrap:normal;}}

/* Ten-column collection with signed unrealized gain. */
#cards th:nth-child(1){width:7%}
#cards th:nth-child(2){width:9%}
#cards th:nth-child(3){width:5%}
#cards th:nth-child(4){width:19%}
#cards th:nth-child(5){width:6%}
#cards th:nth-child(6){width:7%}
#cards th:nth-child(7){width:13%}
#cards th:nth-child(8){width:11%}
#cards th:nth-child(9){width:11%}
#cards th:nth-child(10){width:12%}
#cards th:nth-child(9),#cards td:nth-child(9),#cards td.card-gain{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600;}
#cards td.card-gain.gain-positive{color:#16713b}
#cards td.card-gain.gain-negative{color:#b42318}
#cards td.card-gain.gain-neutral{color:#64748b}
@media(max-width:700px){#cards{min-width:960px;}#cards th button{display:inline-block!important;}#cards .mobile-heading{display:none!important;}}

/* Compact sold-comparison source links. */
#cards th:nth-child(1){width:6%}
#cards th:nth-child(2){width:10%}
#cards th:nth-child(3){width:5%}
#cards th:nth-child(4){width:17%}
#cards th:nth-child(5){width:6%}
#cards th:nth-child(6){width:6%}
#cards th:nth-child(7){width:12%}
#cards th:nth-child(8){width:10%}
#cards th:nth-child(9){width:10%}
#cards th:nth-child(10){width:11%}
#cards th:nth-child(11){width:7%}
#cards th.ebay-source,#cards td.ebay-source{text-align:center;white-space:nowrap;font-size:12px;}
@media(max-width:700px){#cards{min-width:1040px;}}

/* Align financial headings and amounts consistently on every screen. */
#cards th:nth-child(8),#cards th:nth-child(9),#cards th:nth-child(10),
#cards td:nth-child(8),#cards td:nth-child(9),#cards td:nth-child(10){text-align:center;}
#cards th:nth-child(8) button,#cards th:nth-child(9) button,#cards th:nth-child(10) button{text-align:center;}

/* Full-width search; sorting is available directly in every sortable heading. */
.collection-panel .filters{grid-template-columns:minmax(0,1fr);}
.collection-panel .filters input{width:100%;}
#cards th button{white-space:nowrap;}
#cards th[aria-sort="ascending"] button,#cards th[aria-sort="descending"] button{color:var(--blue);}
@media(max-width:700px){#cards th button{display:inline-block!important;}}

/* Reclaim unused vertical space, without compressing card rows. */
body.collection-page .site-nav+main{margin-bottom:4px;}
body.collection-page .collection-panel{margin-bottom:0;padding-bottom:4px;}
@media(max-width:700px){
 body.collection-page .site-nav+main{margin-top:6px;margin-bottom:0;}
 body.collection-page .collection-title{margin-bottom:5px;}
 body.collection-page .stats{margin-bottom:6px;}
 body.collection-page .collection-panel{padding-top:5px;padding-bottom:0;}
 body.collection-page .collection-panel>.filters{margin-bottom:4px;}
 body.collection-page #cards tbody td:not(.ebay-source){font-size:15px;line-height:18.2px;}
}

/* Mobile collection footer follows the last card inside the scrolling region. */
.collection-mobile-footer{display:none;}
@media(max-width:700px){
 body.collection-page > .site-footer{display:none;}
 body.collection-page .tablewrap > .collection-mobile-footer{display:block;position:sticky;left:0;width:100%;margin-top:0;}
}

/* Twelve-column collection: grader follows grade. */
#cards th:nth-child(1){width:6%}
#cards th:nth-child(2){width:9%}
#cards th:nth-child(3){width:4%}
#cards th:nth-child(4){width:16%}
#cards th:nth-child(5){width:5%}
#cards th:nth-child(6){width:6%}
#cards th:nth-child(7){width:7%}
#cards th:nth-child(8){width:11%}
#cards th:nth-child(9){width:9%}
#cards th:nth-child(10){width:9%}
#cards th:nth-child(11){width:11%}
#cards th:nth-child(12){width:7%}
#cards th:nth-child(7),#cards td.grader-column{ text-align:center;white-space:nowrap;font-weight:normal; }
#cards th:nth-child(8),#cards td:nth-child(8){text-align:left;font-weight:normal;font-variant-numeric:tabular-nums;}
#cards th:nth-child(8) button{text-align:left;}
#cards th:nth-child(9),#cards th:nth-child(10),#cards th:nth-child(11),#cards td:nth-child(9),#cards td:nth-child(10),#cards td:nth-child(11){text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums;}
#cards th:nth-child(9) button,#cards th:nth-child(10) button,#cards th:nth-child(11) button{text-align:center;}
#cards td.paid-column{font-weight:normal;}
#cards td:nth-child(10){font-weight:600;}
@media(max-width:700px){#cards{min-width:1120px;}}
