@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;650;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root{--bg:#f8f5fc;--ink:#302638;--muted:#756c80;--line:#e5dced;--accent-soft:#d7c5ef;--accent:#75529a}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:24px}body{margin:0;background:var(--bg);color:var(--ink);font:14px 'DM Sans',sans-serif}button,input,select,textarea{font:inherit}button,a,input,select,summary{touch-action:manipulation}button{cursor:pointer;border:0;border-radius:7px;padding:11px 16px;font-weight:650}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #8964b2;outline-offset:3px}a{color:inherit}header{max-width:1320px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:24px 40px;border-bottom:1px solid var(--line)}.brand{text-decoration:none;display:flex;align-items:center;gap:9px;font:700 24px 'Space Grotesk',sans-serif;letter-spacing:-1px}.brand-icon{background:var(--accent-soft);width:33px;height:33px;display:grid;place-items:center;border:1px solid var(--ink);border-radius:9px}.beta{font:600 9px 'DM Sans',sans-serif;letter-spacing:1px;border:1px solid #d5c7e4;border-radius:4px;padding:4px;margin-left:4px}.header-right{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:12px}.local-dot{width:6px;height:6px;border-radius:50%;background:#9675bb}.quiet{background:transparent;color:var(--ink);font-size:12px}.header-right button{margin-left:16px}main{max-width:1240px;padding:0 32px;margin:auto}.intro{display:flex;justify-content:space-between;align-items:center;padding:55px 4px 43px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px}.intro h1{font:500 clamp(34px,4.4vw,57px)/1.05 'Space Grotesk',sans-serif;letter-spacing:-2.8px;margin:15px 0 18px}.intro h1 span{color:#8060a4}.intro p{color:var(--muted);line-height:1.7;margin:0}.intro-mark{position:relative;width:245px;height:180px;margin-right:65px}.mini-card{position:absolute;top:12px;width:92px;height:130px;border:1.5px solid #493653;border-radius:8px;display:grid;place-items:center;font-size:44px;box-shadow:3px 4px 0 #e2d8ed}.c1{background:#e6dcf3;left:18px;transform:rotate(-17deg)}.c2{background:#cbb4e8;left:83px;transform:rotate(4deg);z-index:2}.c3{background:#f0e9f8;left:145px;transform:rotate(20deg)}.intro-mark>span{position:absolute;bottom:0;left:50px;font-size:8px;letter-spacing:3px;color:var(--muted)}.steps{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:26px}.steps a{padding:18px 0;text-decoration:none;font-size:12px;display:flex;gap:10px;align-items:center}.steps b{font-size:10px;color:#92849f}.steps a:nth-child(2){padding-left:16px}.steps a:nth-child(3){padding-left:24px}#navCount{margin-left:auto;border-radius:4px;padding:4px 8px;background:#eee6f6;font-size:10px}.workspace{display:grid;grid-template-columns:1.65fr 1fr;gap:22px}.panel{background:#fff;border:1px solid var(--line);border-radius:11px;padding:25px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-head h2{font:600 17px 'Space Grotesk',sans-serif;letter-spacing:-.5px;margin:0}.section-head h2 span{font:500 11px 'DM Sans';color:#92849f;margin-right:10px}.tag{font-size:8px;color:#8a7b99;letter-spacing:1.1px}.dropzone{display:flex;align-items:center;flex-direction:column;justify-content:center;text-align:center;min-height:235px;background:#fbf8fe;border:1px dashed #d2c1e4;border-radius:9px;margin-top:23px;cursor:pointer;gap:9px}.dropzone.drag{background:#eee0fa}.dropzone input{position:absolute;width:1px;height:1px;opacity:0}.dropzone:focus-within{outline:3px solid var(--accent)}.upload-icon{font-size:27px;border:1px solid #ddd0eb;border-radius:12px;width:48px;height:48px;display:grid;place-items:center;margin-bottom:7px}.dropzone strong{font-size:16px}.dropzone>span:not(.upload-icon){font-size:12px;color:var(--muted)}.dropzone small{font-size:10px;color:#9688a3;margin-top:12px}.hint{font-size:12px;line-height:1.7;color:var(--muted);margin:14px 0}.preferences .hint{margin-bottom:21px}.pref-field{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:13px 0}.pref-field label{font-size:12px;display:flex;align-items:center;gap:8px}.cat-icon{display:grid;place-items:center;width:25px;height:25px;border-radius:7px;background:#f0e8f8;color:#8865a9}select,input{border:1px solid #e0d5e9;background:#fff;color:var(--ink);padding:10px;border-radius:6px;min-width:0}.pref-field select{width:155px;font-size:11px}.fallback{border-top:1px solid var(--line);padding-top:15px;font-size:11px;line-height:1.7;color:var(--muted)}.fallback span{color:var(--accent);margin-right:8px}.primary{background:var(--accent-soft);color:var(--ink);display:inline-flex;justify-content:space-between;gap:25px;border:1px solid #bda3da}.secondary{background:#f1eaf8;border:1px solid #e0d3ec}.full{width:100%;margin:4px 0 14px;font-size:12px}.preset-row{display:flex;gap:5px}.preset-row input{width:100%;font-size:11px}#presets{width:100%;margin:8px 0;font-size:11px}.subtle{font-size:10px;color:var(--muted)}details{margin-top:16px;font-size:12px;color:var(--muted)}summary{cursor:pointer}details p{line-height:1.8}textarea{width:100%;resize:vertical;border:1px solid var(--line);border-radius:6px;padding:12px;background:#fcfaff;color:var(--ink);line-height:1.6}details textarea{margin:12px 0}#status{font-size:11px;color:var(--accent);margin-top:15px;line-height:1.7}.image-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.image-tabs button{font-size:10px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.image-tabs button.active{background:var(--accent-soft)}#sourceCanvas{width:100%;max-height:600px;object-fit:contain;border:1px solid var(--line);touch-action:none;cursor:crosshair}.button-row{display:flex;justify-content:space-between;gap:10px;margin-top:12px}.review{margin-top:24px}.review .hint{margin-bottom:0}.review-tools{display:flex;justify-content:space-between;align-items:center;padding:18px 0;border-bottom:1px solid var(--line);margin-top:10px}#deckStats{font-size:12px}#deckStats strong{font-size:20px;margin-right:3px;font-family:'Space Grotesk'}#deckStats span{color:var(--muted);margin-left:12px}.empty{text-align:center;padding:40px;color:var(--muted)}.empty>span{font-size:30px;color:#b19ac6}.empty h3{font:500 16px 'Space Grotesk';color:#765b8d}.empty p{font-size:12px}.card-row{display:grid;grid-template-columns:55px minmax(120px,1fr) 70px auto;gap:18px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}.card-thumb{width:49px;height:69px;object-fit:contain;border-radius:4px;background:#f1eaf8}.card-info strong{font-size:13px}.card-info small{display:block;font-size:10px;color:var(--muted);line-height:1.7}.card-info .notice{color:#927020}.card-info button{padding:4px 0;font-size:11px;color:var(--accent);display:inline-block;margin-right:14px}.qty{width:65px;font-size:13px}.qty-wrap{font-size:9px;color:var(--muted);display:grid;gap:4px}.row-actions{display:flex;align-items:center;gap:10px}.check{display:flex;gap:8px;align-items:center;font-size:11px}.check input{accent-color:var(--accent);width:15px;height:15px}.complete{margin-top:22px;line-height:1.7}.export-panel{background:#eee5f8;border:1px solid #dccde9;border-radius:11px;margin-top:24px;padding:30px;display:grid;grid-template-columns:1fr 1.1fr;gap:35px}.export-panel h2{font:500 29px 'Space Grotesk';letter-spacing:-1px;margin:12px 0}.export-panel p{font-size:12px;line-height:1.8;color:#7b688e}.export-panel .primary{margin-top:14px}.export-note{font-size:10px!important;margin-top:20px}.text-output{border:1px solid #dccce9;background:#fcf9ff;border-radius:8px;overflow:hidden}.output-head{display:flex;justify-content:space-between;align-items:center;padding:8px 15px;border-bottom:1px solid var(--line)}.output-head>span{font-size:9px;letter-spacing:1.4px;color:var(--muted)}#output{background:transparent;border:0;border-radius:0;min-height:185px;font:11px/1.8 monospace;resize:vertical}#exportStatus{padding:10px 15px;font-size:10px;color:var(--muted);border-top:1px solid var(--line)}footer{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:29px 0 35px;color:var(--muted);font-size:9px}footer .brand{font-size:17px;color:var(--ink)}footer>a:last-child{text-decoration:none}dialog{max-width:830px;width:calc(100% - 30px);border:1px solid var(--line);border-radius:14px;padding:25px;color:var(--ink);background:var(--bg)}dialog::backdrop{background:#291c3b9c;backdrop-filter:blur(4px)}dialog input{width:100%;margin-top:20px}#results{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;max-height:58vh;overflow:auto;padding:6px}#results button{background:white;border:1px solid var(--line);padding:9px;font-size:10px;text-align:left;line-height:1.6}#results img{width:100%;aspect-ratio: .718;object-fit:contain}#results small{display:block;color:var(--muted);font-size:9px}#about{max-width:630px}#about p{font-size:13px;line-height:1.8;color:var(--muted)}#ocrText{white-space:pre-wrap;max-height:250px;overflow:auto;font-size:11px}.danger{color:#9c432c!important}

@media(max-width:760px){header{padding:18px 20px}.header-right{font-size:0}.header-right button{font-size:11px;margin-left:0}.header-right .local-dot{display:none}main{padding:0 18px}.intro{padding:35px 0}.intro-mark{display:none}.intro h1{letter-spacing:-1.8px}.intro p{font-size:12px}.steps a{font-size:10px;gap:6px;padding:15px 3px!important}.steps a:nth-child(3){flex-wrap:wrap}#navCount{display:none}.workspace{grid-template-columns:1fr}.panel{padding:20px}.export-panel{grid-template-columns:1fr;padding:22px;gap:18px}.card-row{grid-template-columns:42px 1fr 55px;gap:10px}.card-thumb{width:40px;height:56px}.row-actions{grid-column:2/4;justify-content:space-between}.qty{width:55px}.section-head h2{font-size:16px}.section-head .secondary{font-size:11px;padding:9px}.tag{font-size:7px}footer{flex-wrap:wrap;line-height:1.8}footer span{order:3;width:100%}#results{grid-template-columns:repeat(3,1fr)}.pref-field select{width:165px}#deckStats span{margin-left:4px}.review-tools .quiet{font-size:10px}}



#sourceCanvas{height:auto;max-height:none}

.deck-group{margin:24px 0}.deck-group h3{font:600 14px 'Space Grotesk',sans-serif;display:flex;gap:9px;align-items:center;margin-bottom:15px}.deck-group h3 span{font:500 10px 'DM Sans';background:#eee5f7;border-radius:5px;padding:4px 7px;color:#8060a4}.deck-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:20px 14px}.deck-card{min-width:0}.card-face{position:relative}.card-art{display:block;width:100%;padding:0;background:#eee7f5;border-radius:8px;overflow:hidden;aspect-ratio: .714;box-shadow:0 2px 5px #35204416}.card-art img{display:block;width:100%;height:100%;object-fit:contain}.card-art:hover{outline:3px solid var(--accent-soft);outline-offset:2px}.quantity-badge{position:absolute;bottom:5%;left:50%;transform:translateX(-50%);width:41px;height:43px;display:grid;place-items:center;background:#7a55a1;clip-path:polygon(50% 0,100% 24%,100% 76%,50% 100%,0 76%,0 24%);filter:drop-shadow(0 2px 2px #0005)}.quantity-badge input{color:white;background:transparent;border:0;width:100%;text-align:center;font:700 25px 'Space Grotesk';padding:5px 0;border-radius:0;appearance:textfield;-moz-appearance:textfield}.quantity-badge input::-webkit-inner-spin-button,.quantity-badge input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.quantity-badge:focus-within{background:#573677}.remove-card{position:absolute;top:5px;right:5px;background:#30203eb8;color:white;border-radius:50%;padding:0;width:21px;height:21px;font-size:16px;opacity:0}.deck-card:hover .remove-card,.remove-card:focus-visible{opacity:1}.deck-card>strong{display:block;font-size:10px;margin-top:8px;line-height:1.5}.deck-card>small{display:block;font-size:9px;color:var(--muted);margin-top:3px}.tile-actions{display:flex;gap:7px;justify-content:space-between}.tile-actions button{padding:5px 0;font-size:9px;color:var(--accent)}.tile-note{font-size:9px!important;line-height:1.5}.match-warning{display:block;font-size:9px;background:#fff0ce;color:#8b640e;padding:5px;border-radius:4px;margin-top:4px}.unresolved .card-art{outline:2px solid #d9a934}.unknown-art{font-size:50px;color:#b19ac7}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media(max-width:1000px){.deck-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(max-width:650px){.deck-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 10px}.remove-card{opacity:1}.quantity-badge{width:35px;height:37px}.quantity-badge input{font-size:22px}.deck-card>strong{font-size:10px}}

.split-note{font-size:11px;color:#7e6197;line-height:1.7;background:#f1e9f9;border-radius:6px;padding:10px 12px;margin:0 0 15px}



.section-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.section-head>.quiet{white-space:nowrap}#cropStatus{margin:8px 0;font-size:11px}



.steps{grid-template-columns:repeat(4,1fr)}.steps a:nth-child(n){padding:18px 10px}.steps a:first-child{padding-left:0}.upload-note{font-size:11px;color:var(--muted);line-height:1.7;margin:13px 0 0}.export-panel h2 span{font:500 11px "DM Sans",sans-serif;color:#92849f;margin-right:10px}.intro p{max-width:440px}.primary:hover{background:#cbb4e8}.quantity-badge:focus-within{background:#573677}@media(max-width:760px){.steps{grid-template-columns:repeat(2,minmax(0,1fr))}.steps a:nth-child(n){padding:12px 4px!important}}



/* Consistent interaction feedback, including quiet/icon/card buttons. */

button{transition:transform .18s ease,background-color .18s ease,box-shadow .18s ease,border-color .18s ease,opacity .18s ease}

button:not(:disabled):hover{transform:translateY(-2px);box-shadow:0 4px 10px #75529a24}

button.quiet:not(:disabled):hover{background:#eee5f8}

button.secondary:not(:disabled):hover{background:#e5d7f2;border-color:#bda3da}

button:not(:disabled):active{transform:translateY(0);box-shadow:none}

.scan-mode{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}.scan-mode label{font-size:12px;font-weight:650}.scan-mode select{max-width:230px;font-size:12px}#modeHint{margin:8px 0}

@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}button{transition:none}button:not(:disabled):hover,button:not(:disabled):active{transform:none}}



[hidden]{display:none!important}.scan-controls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-top:14px}.scan-controls .scan-mode{margin:0;display:grid;gap:6px}.scan-controls .scan-mode label{font-size:10px;color:var(--muted)}.scan-controls .scan-mode select{max-width:none;min-height:40px}.scan-controls #resetCrop{margin-left:auto}#sourceCanvas{display:block;border-radius:8px}#imageWorkspace>.hint:first-child{margin-top:20px}@media(max-width:460px){.scan-controls{gap:8px}.scan-controls .scan-mode{flex:1;min-width:160px}.scan-controls .scan-mode select{width:100%}.scan-controls #scan{min-height:40px}.scan-controls #resetCrop{margin-left:0}}



.tentative .card-art{outline:3px solid #d99b25;outline-offset:2px}.tentative-warning{display:block;margin-top:6px;padding:6px;background:#fff0ce;color:#845b09;border-radius:5px;font-size:9px;line-height:1.5}.confirm-match{font-weight:700;color:#845b09!important}.tentative .tile-actions{flex-wrap:wrap}.tentative .tile-note{color:#845b09}



.scan-controls{margin:0 0 16px}.scan-warning{padding:14px;border:2px solid #d6a235;background:#fff3d5;color:#644615;border-radius:10px;margin:14px 0}.text-import-actions{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}.file-button{display:inline-flex;position:relative;cursor:pointer;align-items:center}.file-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}#textWorkspace>label{font-weight:600}#inputText{width:100%;box-sizing:border-box;font-family:monospace} .output-head>div{display:flex;flex-wrap:wrap;justify-content:flex-end}

.file-button{padding:11px 16px;border-radius:7px;font-weight:650;transition:transform .18s ease,box-shadow .18s ease}.file-button:hover{transform:translateY(-2px);box-shadow:0 4px 10px #75529a24}.file-button:focus-within{outline:3px solid #8964b2;outline-offset:3px}@media(prefers-reduced-motion:reduce){.file-button{transition:none}.file-button:hover{transform:none}}



#sourceCanvas{touch-action:auto;cursor:default}



#showPositions{margin:8px 0 12px;font-size:12px}



#positionReport{font-size:11px;line-height:1.6;max-height:200px;overflow:auto;background:#f7f2fc;padding:10px;border-radius:6px;white-space:pre-wrap}



.inferred-count{display:block;padding:5px 0;color:#845b09!important;font-weight:600}


.contact-panel{margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:20px;background:#f0e9f8}.contact-panel h2{font:600 18px 'Space Grotesk',sans-serif;margin:0 0 7px}.contact-panel p{margin:0;color:var(--muted);line-height:1.6}.contact-link{display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:12px 16px;border:1px solid #cbb6e2;border-radius:7px;text-decoration:none;font-weight:650;color:var(--accent);background:#fff;transition:transform .18s ease,box-shadow .18s ease,background .18s ease;overflow-wrap:anywhere}.contact-link:hover{transform:translateY(-2px);box-shadow:0 4px 10px #75529a24;background:#e5d7f2}@media(max-width:640px){.contact-panel{align-items:stretch;flex-direction:column}.contact-link{font-size:13px}}@media(prefers-reduced-motion:reduce){.contact-link{transition:none}.contact-link:hover{transform:none}}
