:root{color-scheme:light;--ink:#243e40;--muted:#597173;--paper:#fffaf0;--accent:#176c64;--line:#c9d6c8;font-family:ui-rounded,"SF Pro Rounded",system-ui,sans-serif;background:#e8eddf;color:var(--ink)}*{box-sizing:border-box}body{margin:0}main{max-width:1160px;margin:auto;padding:30px}header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px}h1{font-size:clamp(24px,3vw,34px);margin:6px 0}h2{font-size:24px;margin:0 0 14px}h3{font-size:17px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.16em}.badge{padding:10px 16px;border-radius:30px;background:#d6e2d0;font-size:13px;white-space:nowrap}section{background:var(--paper);border:1px solid var(--line);border-radius:24px;padding:25px;margin:20px 0;box-shadow:0 8px 30px #243e4008}p{line-height:1.55}button,input,select{font:inherit;min-height:46px;border-radius:12px;padding:11px 14px}input,select{width:100%;border:1px solid #adbbb0;background:white;color:var(--ink)}label{display:block;font-size:14px;margin:12px 0}label input,label select{margin-top:6px}button{border:1px solid transparent;background:var(--accent);color:white;cursor:pointer;font-weight:650}button.quiet{border-color:var(--line);background:#edf0e5;color:var(--ink)}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #edac3b;outline-offset:3px}a{color:var(--accent);overflow-wrap:anywhere}.actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.notice{font-size:14px;color:var(--muted);border-left:3px solid #bd943e;padding-left:15px}#error{color:#a43a2a;white-space:pre-line}#status{font-weight:600}.journey{padding:0;overflow:hidden;display:grid;grid-template-columns:1.4fr 1fr}.scene{position:relative;min-height:350px;overflow:hidden;background:linear-gradient(#b1d9dd,#e5efcb)}.sun{width:105px;height:105px;border-radius:50%;position:absolute;background:#fff2b4;right:50px;top:38px}.hill{position:absolute;width:120%;height:160px;border-radius:50%;bottom:-25px;left:-25%;background:#7bb7a1;transform:rotate(-10deg)}.hill.front{bottom:-85px;left:12%;background:#3f8375}.book-mark{position:absolute;top:74px;left:55px;font-size:100px;color:#fff8db;text-shadow:0 3px #427e74}.scene-caption{position:absolute;bottom:27px;left:30px;right:25px;color:white;text-shadow:0 1px 3px #13483d}.scene-caption h2{font-size:27px}.scene-caption p{margin:6px 0}.progress-box{padding:32px;align-self:center}.progress-heading{display:flex;justify-content:space-between;gap:12px}progress{width:100%;height:14px;margin-top:18px;accent-color:var(--accent)}.route{display:flex;gap:12px;margin:20px 0}.route span{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e4e8d9;color:#6b7f6e}.route .done{background:var(--accent);color:white}.route .current{outline:2px solid #ad8938;outline-offset:3px}.connections{display:grid;grid-template-columns:1fr 1fr;gap:28px}.connections img{display:block;width:180px;height:180px;background:white;margin:15px 0}.connections code{font-size:11px;overflow-wrap:anywhere}article{padding:5px 10px}.scan-layout{display:grid;grid-template-columns:1fr 1fr;gap:28px}video{width:100%;aspect-ratio:3/4;max-height:440px;object-fit:contain;background:#253e40;border-radius:16px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.row{display:flex;gap:12px;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:12px 0}.row span{overflow-wrap:anywhere}.row button{flex-shrink:0}.empty,footer{font-size:13px;color:var(--muted)}footer{margin:25px 0}#result{font-weight:650}#adjustment{color:#924622}[hidden]{display:none!important}.setup{max-width:660px}.setup ol{padding-left:24px;line-height:1.65}.setup li{margin-bottom:18px}.setup code{overflow-wrap:anywhere;font-size:12px}@media(max-width:760px){main{padding:16px}header{align-items:flex-start;flex-direction:column;gap:8px}section{padding:20px;border-radius:18px}.journey{display:block}.scene{min-height:250px}.scene-caption{left:22px}.progress-box{padding:24px}.connections,.scan-layout{grid-template-columns:1fr}.connections img{width:160px;height:160px}video{max-height:320px}.badge{font-size:11px;padding:6px 12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}















































































































































.scanner-role .scene{display:none}.scanner-role .journey{display:block}.scanner-role .progress-box{padding:20px}.scanner-role .route{margin:12px 0}















































































































































.admission{position:sticky;top:10px;z-index:10;background:#fff0bf;border:2px solid #bd943e;box-shadow:0 8px 24px #243e4033}.admission h2{font-size:20px}.admission .row{border:0}















































































































































/* Grid and flex children must be allowed to shrink below long card names. */















































































































































main,section,article,.progress-box,.scan-layout>div,.connections>article,.fields>label,.row>span{min-width:0;max-width:100%}h1,h2,h3,p,label,button,.row>span,summary{overflow-wrap:anywhere}input,select,video,img{max-width:100%;min-width:0}button{white-space:normal;height:auto}.row{flex-wrap:wrap}.row>span{flex:1 1 180px}.row button{max-width:100%}.fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.scan-layout,.connections{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.progress-heading{flex-wrap:wrap}.scene-caption{min-width:0}#scene-beat{font-size:19px;line-height:1.6;max-width:760px}#chapter-goal{font-weight:700}#history-page{white-space:pre-line;line-height:1.6}#achievement{border-top:1px solid var(--line);margin-top:25px;padding-top:25px}.scene #page-art{position:relative;display:block;width:100%;height:auto;aspect-ratio:1000/640;object-fit:contain;z-index:1}.scene.has-art{background:#eadcbb;min-height:0}.scene.has-art>.sun,.scene.has-art>.hill,.scene.has-art>.book-mark{display:none}.scene.has-art .scene-caption{position:relative;inset:auto;padding:18px 24px;color:var(--ink);text-shadow:none;z-index:2}.scene.has-art .scene-caption h2{font-size:24px}.scene.has-art #scene-copy{display:none}.scene.has-art #scene-eyebrow{color:var(--muted)}.journey:fullscreen{background:var(--paper);display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);align-items:center;overflow:auto}.journey:fullscreen .scene img{max-height:85vh}















































































































































@media(max-width:760px){.scan-layout,.connections{grid-template-columns:minmax(0,1fr)}.scene.has-art .scene-caption{padding:16px}.journey:fullscreen{display:block}.progress-heading{font-size:14px}.row button{flex:0 1 auto}#scene-beat{font-size:17px}.scene-caption h2{font-size:24px}.scene-caption p{font-size:14px}}















































































































































@media(max-width:360px){main{padding:10px}section{padding:16px}.fields{grid-template-columns:minmax(0,1fr)}.actions button{width:100%}.badge{white-space:normal}.route{gap:10px}.progress-box{padding:20px}}































































































































































































































































































#card-preview{width:260px;max-height:380px;object-fit:contain;display:block;margin:12px auto}#history-links{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}































































































































































































































































































textarea{display:block;width:100%;min-width:0;max-width:100%;font:inherit;border:1px solid var(--line);border-radius:12px;padding:12px;margin-top:7px}nav section a{font-size:22px;font-weight:700;text-decoration:none}nav section a:focus-visible{outline:3px solid #edac3b}































































































































































































































































































#card-preview-status{font-size:14px;color:var(--muted);overflow-wrap:anywhere}































































































































































































































































































#card-preview{cursor:zoom-in}#card-preview:focus-visible{outline:3px solid #edac3b;outline-offset:3px}#card-viewer{width:min(94vw,1050px);max-width:100vw;height:92dvh;max-height:100dvh;border:1px solid var(--line);border-radius:18px;padding:14px;background:var(--paper);color:var(--ink)}#card-viewer::backdrop{background:#172b32d9}.card-zoom-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.card-zoom-surface{height:calc(100% - 140px);min-height:120px;overflow:auto;touch-action:none;overscroll-behavior:contain;margin-top:12px}.card-zoom-surface img{display:block;max-width:none;max-height:none;height:auto;margin:auto;user-select:none;-webkit-user-drag:none}#card-viewer p{font-size:13px}































































































































































































































































































.camera-view{position:relative}.camera-view video{display:block}.camera-view canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}































































































































































































































































































/* Reserve the same space for every OCR message; keep unusually long errors readable. */















































































































































#camera-status{height:4.65em;line-height:1.55;overflow:auto;overflow-wrap:anywhere;scrollbar-gutter:stable;overscroll-behavior:contain}















































































































































@media(max-width:760px){#camera-status{height:7.75em}}































































































































































































































































































#scan-photo{display:block;width:260px;max-height:380px;object-fit:contain;margin:12px auto;cursor:zoom-in}#scan-photo:focus-visible{outline:3px solid #edac3b}.scan-photo-panel{border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:18px}#edition-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:10px;margin:12px 0}.edition-choice{display:flex;flex-direction:column;gap:10px;align-items:center;max-width:100%;text-align:left}.edition-choice>span{max-width:100%;overflow-wrap:anywhere}.edition-detail{position:relative;display:block;width:190px;height:68px;overflow:hidden;background:#eee;border-radius:8px}.edition-detail img{position:absolute;bottom:0;left:0;width:190px;max-width:none;height:auto}































































































































































































































































































#scanner{scroll-margin-top:calc(env(safe-area-inset-top,0px) + 12px)}#scan-notice{padding:14px 16px;border:2px solid #bd943e;border-radius:12px;background:#fff0bf;color:#594214;font-weight:650;margin:0 0 16px}#scan-notice[data-phase="saved"]{background:#def2df;border-color:#44835c;color:#214d35}#scan-notice[data-phase="blocked"]{background:#ffebe3;border-color:#a43a2a;color:#842d20}















































































































































.edition-detail.edition-detail-gold{height:266px}.edition-filter,.edition-more{grid-column:1/-1}































































































































































































































































































#scan-diagnostics{margin:12px 0;border:1px solid var(--line);border-radius:12px;padding:12px}#scan-diagnostics summary{cursor:pointer}#diagnostics-status{font-size:14px;overflow-wrap:anywhere;min-height:3em}.check{display:flex;gap:10px;align-items:center;margin:10px 0}.check input{width:20px;height:20px;margin:0;flex:0 0 20px}#scan-verification{margin:12px 0}#scan-verification p{margin-bottom:8px}















































































































































#evidence-photo{display:block;max-width:100%;max-height:65vh;object-fit:contain;margin:auto}#trace,#replay-result{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;max-height:65vh;overflow:auto}#attempts{max-width:100%}































































































































































































































































































#ui-timeline{padding-left:22px;max-height:70vh;overflow:auto}#ui-timeline li{margin:12px 0;overflow-wrap:anywhere}#ui-timeline pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}#ui-timeline summary{font-size:13px}































































































































































































































































































/* Keep the two reference views compact; enlargement remains available by tap. */















































































































































.scan-images{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}.scan-images h3{font-size:13px;margin:12px 0 6px}.scan-images #scan-photo,.scan-images #card-preview{width:auto;max-width:100%;height:150px;margin:6px auto}.scan-images .scan-photo-panel{border:0;margin:0;padding:0}.scan-images .empty,.scan-images #card-preview-status{font-size:12px}.scan-images #card-preview-retry{font-size:12px}.scan-images .catalog-photo{grid-column:2}#scan-result-panel{scroll-margin-top:16px}#scan-candidates{padding:12px;border:1px solid var(--line);border-radius:12px;background:#edf0e5}#scan-candidates button{margin:4px;max-width:100%}































































































































































































































































































/* Stable touch controls; 16px fields avoid focus zoom in mobile Safari. */















































































































































input,select,textarea{font-size:16px}button,a,summary,input,select{touch-action:manipulation}html{-webkit-text-size-adjust:100%;text-size-adjust:100%}















































































































































.choice-group{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.choice-group button{flex:1 1 auto;font-size:16px;padding:9px;min-height:46px}.choice-group [aria-pressed="true"]{background:var(--accent);color:white;border-color:var(--accent)}















































































































































#scanner details{margin:10px 0}#scanner summary{padding:10px 0;min-height:44px;cursor:pointer}#scanner .scan-layout{display:block}#scan-result-panel{display:none}#scanner.reviewing #scan-camera-panel{display:none}#scanner.reviewing #scan-result-panel{display:block}#scan-result-panel>label{margin-top:8px}#scanner:not(.reviewing) #scan-camera-panel{max-width:620px;margin:auto}















































































































































#choose-printing{width:100%;text-align:left}#scanner .scan-copy-fields{grid-template-columns:90px minmax(0,1fr)}#scanner .scan-images img{height:110px}#scanner .scan-images h3{margin-top:8px}#scanner .scan-images p{margin:4px 0}#scanner #result{margin:8px 0;font-size:14px}#scanner .submit-actions{position:sticky;bottom:0;padding:10px 0 calc(10px + env(safe-area-inset-bottom));background:var(--paper);z-index:2}#scanner .submit-actions #add{flex:1}#scan-camera-link{margin-bottom:8px}#printing-picker{width:min(680px,96vw);height:88dvh;max-height:94dvh;border:1px solid var(--line);border-radius:18px;padding:16px;background:var(--paper);color:var(--ink)}#printing-picker::backdrop{background:#172b32b0}.picker-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.picker-heading h2{margin:0;font-size:22px}#printing-picker #edition-review>h3,#printing-picker #edition-review>p{display:none}#printing-picker .edition-choice{min-height:126px}#printing-picker .edition-detail-gold{height:160px}#printing-picker #edition-choices{grid-template-columns:repeat(2,minmax(0,1fr))}#printing-picker .edition-detail{max-width:100%}#printing-picker .edition-choice{padding:10px;font-size:13px}#printing-picker .edition-choice span:last-child{min-height:3em}#printing-picker .edition-detail img{max-width:none}#scanner-queue:has(#pending:empty):has(#drafts:empty){display:none}















































































































































@media(max-width:760px){#scanner{padding:14px}#scanner .scan-layout{gap:0}#scanner h2{font-size:21px;margin-bottom:10px}#scanner video{max-height:280px}#scanner .scan-images #card-preview-status{font-size:11px}#scanner .fields{gap:8px}}















































































































































#printing-picker .picker-heading button{flex-shrink:0;white-space:nowrap}#printing-picker .edition-choice:has(.edition-detail-gold){grid-column:1/-1;display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px}#printing-picker .edition-detail-gold{width:100px;height:140px}#printing-picker .edition-detail-gold img{width:100px}#scanner .submit-actions button,#scanner .result-navigation button{width:auto}















































































































































/* Programmatic scroll destinations are containers, not interactive controls. */















































































































































#scanner:focus,#scan-result-panel:focus{outline:none}































































































































































































































































































/* Compact edition rows and persistent search keep long catalogs navigable. */















































































































































#printing-picker .picker-tools{position:sticky;top:-16px;background:var(--paper);padding:12px 0 8px;z-index:2;border-bottom:1px solid var(--line)}















































































































































#printing-picker #edition-choices{grid-template-columns:minmax(0,1fr)}















































































































































#printing-picker .edition-choice{display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;min-height:76px;gap:12px}















































































































































#printing-picker .edition-choice span:last-child{min-height:0}















































































































































#printing-picker .edition-detail{width:90px;height:52px}















































































































































#printing-picker .edition-detail img{width:130px}















































































































































.edition-sets{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;padding:4px 0}















































































































































.edition-sets button{font-size:13px;min-height:44px;padding:8px 10px}















































































































































.edition-sets [aria-pressed="true"]{background:var(--accent);color:white}















































































































































#finish-note{margin:0 0 8px;font-size:12px}































































































































































































































































































/* Review a scan in the order it is confirmed, with the common choices in view. */















































































































































#scan-result-panel #result{line-height:1.35}































































































































































































































































































#scan-result-panel #scan-found{padding:11px 14px;margin:0 0 8px;border:1px solid var(--dt-line,var(--line));border-left:3px solid var(--dt-gold,var(--accent));border-radius:12px;background:var(--dt-raised,var(--paper))}















































































































































#scan-result-panel .scan-found-label{display:block;color:var(--dt-gold,var(--accent));font-size:13px;font-weight:700;letter-spacing:.04em;line-height:1.2}















































































































































#scan-result-panel #scan-found-name{display:block;margin-top:3px;color:var(--dt-text,var(--ink));font-size:clamp(25px,6vw,30px);font-weight:750;line-height:1.18;overflow-wrap:anywhere}















































































































































#scanner .result-navigation button{min-height:42px;padding:7px 10px;font-size:13px}















































































































































#scanner .result-navigation #scan-camera-link{margin-bottom:0}















































































































































#scan-candidates:not([hidden]){display:grid;gap:5px;padding:10px}















































































































































#scan-candidates p{margin:0 0 3px;font-size:13px;line-height:1.35}















































































































































#scan-candidates button{display:block;width:100%;min-height:44px;margin:0;padding:8px 12px;text-align:left}















































































































































#scan-result-panel .scan-entry-fields{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:6px 10px;align-items:end;margin-top:8px}















































































































































#scan-result-panel .scan-entry-fields label{min-width:0;margin:0}















































































































































#scan-result-panel .scan-field-label{display:block;font-size:14px;margin-bottom:6px}















































































































































#scan-result-panel .scan-printing-field{min-width:0}















































































































































#scan-result-panel .scan-printing-field button{min-height:46px;margin:0}















































































































































#scan-result-panel .scan-quantity-field input{margin-top:6px}















































































































































#scan-result-panel .scan-finish-field,#scan-result-panel .scan-kind-field,#scan-result-panel #finish-note{grid-column:1/-1}















































































































































#scan-result-panel .scan-finish-field,#scan-result-panel .scan-kind-field{display:block}















































































































































#scan-result-panel .scan-entry-fields .choice-group{margin-top:6px}















































































































































#scan-result-panel #finish-note{margin:-3px 0 2px;line-height:1.3}















































































































































#scan-result-panel .scan-images{clear:both}















































































































































@media(max-width:700px){















































































































































  body.scanner-page #scanner.reviewing>h2{display:none}















































































































































  body.scanner-page #scan-result-panel .result-navigation{margin:0 0 3px}















































































































































  body.scanner-page #scan-result-panel #result{margin:4px 0 7px}















































































































































  body.scanner-page #scan-result-panel .scan-entry-fields{gap:7px 8px;margin-top:7px}















































































































































  body.scanner-page #scan-result-panel .scan-entry-fields .choice-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}















































































































































  body.scanner-page #scan-result-panel .scan-entry-fields .choice-group button{min-height:44px;padding:6px 4px;font-size:14px}















































































































































  body.scanner-page #scan-result-panel .scan-kind-field .choice-group{grid-template-columns:repeat(3,minmax(0,1fr))}















































































































































  body.scanner-page #scan-result-panel .scan-kind-field .choice-group button{font-size:13px}















































































































































  body.scanner-page #scan-result-panel #scan-reference[open] .scan-images{margin:0 0 4px}















































































































































  body.scanner-page #scan-result-panel #scan-reference .scan-images img{height:88px}















































































































































  body.scanner-page #scan-result-panel #scan-reference .scan-images h3{margin:5px 0 2px}















































































































































  body.scanner-page #scan-result-panel #scan-reference .scan-images p{margin:2px 0}















































































































































  body.scanner-page #scanner #scan-result-panel .submit-actions{position:static;margin:8px 0 0;padding:8px 0 0;border-top:1px solid var(--dt-line,var(--line));box-shadow:none}















































































































































  body.scanner-page #scan-result-panel .submit-actions #add{min-width:0}















































































































































  body.scanner-page #scan-result-panel .submit-actions #defer{flex:none}















































































































































}















































































































































































































































































































































































































































.edition-set-picker{grid-column:1/-1}.edition-set-picker summary{padding:12px 4px;min-height:44px;cursor:pointer;font-weight:650}































































































































































































































































































/* Keep only the short title row fixed while the search and messages scroll with editions. */















































































































































#printing-picker .picker-tools{padding:4px 0 6px}















































































































































#printing-picker .picker-heading{min-height:44px}















































































































































#printing-picker .picker-heading h2{font-size:18px}















































































































































#printing-picker .picker-heading>button{flex-shrink:0;min-height:44px;padding:8px 12px;white-space:nowrap}















































































































































#printing-picker .picker-search-row{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:end;gap:6px;margin:6px 0 8px}















































































































































#printing-picker .picker-search{display:block;margin:0}















































































































































#printing-picker .picker-search span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}















































































































































#printing-picker .picker-search input{margin:0;min-height:44px;padding:8px 12px}















































































































































#printing-picker .picker-options{position:relative;margin:0}















































































































































#printing-picker .picker-options>summary{list-style:none;display:grid;place-items:center;width:44px;height:44px;min-height:44px;border:1px solid var(--dt-line,var(--line));border-radius:12px;background:var(--dt-panel,#edf0e5);color:var(--dt-text,var(--ink));font-size:24px;cursor:pointer}















































































































































#printing-picker .picker-options>summary::-webkit-details-marker{display:none}















































































































































#printing-picker .picker-options>summary:focus-visible{outline:3px solid #edac3b;outline-offset:3px}















































































































































#printing-picker .picker-options-panel{position:absolute;right:0;top:calc(100% + 6px);z-index:5;width:min(300px,calc(96vw - 32px));max-height:min(65dvh,380px);overflow:auto;padding:12px;border:1px solid var(--dt-line,var(--line));border-radius:12px;background:var(--dt-panel,var(--paper));box-shadow:0 12px 28px #0006}















































































































































#printing-picker .picker-options-panel button{display:block;width:100%;text-align:left;white-space:normal;margin:0 0 6px}















































































































































#printing-picker .picker-options-panel .check{font-size:14px;margin:6px 0 12px}















































































































































#printing-picker #printing-status{margin:4px 0 8px;line-height:1.3;font-size:12px}















































































































































#printing-picker #printing-status:empty{display:none}















































































































































#printing-picker #edition-choices{margin:4px 0 0;padding-bottom:8px}















































































































































#printing-picker .picker-load-more{display:block;width:100%;margin:12px 0 4px}















































































































































#printing-picker .edition-choice{min-height:84px;grid-template-columns:100px minmax(0,1fr)}















































































































































#printing-picker .edition-detail{width:100px;height:60px}















































































































































#printing-picker .edition-detail img{width:145px}















































































































































@media(max-width:700px){















































































































































  #printing-picker{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:12px}















































































































































  #printing-picker .picker-tools{top:-12px}















































































































































}

/* ECOSYSTEM THEME — generated by tools/build_ecosystem_theme.py */
/* Dragon Table: общий визуальный язык меню, инструментов и игры. */
:root {
  --dt-bg:#101814; --dt-panel:#1b2821; --dt-raised:#29382c;
  --dt-text:#efe9d8; --dt-muted:#b8c1b1; --dt-gold:#d6bc83;
  --dt-line:#647052; --dt-focus:#f1d49a; --dt-radius:10px;
  --dt-button:linear-gradient(145deg,#344332,#233027);
  --dt-primary:linear-gradient(145deg,#e0c998,#c5a66c);
  --dt-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
body:not(.table-shell) {
  color-scheme:dark; --ink:var(--dt-text); --text:var(--dt-text);
  --muted:var(--dt-muted); --paper:var(--dt-panel); --panel:var(--dt-panel);
  --bg:var(--dt-bg); --accent:var(--dt-gold); --gold:var(--dt-gold); --line:var(--dt-line);
  color:var(--dt-text); font-family:var(--dt-font);
}
body:not(.table-shell):not(.menu-page):not(:has(.home)) {
  background:radial-gradient(ellipse at 80% 0,#38442d66,transparent 55%),var(--dt-bg);
  min-height:100svh;
}
body:not(.table-shell) :is(h1,h2) {font-family:Georgia,serif;font-weight:400;color:var(--dt-text)}
body:not(.table-shell) .eyebrow {color:var(--dt-gold)}
body:not(.table-shell) button:not(:where(.art-button,.card-list-row,.menu-card,.menu-item,.text-button,.colors button,.saved-deck-cover,.saved-deck-name,.saved-deck-results,.saved-deck-menu)),
body:not(.table-shell) .file-button,
body .dt-nav a {
  border:1px solid var(--dt-line); border-radius:var(--dt-radius);
  background:var(--dt-button); color:var(--dt-text);
  min-height:44px; padding:10px 14px; font-family:var(--dt-font); font-weight:600;
  line-height:1.3; touch-action:manipulation; cursor:pointer;
  box-shadow:inset 0 1px 0 #ffffff0a,0 3px 9px #030a0526;
  transition:background .15s,border-color .15s,box-shadow .15s;
}
body:not(.table-shell) :is(button.primary,.file-button.primary,button[aria-pressed=true],.view-switch button.active),
body:not(.table-shell) :is(#camera,#retry-card,#add,#join-submit,#open-session,#start,#solo,#book-open,#accept,#check) {
  background:var(--dt-primary); color:#19241c; border-color:var(--dt-gold);
}
@media(hover:hover) {
  body:not(.table-shell) button:not(:where(:disabled,.art-button,.card-list-row,.menu-card,.menu-item,.colors button,.saved-deck-cover,.saved-deck-name,.saved-deck-results,.saved-deck-menu)):hover,
  body .dt-nav a:hover {border-color:var(--dt-gold);box-shadow:inset 0 0 0 1px #d6bc8344,0 4px 14px #0004}
}
body:not(.table-shell) button:disabled {opacity:.45;cursor:default;box-shadow:none}
body:not(.table-shell) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  color-scheme:dark; background:#111c16; color:var(--dt-text); border:1px solid var(--dt-line);
  border-radius:var(--dt-radius); font-family:var(--dt-font); font-size:16px; min-height:44px;
}
body:not(.table-shell) input::placeholder {color:#99a592;opacity:1}
body:not(.table-shell) input[type=checkbox] {accent-color:var(--dt-gold)}
body:not(.table-shell) :is(button,a,input,select,textarea,summary):focus-visible {
  outline:3px solid var(--dt-focus);outline-offset:3px;
}
body:not(.table-shell) a:not(:where(.menu-card,.menu-item,.wordmark)) {color:var(--dt-gold)}
body .dt-nav {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 24px;flex:none;align-self:auto}
body .dt-nav a {display:inline-flex;align-items:center;text-decoration:none;font-size:13px}
body .dt-nav a[aria-current=page] {border-color:var(--dt-gold);background:#514b32;color:var(--dt-text)}
body:not(.table-shell) dialog {color-scheme:dark;border-radius:16px;border-color:var(--dt-line);box-shadow:0 24px 80px #0008}
body:not(.table-shell) dialog::backdrop {background:#050b08cc}
@media(prefers-reduced-motion:reduce) {body button,body .dt-nav a {transition:none}}

/* Спокойная системная типографика; декоративный шрифт только в логотипе/меню. */
body:not(.table-shell):not(.menu-page):not(:has(.home)) {font-size:15px;line-height:1.55}
body:not(.table-shell):not(.menu-page):not(:has(.home)) :is(h1,h2,h3) {
  font-family:var(--dt-font);font-weight:600;line-height:1.25;letter-spacing:normal;
}
body:not(.table-shell) :is(button,input,select,textarea) {letter-spacing:normal}
body:not(.table-shell) button {hyphens:none;word-break:normal;overflow-wrap:normal}
body:not(.table-shell) :is(.summary-note,.price-lot small,.notice,.empty) {font-size:14px;line-height:1.55}

/* Shared green surfaces with slate buttons and gold accents. */
:root {
  --dt-bg:#101814;
  --dt-panel:#1b2821;
  --dt-raised:#29382c;
  --dt-text:#eee4cf;
  --dt-muted:#b7b6ab;
  --dt-gold:#d2ab63;
  --dt-line:#806a45;
  --dt-focus:#f2d48f;
  --dt-radius:5px;
  --dt-button:linear-gradient(180deg,#34414a,#222c35);
  --dt-primary:linear-gradient(180deg,#dfbd76,#a97837);
}

body:not(.table-shell) {
  background:
    radial-gradient(circle at 18% 0,#38442d66,transparent 34%),
    radial-gradient(circle at 100% 100%,#543b1e44,transparent 42%),
    repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 4px),
    var(--dt-bg);
}

body.dt-tools {
  background:
    radial-gradient(circle at 50% -20%,#38442d44,transparent 48%),
    repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 4px),
    var(--dt-bg);
}

body:not(.table-shell) :is(section,.tool-disclosure,.menu-dialog,dialog),
body.dt-tools :is(section,.tool-disclosure) {
  border-radius:var(--dt-radius);
  border-color:var(--dt-line);
  background:linear-gradient(145deg,#223127,#17251c);
  box-shadow:0 8px 24px #0006, inset 0 1px #ffffff12;
}

body.dt-tools .dt-tools-header {
  background:linear-gradient(180deg,#1b2821,#142119);
  border-bottom:1px solid var(--dt-line);
  box-shadow:0 3px 12px #0007;
}

body.dt-tools .dt-tools-brand,
body:not(.table-shell) :is(h1,h2,h3,h4) {
  text-shadow:1px 1px 0 #0008;
}

body:not(.table-shell) :is(button,.file-button,.dt-nav a):not(:where(.saved-deck-cover,.saved-deck-name,.saved-deck-results,.saved-deck-menu)),
body.dt-tools .collection-tools button {
  border-radius:var(--dt-radius);
  background:var(--dt-button);
  border-color:#8b7149;
  box-shadow:inset 0 1px #ffffff16, inset 0 -2px #0003, 0 3px 7px #0005;
}

body:not(.table-shell) :is(button.primary,.file-button.primary,button[aria-pressed=true],.view-switch button.active),
body:not(.table-shell) #play,
body:not(.table-shell) .menu-play,
body:not(.table-shell) .menu-dialog button:not(.quiet):not(.menu-close) {
  background:var(--dt-primary);
  border-color:#e3c47f;
  color:#201a12;
  text-shadow:none;
}

body:not(.table-shell) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  border-radius:var(--dt-radius);
  border-color:#756447;
  background:#111c16;
  box-shadow:inset 0 2px 5px #0006;
}

body.dt-tools .dt-nav a[aria-current=page] {background:#51432d;color:#f2dfb5}
body.dt-tools .badge {border-radius:var(--dt-radius);background:#3b3325;color:#e4c47e}
body:not(.table-shell) a:not(:where(.menu-card,.menu-item,.wordmark)) {color:#dfbd76}

body.dt-tools.menu-page > main.menu-shell {
  border-radius:var(--dt-radius);
  border-color:#92764a;
  box-shadow:0 10px 32px #0008, inset 0 0 0 1px #ffffff0b;
}

body.table-shell {
  --dt-bg:#101814; --dt-panel:#1b2821; --dt-raised:#29382c;
  --dt-text:#eee4cf; --dt-muted:#b7b6ab; --dt-gold:#d2ab63; --dt-line:#806a45;
  background:
    repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 4px),
    var(--dt-bg);
}

body.table-shell :is(#mobile-table #m-rail,#mobile-table #m-overlay,dialog.m-mechanic-dialog) {
  border-radius:var(--dt-radius);
  box-shadow:0 12px 30px #0008, inset 0 1px #ffffff12;
}

body section {border-radius:16px;background:var(--dt-panel);border-color:var(--dt-line);box-shadow:0 10px 28px #0002}
body h1 {font-size:clamp(30px,4vw,44px);line-height:1.12}
body header {border-bottom:1px solid var(--dt-line);padding-bottom:22px}
body .badge {border:1px solid var(--dt-line);background:#29382c;color:var(--dt-gold);border-radius:8px}
body :is(.empty,footer,.notice,#card-preview-status,#diagnostics-status) {color:var(--dt-muted)}
body #error {color:#ffb4a4}
body :is(#scan-candidates,.admission) {background:#333526;color:var(--dt-text);border-color:var(--dt-gold)}
body #scan-notice {background:#393526;color:#f2deb0;border-color:#b69b63}
body #scan-notice[data-phase=saved] {background:#243e2c;color:#d2e8c8;border-color:#83a577}
body #scan-notice[data-phase=blocked] {background:#492e28;color:#ffd0c2;border-color:#c1846d}
body :is(#printing-picker,#card-viewer) {background:var(--dt-panel);color:var(--dt-text);border-color:var(--dt-line)}
body #scanner .submit-actions,body #printing-picker .picker-tools {background:var(--dt-panel)}
body .choice-group [aria-pressed=true],body .edition-sets [aria-pressed=true] {background:var(--dt-primary);color:#19241c;border-color:var(--dt-gold)}
body .connections article {background:#132018;border:1px solid #46543f;border-radius:12px;padding:18px}
body .connections img {padding:8px;border-radius:8px}
body #scanner video {background:#0a120e;border:1px solid #46543f;border-radius:12px}
body #scanner details {border-top:1px solid #46543f;padding-top:6px}
body #scanner summary {color:var(--dt-gold)}
body #scan-diagnostics {background:#132018}

/* Compact scanner: camera first, connections and history on demand. */
body.scanner-page .scanner-heading {display:flex;align-items:center;gap:12px}
body.scanner-page .scanner-heading .badge {padding:4px 10px;font-size:12px}
body.scanner-page #mode-notice {margin:4px 0;border:0;padding:0;font-size:12px}
body.scanner-page #status {font-size:13px;margin:4px 0 10px}
body.scanner-page #error:empty {display:none}
body.scanner-page section {padding:14px;margin:10px 0}
body.scanner-page .collection-summary {padding:10px 14px}
body.scanner-page .collection-summary .eyebrow {display:none}
body.scanner-page .collection-summary h2 {font-size:16px;margin:0}
body.scanner-page .collection-summary .rank-badge {padding:4px 10px;font-size:13px}
body.scanner-page .collection-summary p {margin:3px 0;font-size:12px}
body.scanner-page .collection-summary progress {height:6px;margin:0;display:block}
body.scanner-page .collection-summary .summary-links {font-size:12px;gap:16px;margin-top:4px}
body.scanner-page .collection-summary .summary-delta:empty {display:none}
body.scanner-page #scanner .scan-layout {display:block}
body.scanner-page #scanner:not(.reviewing) #scan-camera-panel {display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,1fr);column-gap:20px;max-width:980px;align-items:start}
body.scanner-page .camera-view {grid-column:1;grid-row:1/5}
body.scanner-page #scanner video {height:clamp(200px,32vh,300px);max-height:300px;aspect-ratio:auto}
body.scanner-page #scan-camera-panel > .empty {margin:0 0 8px}
body.scanner-page #scan-camera-panel > .actions {margin:0;gap:6px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
body.scanner-page #scan-camera-panel > .actions button {font-size:13px;padding:9px}
body.scanner-page #camera-status {margin:8px 0 0;font-size:13px}
body.scanner-page .scan-token-toggle {display:flex;align-items:center;gap:8px;margin:4px 0 8px}
body.scanner-page .scan-token-toggle input {width:18px;height:18px}
body.scanner-page #scan-token-search {background:#333526;border:1px solid var(--dt-gold);border-radius:12px;padding:12px;margin:8px 0}
body.scanner-page #scan-token-search label {display:block}
body.scanner-page #token-query {width:100%;max-width:400px}
body.scanner-page #token-candidates {display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:10px 0}
body.scanner-page .token-candidate {display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:4px;min-width:0;padding:8px}
body.scanner-page .token-candidate img {width:100%;height:150px;object-fit:contain}
body.scanner-page .token-candidate small {overflow-wrap:anywhere}
body.scanner-page #scanner details {margin:6px 0}
body.scanner-page #scanner summary {padding:8px 0}
body.scanner-page #scan-result-panel {max-width:860px;margin:auto}
body.scanner-page #scanner .actions {gap:6px;margin:6px 0}
body.scanner-page #scanner .scan-images {float:right;width:34%;margin:0 0 8px 16px}
body.scanner-page #scanner .scan-images img {height:100px}
body.scanner-page #scanner .submit-actions {clear:both;position:static;padding:8px 0}
body.scanner-page .connections {gap:12px}
body.scanner-page .connections article {padding:12px}
body.scanner-page .connections img {width:140px;height:140px}
@media(max-width:700px) {
  body.scanner-page #scanner:not(.reviewing) #scan-camera-panel {display:block}
  body.scanner-page #scanner video {height:220px}
  body.scanner-page #scan-camera-panel > .empty {font-size:12px;margin:6px 0}
  body.scanner-page #camera-status {height:7.75em}
  body.scanner-page #scanner .scan-images {float:none;width:auto;margin:0}
  body.scanner-page #scanner .submit-actions {position:sticky;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
}

@media(max-width:900px){body.dt-tools .dt-nav .deck-desktop-link{display:none}}

/* scanner-manabox-v1: camera and confirmation share one working viewport. */
body.scanner-page #collection-summary{display:none}
body.scanner-page #scanner{padding:10px;scroll-margin-top:0}
body.scanner-page #scanner .scan-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:14px}
body.scanner-page #scanner #scan-camera-panel,
body.scanner-page #scanner.reviewing #scan-camera-panel{display:flex;flex-direction:column;max-width:none;margin:0;gap:4px}
body.scanner-page #scanner #scan-result-panel{display:block;min-width:0;width:100%;margin:0;position:relative}
body.scanner-page .scan-toolbar{display:flex;gap:6px}
body.scanner-page .scan-toolbar button{flex:0 1 auto;min-width:44px;min-height:44px;padding:4px 9px;font-size:12px;line-height:1.2}
body.scanner-page #stack-values{font-size:12px;margin:4px 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
body.scanner-page #scan-state{margin:4px 0 8px;font-weight:600;font-size:14px;line-height:1.3}
body.scanner-page .camera-view{grid-area:auto;flex:1;min-height:0}
body.scanner-page #scanner video{display:block;width:100%;height:400px;max-height:none;object-fit:contain;aspect-ratio:auto}
body.scanner-page #scan-camera-panel>.actions{display:flex;flex-wrap:wrap;gap:4px;margin:0}
body.scanner-page #scan-camera-panel>.actions button{flex:1 1 120px;min-height:44px;min-width:120px;font-size:13px;padding:6px}
body.scanner-page #scan-camera-panel>.actions button span{min-width:0;white-space:normal;overflow-wrap:normal}
body.scanner-page #scan-found{margin:0 0 6px;padding:0;border:0;background:transparent}
body.scanner-page #scan-found .scan-found-label{display:none}
body.scanner-page #scan-found-name{font-size:17px;line-height:1.25;overflow-wrap:anywhere}
body.scanner-page #scan-result-panel #scan-found{padding:0;margin:0 0 4px;border:0;background:none;padding-right:62px}
body.scanner-page #scan-result-panel #scan-found-name{font-size:17px;line-height:1.25;margin:0;font-weight:600}
body.scanner-page #scan-result-panel .scan-field-label{display:none}
body.scanner-page .scan-result-grid{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px;align-items:start}
body.scanner-page #scanner:not([data-state=ready]):not([data-state=editing]) .scan-result-grid{display:none}
body.scanner-page #compact-sample{position:relative;float:none;display:flex;flex-direction:column;align-items:center;width:auto;min-width:0;margin:0;gap:4px;text-align:center}
body.scanner-page #compact-sample .sample-image{display:grid;place-items:center;position:relative;min-height:70px;width:100%}
body.scanner-page #compact-sample img{width:54px;height:70px;object-fit:contain;cursor:zoom-in;border-radius:4px;margin:0}
body.scanner-page #sample-message{font-size:12px;line-height:1.3;color:var(--dt-muted)}
body.scanner-page #compact-sample>span{font-size:12px;line-height:1.25;overflow-wrap:normal;word-break:normal;color:var(--dt-muted)}
body.scanner-page #compact-sample .sample-image>.scan-icon{position:absolute;bottom:0;right:8px;width:20px;height:20px;pointer-events:none;background:var(--dt-panel);border-radius:4px}
body.scanner-page #compact-sample:has(img[hidden]) .scan-icon{display:none}
body.scanner-page #scanner #scan-result-panel .scan-entry-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:0;width:auto;align-items:end}
body.scanner-page .scan-printing-field{grid-column:1/-1;min-width:0}
body.scanner-page #choose-printing{width:100%;padding:6px 8px;font-size:14px;min-height:44px;overflow-wrap:anywhere;white-space:normal;text-align:left}
body.scanner-page #scanner #scan-result-panel .scan-quantity-field{display:flex;flex-direction:column;align-items:start;gap:4px;width:auto;min-width:0;margin:0;font-size:12px}
body.scanner-page .scan-quantity-stepper{display:grid;grid-template-columns:44px minmax(44px,1fr) 44px;align-items:center;width:100%;max-width:180px;min-width:132px}
body.scanner-page .scan-quantity-stepper button{width:44px;min-width:44px;height:44px;margin:0;padding:0;font-size:22px;line-height:1;border-radius:8px}
body.scanner-page #quantity-value{display:flex;align-items:center;justify-content:center;min-height:44px;font-size:18px;font-variant-numeric:tabular-nums;color:var(--dt-text)}
body.scanner-page .scan-card-controls{display:block;margin:4px 0}
body.scanner-page .scan-kind-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-width:0}
body.scanner-page .scan-kind-switch button{min-width:44px;min-height:44px;padding:4px;font-size:13px;line-height:1.2;border-radius:8px;overflow-wrap:normal}
body.scanner-page .scan-kind-switch button[aria-pressed=true]{background:var(--dt-gold);color:#13251c;border-color:var(--dt-gold);font-weight:600;box-shadow:inset 0 -3px #13251c66}
body.scanner-page .scan-card-controls[hidden],body.scanner-page #compact-sample[hidden]{display:none}
body.scanner-page .scan-symbols{position:absolute;overflow:hidden;pointer-events:none}
body.scanner-page .scan-icon{display:inline-block;width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
body.scanner-page :is(.scan-toolbar button,.picker-heading button,.card-zoom-actions button,#next-card,#retry-card){display:inline-flex;align-items:center;justify-content:center;gap:6px}
body.scanner-page :is(button,input,select,summary){touch-action:manipulation}
body.scanner-page :is(button,input,select,[role=button]):focus-visible{outline:2px solid var(--dt-focus);outline-offset:2px}
body.scanner-page button:active:not(:disabled){filter:brightness(1.15)}
body.scanner-page dialog :is(button,input,select){min-height:44px}
body.scanner-page #scanner #scan-found{padding-right:0}
body.scanner-page #scanner .submit-actions{position:static;margin:4px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px;clear:both}
body.scanner-page #scanner #add{min-width:44px;min-height:44px;font-size:16px;padding:8px;flex:1}
body.scanner-page #scanner #defer{min-height:44px;font-size:12px;padding:8px}
body.scanner-page #scanner #cancel-edit{flex:1 0 100%;min-height:44px;padding:8px;font-size:13px}
body.scanner-page #scanner:not([data-state=ready]):not([data-state=editing]) .scan-entry-fields,
body.scanner-page #scanner:not([data-state=ready]):not([data-state=editing]) #add{display:none}
body.scanner-page #scanner[data-state=ready] #manual-card,
body.scanner-page #scanner[data-state=ready] #camera-stop{display:none}
/* The recognized result is paused: retry overlays its preview, without a new row. */
body.scanner-page #scanner[data-state=ready] #scan-camera-panel{position:relative}
body.scanner-page #scanner[data-state=ready] #scan-camera-panel>.actions{position:absolute;bottom:6px;right:6px;left:6px;justify-content:flex-end}
body.scanner-page #scanner[data-state=ready] #scan-camera-panel #retry-card{flex:0 1 auto;min-width:44px;min-height:44px;box-shadow:0 2px 8px #0008}
body.scanner-page #scan-candidates{padding:4px;margin:0;font-size:12px}
body.scanner-page #scan-candidates p{display:none}
body.scanner-page #scan-candidates button{min-height:44px;font-size:12px;padding:6px;margin:2px}
body.scanner-page #result:empty{display:none}
body.scanner-page #scan-notice{margin:3px 0;font-size:12px;padding:6px;line-height:1.25}
body.scanner-page #scan-result-link{display:none!important}
body.scanner-page dialog{background:var(--dt-panel);color:var(--dt-text);width:min(700px,calc(100vw - 16px));max-height:calc(min(100dvh,var(--scan-viewport-height,100dvh)) - 16px);padding:12px;overflow:auto;overscroll-behavior:contain;border-radius:var(--dt-radius);border:1px solid var(--dt-line)}
body.scanner-page dialog :is(input:not([type=checkbox]),select){font-size:16px}
body.scanner-page #card-viewer .card-zoom-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-items:center}
body.scanner-page #card-viewer .card-zoom-actions button{width:100%;margin:0;min-width:44px;min-height:44px;padding:8px;font-size:13px}
body.scanner-page #card-viewer [data-close]{grid-column:1/3;grid-row:1}
body.scanner-page #card-viewer [data-fit]{grid-column:3;grid-row:1}
body.scanner-page #card-viewer [data-minus]{grid-column:1;grid-row:2}
body.scanner-page #card-viewer [data-scale]{grid-column:2;grid-row:2;text-align:center;font-size:14px}
body.scanner-page #card-viewer [data-plus]{grid-column:3;grid-row:2}
body.scanner-page dialog .picker-heading{position:sticky;top:-12px;background:var(--dt-panel);z-index:3;padding:8px 0;border-bottom:1px solid var(--dt-line);gap:6px}
body.scanner-page dialog .picker-heading h2{font-size:18px;overflow-wrap:anywhere}
body.scanner-page dialog label{display:block;margin:10px 0}
body.scanner-page dialog label :is(input,select){width:100%}
body.scanner-page dialog p{font-size:13px}
body.scanner-page #manual-picker #scan-name-editor summary{display:none}
body.scanner-page #manual-picker #search{width:100%}
body.scanner-page #series-list .row{display:flex;flex-wrap:wrap;gap:6px;align-items:start;padding:12px 0;border-bottom:1px solid var(--dt-line)}
body.scanner-page #series-list .row>span{flex:1 0 100%;font-size:14px;overflow-wrap:anywhere}
body.scanner-page #series-list button{font-size:12px;padding:8px;min-height:44px}
body.scanner-page #printing-picker .picker-search-row{display:flex;flex-wrap:wrap;gap:4px;position:static;background:var(--dt-panel)}
body.scanner-page #printing-picker .picker-heading h2{flex:1;min-width:0;font-size:16px;line-height:1.25;letter-spacing:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
body.scanner-page #printing-picker .picker-heading button{flex:none;max-width:90px;font-size:12px;white-space:normal;padding:6px}
body.scanner-page #printing-picker .picker-search{flex:1 0 100%;margin:0}
body.scanner-page #printing-picker .picker-options{display:none}
body.scanner-page #printing-picker #edition-choices{display:block}
body.scanner-page #printing-picker .printing-row{display:flex;align-items:center;gap:6px;margin:6px 0}
body.scanner-page #printing-picker .edition-choice{flex:1;min-width:0;grid-template-columns:64px minmax(0,1fr);gap:8px;padding:6px;min-height:102px}
body.scanner-page #printing-picker .printing-sample{display:block;width:64px;height:90px;background:#101814}
body.scanner-page #printing-picker .printing-sample img{width:64px;height:90px;object-fit:contain;max-width:100%}
body.scanner-page #printing-picker .printing-enlarge{font-size:11px;padding:6px;min-width:44px;min-height:44px}
body.scanner-page #printing-picker .edition-choice span:last-child{overflow-wrap:anywhere;min-height:0}
@media(max-width:700px){
  body.scanner-page main{padding:4px 8px}
  body.scanner-page .dt-tools-header{margin:0;padding:6px 8px}
  body.scanner-page .dt-tools-header .dt-tools-brand{display:none}
  body.scanner-page .dt-tools-header .dt-nav{margin:0;gap:3px}
  body.scanner-page #scanner{margin:2px 0;padding:6px}
  body.scanner-page #scanner .scan-layout{display:block}
  body.scanner-page #scanner video{height:var(--camera-height,calc(100dvh - 350px));min-height:105px}
  body.scanner-page #scan-result-panel{margin-top:4px!important}
  body.scanner-page #scan-state{margin:2px 0 4px;font-size:13px}
  body.scanner-page #scanner #result{margin:4px 0;font-size:13px}
  body.scanner-page #scan-found-name{font-size:15px}
  body.scanner-page #scan-result-panel #scan-found-name{font-size:15px}
  body.scanner-page #scan-result-panel #scan-found-name{font-size:16px}
  body.scanner-page .scan-toolbar button{font-size:13px}
  body.scanner-page #scanner{padding-bottom:calc(6px + env(safe-area-inset-bottom))}
  body.scanner-page #scanner .submit-actions{padding-bottom:env(safe-area-inset-bottom)}
  body.scanner-page #scanner-settings{margin-top:14px}
}

@media(max-width:360px){
  body.scanner-page .scan-result-grid{grid-template-columns:88px minmax(0,1fr);gap:6px}
}

/* Catalogue recovery does not cover camera or confirmation controls. */
.catalog-notice { margin: 8px 0; padding: 10px 12px; border-inline-start: 3px solid var(--gold, #bca66a); background: rgba(188,166,106,.08); border-radius: 8px; font-size: .85rem; line-height: 1.4; overflow-wrap: anywhere; }
#catalog-notice { margin: 3px 0; padding: 3px 8px; font-size: .8rem; line-height: 1.3; }

/* Compact secondary scanner tools; native disclosure preserves current processing. */
body.scanner-page #scanner-tools{margin:6px 0;padding:0;border:1px solid var(--dt-line);border-radius:12px;background:var(--dt-panel)}
body.scanner-page #scanner-tools>summary{display:flex;align-items:center;gap:8px;min-height:44px;padding:10px 12px;box-sizing:border-box;color:var(--dt-text);font-size:14px;font-weight:600;cursor:pointer;list-style:none}
body.scanner-page #scanner-tools>summary::-webkit-details-marker{display:none}
body.scanner-page #scanner-tools>summary::after{content:'+';margin-left:auto;color:var(--dt-gold);font-size:20px;font-weight:400}
body.scanner-page #scanner-tools[open]>summary::after{content:'−'}
body.scanner-page #scanner #scanner-tools>details{margin:0 12px;padding:6px 0;border:0;border-top:1px solid var(--dt-line);border-radius:0;background:transparent}
body.scanner-page #scanner #scanner-tools>details>summary{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;margin:0;padding:10px 0;box-sizing:border-box;color:var(--dt-gold);font-size:14px;font-weight:600;line-height:1.4;cursor:pointer;list-style:none}
body.scanner-page #scanner-tools>details>summary::-webkit-details-marker{display:none}
body.scanner-page #scanner-tools>details>summary::after{content:'+';margin-left:auto;flex:none;font-size:20px;font-weight:400}
body.scanner-page #scanner-tools>details[open]>summary::after{content:'−'}
body.scanner-page #scanner-tools :is(p,label,a){font-size:13px;line-height:1.4;overflow-wrap:anywhere}
body.scanner-page #scanner-tools label{display:block;margin:10px 0}
body.scanner-page #scanner-tools label :is(input:not([type=checkbox]),select){width:100%;min-width:0;min-height:44px}
body.scanner-page #scanner-tools label:is(.check,.scan-token-toggle){display:flex;align-items:center;gap:8px;min-height:44px}
body.scanner-page #scanner-tools input[type=checkbox]{width:20px;height:20px;flex:none}
body.scanner-page #scanner-tools button{min-height:44px;white-space:normal;font-size:13px}
body.scanner-page #scanner-tools #camera-status{height:auto;margin:6px 0}
body.scanner-page #scanner-tools .connections{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))}
body.scanner-page #scanner-tools #scan-diagnostics{padding:8px;border-radius:8px}

/* Only a server receipt makes the next-card action primary. */
body.scanner-page #scanner[data-state=saved] #next-card{flex:2 1 170px;min-width:170px;min-height:48px;background:var(--dt-gold);color:#13251c;border:2px solid var(--dt-gold);font-size:14px;font-weight:700;box-shadow:inset 0 1px #fff6,inset 0 -3px #13251c66,0 2px 8px #0004}
body.scanner-page #scanner[data-state=saved] #next-card .scan-icon{width:24px;height:24px;flex:none}
body.scanner-page #scanner[data-state=saved] #manual-card{flex:1 1 80px;min-width:80px}
body.scanner-page #scanner-tools #camera-stop:not([hidden]){display:inline-flex}
/* One readable submission status; full card detail remains in its accessible name. */
body.scanner-page #scan-notice{box-sizing:border-box;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Two matching compact toggles, with unknown and Etched retained in the card settings. */
body.scanner-page .scan-copy-toggles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body.scanner-page .scan-copy-toggle{min-width:0}
body.scanner-page .scan-toggle-label{display:flex;align-items:center;justify-content:space-between;gap:3px;min-height:18px;font-size:11px;line-height:1.2;padding:0 2px 3px}
body.scanner-page .scan-toggle-label span:last-child{font-size:10px;color:var(--dt-muted)}
body.scanner-page :is(.scan-kind-switch,.scan-finish-switch){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;padding:2px;border:1px solid var(--dt-line);border-radius:10px;background:var(--dt-panel)}
body.scanner-page :is(.scan-kind-switch,.scan-finish-switch) button{min-width:44px;min-height:44px;margin:0;padding:3px;font-size:12px;line-height:1.2;border:0;border-radius:7px;box-shadow:none;white-space:nowrap}
body.scanner-page :is(.scan-kind-switch,.scan-finish-switch) button[aria-pressed=true]{background:var(--dt-gold);color:#13251c;font-weight:600;box-shadow:inset 0 -2px #13251c55}

/* Desktop owner: admitted devices and confirmed session receipts. Shared header unchanged. */
body.scanner-session-desktop #desktop-session {padding:24px;margin:8px 0}
body.scanner-session-desktop .desktop-session-heading {display:flex;justify-content:space-between;align-items:start;gap:20px}
body.scanner-session-desktop .session-eyebrow {font-size:11px;letter-spacing:.14em;color:var(--dt-gold);margin:0 0 6px}
body.scanner-session-desktop #desktop-session-title {font-size:28px;line-height:1.2;margin:0 0 8px}
body.scanner-session-desktop .session-description {color:var(--dt-muted);font-size:13px;margin:6px 0 14px}
body.scanner-session-desktop .desktop-session-actions {display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}
body.scanner-session-desktop .desktop-session-grid {display:grid;grid-template-columns:minmax(240px,.7fr) minmax(0,1.6fr);gap:18px}
body.scanner-session-desktop .desktop-session-grid>article {background:#132018;border:1px solid #46543f;border-radius:12px;padding:18px;min-width:0}
body.scanner-session-desktop .desktop-session-grid h3 {font-size:17px;margin:0}
body.scanner-session-desktop .session-card-heading {display:flex;align-items:center;justify-content:space-between;gap:10px}
body.scanner-session-desktop #desktop-device-count {color:var(--dt-gold);margin-left:6px}
body.scanner-session-desktop #desktop-session-totals {font-size:22px;color:var(--dt-gold);margin:16px 0 6px;font-variant-numeric:tabular-nums}
body.scanner-session-desktop #desktop-session .row {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid #46543f;overflow-wrap:anywhere}
body.scanner-session-desktop #desktop-devices .row>span {flex:1 0 100%}
body.scanner-session-desktop #desktop-session .row:last-child {border-bottom:0}
body.scanner-session-desktop #desktop-session-cards {max-height:380px;overflow:auto}
body.scanner-session-desktop .desktop-session-footer {margin-top:20px;display:grid;gap:6px}
body.scanner-session-desktop .desktop-session-footer details {border-top:1px solid #46543f;padding:8px 0}
body.scanner-session-desktop .desktop-session-footer summary {cursor:pointer;color:var(--dt-gold);padding:8px 0}
body.scanner-session-desktop #desktop-invitation {max-width:650px;margin:14px 0}
body.scanner-session-desktop #desktop-invitation article {display:grid;grid-template-columns:150px minmax(0,1fr);gap:8px 18px;align-items:center}
body.scanner-session-desktop #desktop-invitation img {grid-column:1;grid-row:1/5;width:150px;height:150px;max-width:100%;border-radius:8px;padding:6px;background:white}
body.scanner-session-desktop #desktop-invitation :is(h3,p,a) {grid-column:2;margin:0}
body.scanner-session-desktop #desktop-setup img {width:140px;height:140px;max-width:100%}
body.scanner-session-desktop #desktop-owner-host #connections {display:none}
body.scanner-session-desktop #desktop-owner-host #participants {display:none}
body.scanner-session-desktop #desktop-owner-host :is(#open-session,#close-session) {display:none}
body.scanner-session-desktop #scanner[hidden] {display:none!important}
body.scanner-session-desktop #desktop-session button {min-height:44px;margin:0;font-size:14px}
body.scanner-page #device-admission .row {display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding:12px 0;border-top:1px solid var(--dt-line)}
body.scanner-page #device-admission .row>span {flex:1 0 100%;font-size:18px;overflow-wrap:anywhere}
body.scanner-page #device-admission::backdrop {background:#0009}
@media(min-width:701px) and (max-width:1000px){
  body.scanner-session-desktop .desktop-session-grid {grid-template-columns:1fr}
  body.scanner-session-desktop #desktop-session {padding:18px}
}

/* One locally served face for every shell screen, including Cyrillic and digits. */
@font-face {
  font-family:"Dragon Inter";
  src:url("/ui-font.woff2") format("woff2");
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
}
body.dt-tools {
  --dt-font:"Dragon Inter",Arial,sans-serif;
  font-family:var(--dt-font);
  font-size:15px;
  line-height:1.5;
  font-optical-sizing:auto;
  font-variant-numeric:lining-nums tabular-nums;
}
/* Legacy components contain font shorthands; keep only their size and line height. */
body.dt-tools,body.dt-tools * {font-family:var(--dt-font)!important}
body.dt-tools :is(h1,h2,h3,h4,.dt-tools-brand,.overview-rank-top strong) {
  font-weight:600;
  line-height:1.3;
  letter-spacing:normal;
}
body.dt-tools .dt-tools-brand {font-weight:600;letter-spacing:normal}
body.dt-tools :is(button,input,select,textarea) {letter-spacing:normal}
body.dt-tools :is(input,select,textarea) {font-size:16px}
body.dt-tools :is(p,li,.notice,.empty,.muted,.summary-note) {line-height:1.5}
body.dt-tools :is(.eyebrow,.prototype,.dialog-bar span) {letter-spacing:normal}
body.dt-tools .overview-metric-primary strong {letter-spacing:normal}
body.dt-tools .overview-rank-top strong {font-size:20px}
body.dt-tools :is(.overview-metric span,.overview-rank-top span,.overview-rank-next,.overview-rank-scale,
 .summary-note,.price-coverage,.price-state,.price-grid small,.price-grid article > span,
 .kind-summary,.stat-line,.rank-progress p,.price-filter-note,.filter-group-heading p,
 .origin-key,.filter-active,.added-filter-note,.card-meta,.lot-print small,.lot-print em,
 .lot-editor label,.lot-prices,.price-heading span,.price-quote,.price-quote small,
 .price-method,.detail-art .muted,.tile-sub,.catalog-price small,.copy-count) {font-size:13px;line-height:1.45}
body.dt-tools .card-tile h3 {font-size:14px;line-height:1.4;font-weight:600}
body.dt-tools .catalog-price {font-size:14px;line-height:1.45}
body.dt-tools .overview-rank-next b {font-size:14px}
body.dt-tools .dt-tools-header .dt-nav a {font-size:14px;letter-spacing:normal}
body.dt-tools :is(.collection-tools button,#toggle-filters,#reset-filters,.text-disclosure,.edit-print,.lot-save) {font-size:13px}
@media(max-width:700px) {
  body.dt-tools .dt-tools-brand {font-size:18px}
  body.dt-tools .dt-tools-header .dt-nav a {font-size:12px;letter-spacing:normal}
  body.dt-tools .overview-rank-top strong {font-size:18px}
  body.dt-tools .menu-card {font-size:14px}
}
@media(max-width:360px) {
  body.dt-tools .dt-tools-header .dt-nav a {font-size:11px}
  body.dt-tools .menu-card {font-size:13px}
}
/* Small screens share one legible navigation size; links divide space by text width. */
@media(max-width:700px) {
  body.dt-tools .dt-tools-header .dt-nav {display:flex;flex-wrap:nowrap;gap:3px}
  body.dt-tools .dt-tools-header .dt-nav a,
  body.dt-tools:is(.has-panel-nav,.panel-page) .dt-tools-header .dt-nav a {
    flex:1 1 auto;padding:9px 2px;font-size:12px;letter-spacing:normal;
  }
}
body.dt-tools .results-line label {font-size:13px}
body.dt-tools #card-dialog .dialog-bar span {font-size:13px;letter-spacing:normal}
body.dt-tools #card-detail .lot-editor :is(input,select) {font-size:16px}
body.dt-tools #card-detail :is(.lot-editor label,.lot-print b,.lot-print small,.lot-print em,.lot-prices,.price-heading span,.price-quote small,.price-method,.detail-art .muted) {font-size:13px;line-height:1.45}
