/* Bulma provides controls and type. Geometry below models native app screens. */
body.mobile-reader{--reader-header-height:calc(68px + env(safe-area-inset-top));margin:0;padding:0;overflow:hidden;background:#11151c}
.reader-screen{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;overflow:hidden}
.reader-camera{background:#11151c;color:white}
.camera-stage,.camera-stage video{position:absolute;inset:0;width:100%;height:100%}
.camera-stage video{object-fit:cover}
.camera-off{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;color:#fff9}
.camera-off svg{width:72px;height:72px}
.camera-controls{display:flex;align-items:center;gap:8px;flex:none}
.camera-dropdown{position:relative;flex:none;width:44px;height:44px;border:1px solid #ffffff44;border-radius:8px;background:#11151ce6}
.camera-top .camera-icon,.camera-top [data-open-menu]{width:44px;height:44px;min-height:44px;padding:10px}
.camera-dropdown>svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:24px;height:24px;pointer-events:none;fill:currentColor}
.camera-dropdown select{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;border:0;background:transparent;color:transparent;text-shadow:none;appearance:none;-webkit-appearance:none;cursor:pointer;font:inherit;font-size:16px;touch-action:manipulation}
.camera-dropdown:focus-within{outline:3px solid #aab0ff;outline-offset:3px}
.camera-dropdown option{background:#11151c;color:white}
.camera-controls .button{color:white;border-color:#ffffff44;background:#11151ce6}
.camera-icon{width:52px;height:52px;padding:12px;flex:none}
.camera-icon svg{width:24px;height:24px;fill:currentColor}
.camera-stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#11151c}
.camera-stage #camera-freeze{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.camera-stage #scan-highlight{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#scan-highlight-box{fill:#39e58c33;stroke:#39e58c;stroke-width:3;vector-effect:non-scaling-stroke;rx:8px}
.camera-top{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left))}
.camera-top{position:relative;z-index:3;background:linear-gradient(#0009,transparent);gap:8px}
.camera-top.reader-header{position:fixed;inset:0 0 auto;height:var(--reader-header-height);box-sizing:border-box;z-index:5;background:#11151cf2}
.reader-result,.reader-history{padding-top:var(--reader-header-height);box-sizing:border-box}
.camera-top h1{font-size:1rem;font-weight:700;margin:0;color:white;display:flex;align-items:center;gap:.5rem;min-width:0;white-space:nowrap}
.camera-top h1>a{display:flex;align-items:center;gap:.5rem;min-width:0;color:inherit;text-decoration:none}
.camera-top h1>a>svg,.camera-top h1>a>.tag{flex:none}
.camera-top h1>a:focus-visible{outline:3px solid #aab0ff;outline-offset:4px;border-radius:4px}
.reader-brand-name{overflow:hidden;text-overflow:ellipsis;min-width:0}
.camera-top .button,.camera-top .camera-dropdown{color:white;border-color:#ffffff44;background:#11151c99;border-radius:var(--bulma-control-radius,6px)}
.camera-guide{position:absolute;inset:25% 12% 31%;border:2px solid #ffffffb3;border-radius:24px;box-shadow:0 0 0 9999px #0002;pointer-events:none}
.camera-bottom{position:absolute;bottom:0;left:0;right:0;z-index:3;padding:32px max(20px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:linear-gradient(transparent,#11151cf0);text-align:center}
.camera-bottom .msg{color:white;max-width:40rem;margin:0 auto 16px;min-height:3em;overflow-wrap:anywhere}
.active-formats{position:absolute;bottom:calc(100% + 10px);left:-2px;right:-2px;z-index:1;font-size:.8rem;line-height:1.5;overflow-wrap:anywhere;background:#11151ccc;border:1px solid #ffffff44;border-radius:8px;padding:8px;margin:0;color:white}
.format-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.format-choice{display:flex;align-items:center;gap:8px;padding:10px;min-height:44px;border:1px solid var(--line);border-radius:8px;overflow-wrap:anywhere;font-size:.9rem}
.format-choice:has(input:checked){background:var(--bulma-link-soft, #4850ff18);border-color:#7b81ff}
.format-choice input{width:18px;height:18px;flex:none;accent-color:#4850ff}
.camera-bottom .buttons{justify-content:center;margin-bottom:0;gap:.5rem}
.camera-bottom .buttons{position:relative;min-height:52px;padding-inline:60px}
.camera-bottom .image-picker{position:absolute;left:0;bottom:0}
.camera-bottom .photo-picker{position:absolute;left:0;right:auto;bottom:64px}
.camera-bottom .camera-dropdown{position:absolute;right:0;bottom:0;width:52px;height:52px;color:white;background:#11151c99;border-radius:8px}
.camera-bottom .msg{padding-inline:60px}
.camera-bottom #start-camera,.camera-bottom #stop-camera{max-width:100%;white-space:normal;height:auto}
.language-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.language-buttons .button{flex:1;min-width:70px;min-height:44px}
.reader-history{background:var(--bg);color:var(--fg);display:flex;flex-direction:column}
.history-row{display:flex;align-items:center;gap:4px;margin-bottom:12px;border:1px solid var(--line);border-radius:12px;background:var(--card);padding-right:10px;min-width:0}
.history-entry{display:flex;flex:1;min-width:0;flex-direction:column;gap:8px;text-align:left;padding:16px;border:0;border-radius:12px;background:transparent;color:var(--fg);overflow-wrap:anywhere;cursor:pointer;font:inherit}
.history-row:focus-within,.history-row:hover{border-color:#4850ff}
.history-kind{align-self:flex-start;font-size:.75rem;font-weight:600;color:var(--bulma-link-text,#4850ff);background:var(--bulma-link-soft,#4850ff18);padding:3px 8px;border-radius:6px}
.history-delete{flex:none;min-height:44px;min-width:44px}
.history-meta{font-size:.8rem;opacity:.7}
.mobile-reader .camera-off svg{width:72px!important;height:72px!important;max-width:72px}
.camera-bottom .button{min-height:48px}
.camera-bottom input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.camera-bottom label:focus-within{outline:3px solid #aab0ff;outline-offset:3px}
.reader-result{background:var(--bg);color:var(--fg);display:flex;flex-direction:column}
.screen-title{display:flex;align-items:center;gap:10px;font-size:1.15rem;font-weight:700;margin:0 0 20px}
.screen-title svg{width:24px;height:24px;fill:currentColor;flex:none}
.result-content{overflow:auto;overscroll-behavior:contain;flex:1;min-height:0;width:100%;max-width:56rem;margin-inline:auto;padding:20px max(20px,env(safe-area-inset-right)) 24px max(20px,env(safe-area-inset-left))}
.result-content #result{height:7rem;min-height:0;max-height:25dvh;resize:none;overflow:auto;font-size:16px;overflow-wrap:anywhere}
.result-content pre,.result-content p{overflow-wrap:anywhere;white-space:pre-wrap}
.result-content .content-actions{padding:16px;border:1px solid var(--line);border-radius:12px;margin-top:16px}
.shopping-actions .button{width:100%;height:auto;min-height:48px;white-space:normal;gap:8px}
.shopping-actions .button>svg{width:22px;height:22px;flex:none;fill:currentColor}
.shopping-actions .help{margin-top:12px}
.shopping-actions .ad-label{font-size:.75rem;font-weight:400}
.result-bottom{flex:none;background:var(--card);border-top:1px solid var(--line);padding:12px max(20px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
.result-bottom .button{width:100%;max-width:40rem;margin:auto;display:flex;min-height:52px}
.reader-menu{color:var(--fg)}
.menu-backdrop{width:100%;height:100%;border:0;border-radius:0;background:#0009;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.reader-menu-content{position:relative;z-index:1;padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--card);width:min(92vw,30rem);max-height:85vh;max-height:85dvh;overflow:auto;overscroll-behavior:contain;min-width:0}.reader-menu-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:16px}
.reader-menu-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.reader-legal{display:flex;flex-wrap:wrap;gap:4px 12px;min-width:0;font-size:.75rem}
.reader-legal a{padding-block:8px}
.reader-menu-footer .footer-language{flex:none;margin:0}
/* Anchor to the button's right edge so mobile Toolkit styles cannot open it offscreen. */
.reader-menu-footer .footer-language.dropdown.is-up>.dropdown-menu{right:0;left:auto;width:12rem;min-width:0;max-width:calc(92vw - 48px)}
.reader-menu-footer .dropdown-content,.reader-menu-footer .dropdown-item{width:100%;min-width:0;box-sizing:border-box}
.reader-menu-footer summary svg{width:24px;height:24px;fill:currentColor}
.reader-version{font-size:.7rem;line-height:1.5;margin-top:12px;opacity:.65}
.reader-menu fieldset{min-width:0;border:0;padding:0;margin-top:20px}.reader-menu select{width:100%;min-height:44px}
.reader-menu .help{margin-top:16px}
.mobile-reader .toast{z-index:20;width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;white-space:normal}
.mobile-reader .toast.on{pointer-events:auto}
.mobile-reader .toast:not(.on){visibility:hidden}
.mobile-reader .toast .button{margin:0;min-height:40px;white-space:nowrap;flex:none}
.toast-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.toast-text{min-width:0;overflow-wrap:anywhere}
.toast-progress{position:absolute;inset:auto 0 0;height:3px;overflow:hidden;border-radius:0 0 6px 6px}
.toast-progress-bar{display:block;width:100%;height:100%;background:currentColor;transform-origin:left;animation:toast-countdown 3s linear forwards}
@keyframes toast-countdown{from{transform:scaleX(1)}to{transform:scaleX(0)}}
.history-tools{display:flex;justify-content:flex-end;margin:0 0 16px}
.history-tools .button{min-height:36px}
.result-bottom .button{gap:8px}
.result-content .content-actions .button{width:100%;min-height:48px;height:auto;white-space:normal;gap:8px}
.result-content .content-actions>a.button{display:flex;margin-top:16px}
.result-content .content-actions>p{margin-block:12px}
.result-content .content-actions .button svg{flex:none}
.result-content .content-actions .btns{display:flex;flex-direction:column;align-items:stretch;gap:12px}
.result-content .content-actions .btns>.button{margin:0}
.result-content .content-actions .help{margin-top:16px}
.result-content #wifi-password-wrap{margin-top:16px}
.result-content #wifi-password-wrap .label{margin-bottom:12px}
.result-content .password-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px}
.result-content .password-row input{width:100%;min-width:0;min-height:48px}
.result-content .password-row>.button{width:auto;min-width:5rem;margin:0;white-space:nowrap}
.result-content .ssid-row{display:grid;grid-template-columns:minmax(0,1fr) 48px;align-items:center;gap:12px;margin-block:12px}
.result-content .ssid-row input{width:100%;min-width:0;min-height:48px}
.result-content .ssid-row>.button{width:48px;height:48px;min-height:48px;padding:12px;margin:0}
.ssid-row svg{fill:currentColor}
.result-content #extra-detail{margin-bottom:16px;line-height:1.6}
.result-content #extra-copy-value{margin-top:16px;height:7rem;min-height:0;max-height:25dvh;resize:none}
.result-content #open-url{display:flex;width:100%;min-height:48px;height:auto;white-space:normal;margin-top:12px;gap:8px}
.menu-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:10px}
.menu-tools .button,.share-tool{min-height:48px;height:auto;white-space:normal;gap:8px}
.menu-tools .button{white-space:nowrap}
.menu-tools .button svg,.share-tool svg{width:22px;height:22px;flex:none;fill:currentColor}
.share-tool{margin-top:20px}
.reader-toolkit-link{font:inherit;margin:0;padding-block:8px}
.mobile-reader .input,.mobile-reader .textarea,.mobile-reader select{max-width:100%;min-width:0;box-sizing:border-box}
.mobile-reader button svg{width:22px;height:22px;display:block}
