#sourceLanguage{width:94px}.saved-word{width:100%;display:flex;justify-content:space-between;gap:8px;padding:11px 8px;border:0;border-bottom:1px solid #edf0ee;background:white;text-align:left;cursor:pointer;color:#52605a;font:10px 'DM Sans'}.saved-word strong{color:#25332e}.saved-word span{color:#0b8169;text-align:right}.reader-tools>.result-action{white-space:nowrap;padding:7px 9px}.translate-direction{gap:5px}.lang-chip{white-space:nowrap}
.selection-bubble{white-space:normal;overflow:visible;max-width:min(340px,calc(100vw - 28px));min-width:88px;justify-content:center;padding:9px 13px;line-height:1.45;text-align:center}.selection-bubble #bubbleTranslation{overflow-wrap:anywhere}
@media(max-width:1100px){.workspace{grid-template-columns:185px minmax(360px,1fr) 285px}}
@media(max-width:1000px){body{min-width:0;overflow:auto}.app-shell{min-width:880px}.workspace{grid-template-columns:175px minmax(390px,1fr) 270px}}

/* Chrome PDF-style reader chrome and left dictionary rail */
.workspace{grid-template-columns:310px minmax(0,1fr)}
.sidebar{display:none!important}
.dictionary-panel{grid-column:1;grid-row:1;border-left:0;border-right:1px solid #dadce0;width:auto;min-width:0}
.reader-area{grid-column:2;grid-row:1;min-width:0}
.dictionary-upload{margin:16px 16px 5px;width:calc(100% - 32px);flex:none}
.dictionary-panel .panel-heading{padding-top:15px}
.dictionary-saved{margin:0 16px 11px;width:calc(100% - 32px);flex:none}
.reader-area{background:#525659}
.topbar{background:#202124;color:#e8eaed;border-color:#3c4043}
.brand,.crumb-current{color:#e8eaed}
.crumb-muted,.crumb-slash{color:#aeb3b7}
.topbar .icon-button{background:#303134;color:#e8eaed;border-color:#5f6368}
.topbar .avatar{background:#3c4043;color:#d6e4df}
.topbar-actions{gap:13px}
.theme-control{display:flex;align-items:center;gap:6px;color:#bdc1c6;font-size:13px;border:1px solid #5f6368;border-radius:5px;padding:4px 7px}
.theme-control select{border:0;background:transparent;color:#e8eaed;font:10px 'DM Sans';outline:0;cursor:pointer}
.theme-control option{color:#202124;background:#fff}
.document-toolbar{background:#323639;color:#e8eaed;border-color:#202124}
.doc-title strong,.doc-title span,.reader-tools,.page-indicator b,.tool-button{color:#e8eaed}
.doc-title span{opacity:.7}
.tool-divider{background:#5f6368}
.reader-tools>.result-action{background:#414548;border-color:#5f6368;color:#e8eaed}
.reader-footer{background:#323639;color:#d3d7da;border-color:#202124}
.footer-hint{color:#aeb3b7}
.footer-hint kbd{background:#414548;border-color:#5f6368;color:#e8eaed}
.reader-scroll{background:var(--reader-canvas,#525659)}
.demo-document,.pdf-page{box-shadow:0 2px 10px #0003}
.panel-menu,.nav-count{color:var(--text-muted,#899096)}
.translate-direction,.empty-tip,.result-action{background:var(--panel,#fff);border-color:var(--border,#e9ebed);color:var(--text,#586166)}
.translate-direction select{color:var(--text,#586166)}
.translation-empty>strong,.result-word{color:var(--text-strong,#303438)}
.result-source,.privacy-note{color:var(--text-muted,#92999c)}
.saved-word{background:var(--panel,#fff);border-color:var(--border,#e9ebed);color:var(--text,#586166)}
.saved-word strong{color:var(--text-strong,#303438)}

html[data-theme="light"]{--panel:#fff;--reader-canvas:#525659;--border:#e9ebed;--text:#586166;--text-strong:#303438;--text-muted:#899096}
html[data-theme="dark"]{color-scheme:dark;--panel:#292a2d;--reader-canvas:#202124;--border:#3c4043;--text:#e8eaed;--text-strong:#f1f3f4;--text-muted:#aeb3b7}
html[data-theme="dark"] body,html[data-theme="dark"] .app-shell{background:#202124;color:#e8eaed}
html[data-theme="dark"] .dictionary-panel{background:#292a2d;border-color:#3c4043}
html[data-theme="dark"] .panel-heading h2,html[data-theme="dark"] .panel-heading .eyebrow{color:#e8eaed}
html[data-theme="dark"] .translate-direction,html[data-theme="dark"] .empty-tip,html[data-theme="dark"] .result-action,html[data-theme="dark"] .saved-word{background:#292a2d;border-color:#3c4043;color:#dfe1e5}
html[data-theme="dark"] #sourceLanguage,html[data-theme="dark"] .translate-direction select{color:#e8eaed}
html[data-theme="dark"] .empty-tip p,html[data-theme="dark"] .translation-empty>p,html[data-theme="dark"] .result-meta{color:#aeb3b7}
html[data-theme="dark"] .panel-bottom{border-color:#3c4043}
html[data-theme="dark"] .book{background:linear-gradient(135deg,#303b36,#263a32);border-color:#456354;box-shadow:7px 7px 0 #303b36}
html[data-theme="dark"] .book-shadow{background:#1c1d1f}
html[data-theme="dark"] .plan-card{background:#303134}
html[data-theme="dark"] .modal-backdrop{background:#0009}
html[data-theme="dark"] .help-modal{background:#292a2d;color:#e8eaed}
html[data-theme="dark"] .help-modal h2,html[data-theme="dark"] .step-row p{color:#e8eaed}
html[data-theme="dark"] .step-row{border-color:#3c4043}
html[data-theme="dark"] .modal-foot{color:#aeb3b7}
html[data-theme="dark"] .toast{background:#e8eaed;color:#202124}

@media(max-width:1100px){.workspace{grid-template-columns:285px minmax(0,1fr)}}
@media(max-width:1000px){body{min-width:0;overflow:auto}.app-shell{min-width:880px}.workspace{grid-template-columns:270px minmax(0,1fr)}}

.reader-mode{background:#414548;color:#e8eaed;border:1px solid #5f6368;border-radius:4px;padding:5px 7px;font:10px 'DM Sans';outline:0;cursor:pointer}
.reader-mode option{background:#fff;color:#202124}
.pdf-pages{width:100%;display:flex;flex-direction:column;align-items:center;gap:22px;padding-bottom:24px}
.pdf-pages[hidden]{display:none}
.pdf-page{margin:0;border-radius:2px;box-shadow:0 2px 12px #15171950,0 0 1px #0004;overflow:hidden}
.pdf-canvas{display:block;width:100%;height:auto;background:#fff}
.pdf-page[hidden]{display:none!important}
.text-layer{opacity:1}
.text-layer span{color:transparent}
.reader-scroll{scroll-behavior:smooth}
html[data-theme="dark"] .reader-scroll{--reader-canvas:#202124}
html[data-theme="light"] .reader-scroll{--reader-canvas:#525659}
@media(max-width:720px){.workspace{grid-template-columns:255px minmax(0,1fr)}.document-toolbar{padding:0 9px}.reader-tools{gap:4px}.reader-tools>.result-action{font-size:0}.reader-tools>.result-action:first-letter{font-size:12px}.reader-mode{max-width:80px}.reader-scroll{padding:20px 12px}}

/* Final reader layout: document center-left, dictionary details on the right */
.workspace{grid-template-columns:minmax(0,1fr) 350px!important;min-height:0}
.reader-area{grid-column:1!important;grid-row:1!important;min-height:0}
.dictionary-panel{grid-column:2!important;grid-row:1!important;border-left:1px solid #dadce0!important;border-right:0!important;min-height:0}
.reader-scroll{display:block!important;flex:1 1 auto;min-height:0;height:0;overflow-y:auto!important;overflow-x:auto!important;overscroll-behavior:contain;touch-action:pan-y;padding:28px 36px}
.page-wrap{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;max-width:900px;height:auto;min-height:100%;margin:0 auto;flex:0 0 auto}
.pdf-pages{flex:0 0 auto;min-height:max-content;padding:0 0 30px}
.pdf-page{flex:none;max-width:none;min-height:0}
.reader-scroll .demo-document{margin:0 auto 24px}
.dictionary-upload{margin-top:18px}
.panel-heading{padding-top:20px!important;padding-bottom:15px}
.panel-heading h2{font-size:22px!important}
.panel-heading .eyebrow{font-size:9px!important}
.dictionary-saved{font-size:12px}
.translate-direction{padding:12px 10px}
#sourceLanguage{font-size:11px;width:104px}
.lang-chip{font-size:11px}
.translation-empty>strong{font-size:14px}
.translation-empty>p{font-size:12px;max-width:260px}
.empty-tip{font-size:11px;padding:14px}
.empty-tip p{font-size:11px}
.result-word{font-size:27px!important}
.result-meta{font-size:11px}
.result-label{font-size:10px}
.result-meaning{font-size:22px}
.result-example{font-size:13px}
.result-action{font-size:11px}
.result-source,.privacy-note{font-size:10px}
.provider-label{font-size:11px}
.document-toolbar{height:72px;padding:0 22px}
.doc-title strong{font-size:14px}
.doc-title span{font-size:11px}
.reader-tools{font-size:12px;gap:10px}
.reader-tools>.tool-button{font-size:21px}
.reader-mode{font-size:11px;padding:7px 9px}
.page-indicator{font-size:12px}
.theme-control select{font-size:11px}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 310px!important}.reader-scroll{padding:24px 22px}}
@media(max-width:1000px){.workspace{grid-template-columns:minmax(0,1fr) 285px!important}.app-shell{min-width:880px}}
@media(max-width:720px){.workspace{grid-template-columns:minmax(0,1fr) 255px!important}.reader-scroll{padding:18px 12px}.document-toolbar{padding:0 9px}.reader-tools{gap:4px}}

.selection-bubble{display:block;position:fixed;z-index:60;transform:none;pointer-events:auto;width:min(370px,calc(100vw - 24px));min-width:min(300px,calc(100vw - 24px));max-width:calc(100vw - 24px);padding:0;overflow:visible;white-space:normal;text-align:left;background:#fff;color:#202124;border:1px solid #dadce0;border-radius:12px;box-shadow:0 8px 28px #20212433;line-height:1.45}
.selection-bubble[hidden]{display:none!important}
.popup-heading{display:flex;align-items:center;gap:10px;min-height:48px;padding:10px 13px;border-bottom:1px solid #e8eaed}
.popup-logo{width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:#e8f0fe;color:#4285f4;font-size:15px;font-weight:700;flex:none}
#popupSourceText{font-size:13px;color:#5f6368;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
#popupClose,.popup-footer button{width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#5f6368;font:20px Arial;cursor:pointer;flex:none}
#popupClose:hover,.popup-footer button:hover{background:#f1f3f4}
.popup-language-row{display:flex;align-items:center;gap:11px;padding:12px 17px 0;color:#5f6368;font-size:12px}
.popup-language-row span:last-child{color:#1a73e8;font-weight:600}
.popup-translation{padding:10px 17px 18px;color:#202124;font:400 22px/1.5 'DM Sans',sans-serif;overflow-wrap:anywhere;min-height:59px}
.popup-footer{border-top:1px solid #e8eaed;padding:7px 12px 7px 16px;display:flex;align-items:center;justify-content:space-between;color:#80868b;font:11px 'DM Sans',sans-serif}
.popup-footer>div{display:flex;gap:2px}
.popup-footer button{font-size:16px}
html[data-theme="dark"] .selection-bubble{background:#292a2d;color:#e8eaed;border-color:#5f6368;box-shadow:0 8px 28px #0008}
html[data-theme="dark"] .popup-heading,html[data-theme="dark"] .popup-footer{border-color:#44474a}
html[data-theme="dark"] #popupSourceText,html[data-theme="dark"] .popup-language-row{color:#bdc1c6}
html[data-theme="dark"] .popup-translation{color:#e8eaed}
html[data-theme="dark"] #popupClose,html[data-theme="dark"] .popup-footer button{color:#bdc1c6}
html[data-theme="dark"] #popupClose:hover,html[data-theme="dark"] .popup-footer button:hover{background:#3c4043}
.selection-bubble{width:min(280px,calc(100vw - 24px));min-width:min(250px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:min(230px,48vh);border-radius:9px}
.popup-heading{min-height:35px;padding:6px 9px;gap:7px}
.popup-logo{width:21px;height:21px;font-size:12px}
#popupSourceText{font-size:11px}
#popupClose,.popup-footer button{width:25px;height:25px}
.popup-language-row{padding:7px 11px 0;font-size:10px}
.popup-translation{padding:6px 11px 10px;font-size:16px;line-height:1.4;min-height:38px}
.popup-footer{padding:4px 8px 4px 11px;font-size:9px}
.popup-footer button{font-size:13px}

.workspace{grid-template-columns:minmax(0,1fr) 320px!important}
.panel-heading h2{font-size:19px!important}
.panel-heading .eyebrow{font-size:7px!important}
.dictionary-saved{font-size:10px}
.translate-direction{padding:10px 9px}
#sourceLanguage{font-size:9px;width:91px}
.lang-chip{font-size:9px}
.translation-empty>strong{font-size:12px}
.translation-empty>p{font-size:10px;max-width:235px}
.empty-tip{font-size:9px;padding:12px 13px}
.empty-tip p{font-size:9px}
.result-word{font-size:23px!important}
.result-meta{font-size:9px}
.result-label{font-size:8px}
.result-meaning{font-size:17px}
.result-example{font-size:11px}
.result-action{font-size:9px}
.result-source,.privacy-note{font-size:8px}
.provider-label{font-size:9px}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 285px!important}}
@media(max-width:1000px){.workspace{grid-template-columns:minmax(0,1fr) 270px!important}}
@media(max-width:720px){.workspace{grid-template-columns:minmax(0,1fr) 255px!important}}

/* Single unified PDF app toolbar */
.app-toolbar{height:72px;min-height:72px;flex:none;display:grid;grid-template-columns:minmax(245px,1fr) auto auto;align-items:center;gap:18px;padding:0 20px;background:#202124;border-bottom:1px solid #3c4043}
.toolbar-identity{min-width:0;display:flex;align-items:center;gap:13px}
.toolbar-separator{height:30px;width:1px;background:#4a4d50;flex:none}
.toolbar-document{min-width:0;max-width:250px}
.toolbar-document [hidden]{display:none!important}
.toolbar-document .pdf-badge{width:29px;height:31px;font-size:8px}
.toolbar-document div:last-child{min-width:0}
.toolbar-document strong{display:block;max-width:205px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.toolbar-document span{display:block;max-width:205px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
.toolbar-reader-tools{margin:0;gap:9px;white-space:nowrap}
.toolbar-actions{margin:0;gap:10px;white-space:nowrap}
.toolbar-open{height:40px;min-width:136px;padding:0 15px;border:1px solid #0b806c;border-radius:6px;background:#0b806c;color:#fff;font:600 11px 'DM Sans';cursor:pointer;box-shadow:0 2px 5px #0002}
.toolbar-open:hover{background:#0a705f}
.toolbar-open span{font-size:17px;vertical-align:-1px;margin-right:7px}
.topbar .reader-mode{padding:7px 8px}
.topbar .tool-button{width:25px;height:28px}
.topbar .page-indicator{min-width:48px;justify-content:center}
@media(max-width:1200px){.app-toolbar{grid-template-columns:minmax(210px,1fr) auto auto;gap:11px;padding:0 13px}.toolbar-identity{gap:9px}.toolbar-actions{gap:7px}.toolbar-reader-tools{gap:6px}.toolbar-document{max-width:205px}.toolbar-document strong,.toolbar-document span{max-width:165px}.toolbar-open{min-width:120px;padding:0 10px}}
@media(max-width:1050px){.toolbar-document span{display:none}.app-toolbar{grid-template-columns:minmax(185px,1fr) auto auto}.toolbar-document{max-width:180px}.toolbar-document strong{max-width:140px}.theme-control{padding:4px 5px}.theme-control select{max-width:80px}}
.app-toolbar{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:18px}
.toolbar-identity{grid-column:1;justify-self:start}
.toolbar-reader-tools{grid-column:2;justify-self:center;gap:12px;font-family:'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif;font-size:13px;font-weight:600;color:#e8eaed}
.toolbar-actions{grid-column:3;justify-self:end;gap:10px}
.brand{font-size:21px;letter-spacing:-.6px}
.toolbar-document strong{font:700 14px/1.35 'Manrope','DM Sans',sans-serif;letter-spacing:-.25px}
.toolbar-document span{font:500 11px/1.4 'DM Sans',sans-serif}
.reader-mode{height:38px;min-width:88px;padding:0 10px!important;border-radius:7px;font:600 12px 'Manrope','DM Sans',sans-serif!important;letter-spacing:.05px}
.page-control-group,.zoom-control-group{height:38px;display:flex;align-items:center;justify-content:center;gap:4px;padding:0 5px;border:1px solid #4b4f52;border-radius:8px;background:#292b2e}
.page-control-group .tool-button,.zoom-control-group .tool-button{width:32px;height:32px;border-radius:6px;font:600 19px/1 'Manrope','DM Sans',sans-serif}
.page-control-group .page-indicator{min-width:67px;justify-content:center;gap:6px;font:600 13px 'Manrope','DM Sans',sans-serif}
.page-control-group .page-indicator b{font-weight:700}
.zoom-control-group{gap:3px;padding:0 4px}
.zoom-control-group #zoomLabel{min-width:46px;text-align:center;font:600 12px 'Manrope','DM Sans',sans-serif}
.toolbar-reader-tools>.fullscreen-button{width:36px;height:36px;font-size:20px;border-radius:7px}
.toolbar-actions .theme-control{height:36px;padding:0 9px;gap:7px;border-radius:7px}
.toolbar-actions .theme-control select{font:500 11px 'DM Sans',sans-serif;max-width:105px}
.toolbar-actions .icon-button{width:30px;height:30px;font-size:14px}
.toolbar-actions .avatar{width:31px;height:31px;font-size:12px}
.toolbar-open{height:38px;min-width:136px;border-radius:7px;font:600 12px 'Manrope','DM Sans',sans-serif;letter-spacing:.05px}
@media(max-width:1200px){.app-toolbar{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;padding:0 13px}.toolbar-identity{gap:8px}.toolbar-reader-tools{gap:7px}.toolbar-actions{gap:7px}}
@media(max-width:1100px){.toolbar-document{max-width:165px}.toolbar-document strong{max-width:125px}.toolbar-reader-tools{gap:5px}.reader-mode{min-width:78px}.page-control-group,.zoom-control-group{gap:1px;padding:0 3px}.page-control-group .tool-button,.zoom-control-group .tool-button{width:27px}.page-control-group .page-indicator{min-width:48px;gap:4px}.zoom-control-group #zoomLabel{min-width:40px}.toolbar-actions .theme-control select{max-width:78px}.toolbar-actions .avatar{width:27px;height:27px}.toolbar-open{min-width:106px;padding:0 8px}.toolbar-open span{margin-right:3px}}

/* Chrome-style PDF thumbnails and outline rail */
.workspace{grid-template-columns:260px minmax(0,1fr) 320px!important}
.pdf-sidebar{grid-column:1!important;grid-row:1!important;display:grid;grid-template-columns:42px minmax(0,1fr);min-width:0;min-height:0;overflow:hidden;background:#292a2d;border-right:1px solid #3c4043}
.reader-area{grid-column:2!important;grid-row:1!important;min-width:0}
.dictionary-panel{grid-column:3!important;grid-row:1!important}
.pdf-side-rail{display:flex;flex-direction:column;align-items:center;gap:10px;padding:12px 5px;background:#202124;border-right:1px solid #3c4043}
.pdf-side-tab{width:31px;height:34px;display:grid;place-items:center;border:0;border-left:3px solid transparent;border-radius:0 5px 5px 0;background:transparent;color:#bdc1c6;font-size:17px;cursor:pointer}
.pdf-side-tab:hover{background:#303134;color:#e8eaed}
.pdf-side-tab.active{border-left-color:#8ab4f8;background:#303134;color:#8ab4f8}
.pdf-side-tab:disabled{opacity:.42;cursor:default}
.pdf-side-panel{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#292a2d;color:#e8eaed}
.pdf-side-panel-heading{height:44px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 13px;border-bottom:1px solid #3c4043;color:#e8eaed;font:500 12px 'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif}
.pdf-side-panel-heading span{color:#9aa0a6;font-size:11px}
.thumbnail-list,.outline-list{min-height:0;flex:1;overflow:auto;padding:12px 15px 18px;overscroll-behavior:contain}
.thumbnail-item{width:100%;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0 0 14px;padding:7px 8px 9px;border:0;border-radius:2px;background:transparent;color:#e8eaed;cursor:pointer}
.thumbnail-item:hover{background:#333538}
.thumbnail-item.active{background:#333538}
.thumbnail-canvas{display:block;width:104px;height:auto;background:#fff;box-shadow:0 1px 5px #0007;outline:2px solid transparent;outline-offset:2px}
.thumbnail-item.active .thumbnail-canvas{outline-color:#8ab4f8}
.thumbnail-page-number{font:500 12px/1.2 'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif;color:#e8eaed}
.sidebar-empty{padding:18px 8px;text-align:center;color:#9aa0a6;font:400 11px/1.6 'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif}
.outline-entry{width:100%;display:block;padding:8px 6px;border:0;border-bottom:1px solid #3c4043;background:transparent;color:#e8eaed;text-align:left;font:400 11px/1.45 'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif;cursor:pointer}
.outline-entry:hover{background:#35373a}
html[data-theme="light"] .pdf-side-panel,html[data-theme="light"] .pdf-side-rail{background:#292a2d}
.pdf-pages{gap:26px}
.pdf-page{background:#fff;border:1px solid #d7dce0;box-shadow:0 3px 12px #12141635,0 14px 28px #12141616}
.pdf-canvas{image-rendering:auto;backface-visibility:hidden}
html[data-theme="dark"] .pdf-page{border-color:#d7dce0}
@media(max-width:1200px){.workspace{grid-template-columns:235px minmax(0,1fr) 310px!important}}
@media(max-width:1100px){.workspace{grid-template-columns:220px minmax(0,1fr) 285px!important}}
@media(max-width:1000px){.workspace{grid-template-columns:42px minmax(0,1fr) 270px!important}.pdf-sidebar{grid-template-columns:42px 0}.pdf-side-panel{display:none}}

/* Vietnamese-first UI type system */
body,.app-shell{font-family:'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif!important;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
:where(.app-shell *){font-family:'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif!important}
.demo-document,.demo-document *{font-family:Georgia,'Times New Roman',serif!important}
.demo-document h2,.demo-document .demo-kicker,.demo-document .demo-note,.demo-document .demo-page-number{font-family:'OpenAI Sans','Segoe UI Variable','Segoe UI',system-ui,sans-serif!important}
.demo-document h2 em{font-family:Georgia,'Times New Roman',serif!important}
.selection-bubble{width:min(320px,calc(100vw - 24px));min-width:min(280px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:min(280px,55vh);overflow-y:auto;border-radius:10px;box-shadow:0 5px 20px #2021242b}
.popup-heading{min-height:40px;padding:8px 10px;gap:8px}
.popup-logo{width:23px;height:23px;font-size:13px}
#popupSourceText{font-size:12px}
#popupClose,.popup-footer button{width:27px;height:27px}
.popup-language-row{padding:9px 13px 0;font-size:11px}
.popup-translation{padding:8px 13px 13px;font-size:18px;line-height:1.45;min-height:48px}
.popup-footer{padding:5px 9px 5px 13px;font-size:10px}
.popup-footer button{font-size:14px}

/* Readability and spacing pass across the full app */
body{font-size:14px;line-height:1.5}
.brand{font-size:22px;font-weight:700;letter-spacing:-.4px}
.toolbar-document strong{font-size:15px;line-height:1.4;font-weight:700;letter-spacing:-.2px}
.toolbar-document span{font-size:12px;line-height:1.45;font-weight:500;color:#bdc1c6}
.toolbar-reader-tools{font-size:14px;font-weight:600}
.reader-mode{font-size:13px!important;font-weight:600!important}
.page-control-group .page-indicator{font-size:14px}
.zoom-control-group #zoomLabel{font-size:13px}
.toolbar-actions .theme-control select{font-size:12px}
.toolbar-open{font-size:13px;font-weight:700;letter-spacing:0}
.toolbar-actions .icon-button{font-size:15px}
.toolbar-actions .avatar{font-size:13px;font-weight:700}
.pdf-side-panel-heading{font-size:13px;font-weight:600}
.pdf-side-panel-heading span{font-size:12px}
.thumbnail-page-number{font-size:13px;font-weight:600}
.sidebar-empty{font-size:12px;line-height:1.65;color:#b8bdc2}
.outline-entry{font-size:12px;font-weight:500;line-height:1.55;padding-top:9px;padding-bottom:9px}
.panel-heading h2{font-size:21px!important;font-weight:700}
.panel-heading .eyebrow{font-size:10px!important;font-weight:600;letter-spacing:1px}
.dictionary-saved{font-size:11px;font-weight:600}
.translate-direction{padding:11px 10px}
.lang-chip,#sourceLanguage{font-size:11px}
.translation-empty>strong{font-size:14px;font-weight:700}
.translation-empty>p{font-size:12px;line-height:1.75}
.empty-tip{font-size:11px;font-weight:600;line-height:1.5}
.empty-tip p{font-size:11px;line-height:1.6}
.result-word{font-size:25px!important;font-weight:700}
.result-meta{font-size:11px;font-weight:500}
.result-label{font-size:10px;font-weight:700;letter-spacing:.75px}
.result-meaning{font-size:19px;font-weight:600;line-height:1.5}
.result-example{font-size:13px;line-height:1.7}
.result-actions .result-action{font-size:11px;font-weight:600;padding:8px 10px}
.result-source,.privacy-note{font-size:10px;line-height:1.55}
.provider-label{font-size:11px;font-weight:500}
.reader-footer{font-size:11px}
.footer-hint{font-size:10px}
.toast{font-size:12px;font-weight:500;padding:11px 16px}
.help-modal .eyebrow{font-size:9px;font-weight:700}
.help-modal h2{font-size:29px}
.step-row p{font-size:12px;line-height:1.55}
.step-row span{font-size:10px;font-weight:700}
.modal-foot{font-size:10px}
.selection-bubble{width:min(280px,calc(100vw - 24px));min-width:min(250px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
.popup-heading{min-height:36px;padding:6px 9px}
.popup-logo{width:21px;height:21px}
#popupSourceText{font-size:11px;font-weight:500}
.popup-language-row{font-size:10px}
.popup-translation{font-size:16px;line-height:1.45;min-height:40px}
.popup-footer{font-size:9px}
@media(max-width:1100px){.toolbar-document strong{font-size:14px}.toolbar-reader-tools{font-size:13px}}
.fit-control-group{height:38px;display:flex;align-items:center;justify-content:center;gap:2px;padding:0 4px;border:1px solid #4b4f52;border-radius:8px;background:#292b2e}
.fit-control-group .fit-button{width:32px;height:32px;border-radius:6px;display:grid;place-items:center;color:#e8eaed}
.fit-control-group .fit-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.fit-control-group .fit-button:hover{background:#414548}
.fit-control-group .fit-button.active{background:#3d4145;color:#a8c7fa}
html[data-theme="dark"] .fit-control-group{background:#292b2e;border-color:#55595d}
@media(max-width:1100px){.fit-control-group{gap:0;padding:0 2px}.fit-control-group .fit-button{width:27px}.fit-control-group .fit-button svg{width:16px;height:16px}}
@media(max-width:1100px){.toolbar-reader-tools{gap:4px}.toolbar-reader-tools>.fullscreen-button{width:28px;height:28px}.toolbar-actions .theme-control>span{display:none}.toolbar-open{min-width:96px}.reader-mode{min-width:74px}}
button,select{transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}
button:focus-visible,select:focus-visible{outline:2px solid #8ab4f8;outline-offset:2px}
.page-control-group,.zoom-control-group{border-color:#55595d;background:#292b2e}
.page-control-group .tool-button:hover,.zoom-control-group .tool-button:hover,.toolbar-reader-tools>.fullscreen-button:hover{background:#414548}
.reader-mode:hover,.theme-control:hover{border-color:#7a8086}
.toolbar-open{box-shadow:0 2px 5px #0003;transition:background-color .16s ease,transform .16s ease,box-shadow .16s ease}
.toolbar-open:hover{transform:translateY(-1px);box-shadow:0 4px 10px #0003}
.pdf-side-tab:focus-visible,.thumbnail-item:focus-visible{outline:2px solid #8ab4f8;outline-offset:-2px}
.thumbnail-item{transition:background-color .16s ease}
.thumbnail-item.active{box-shadow:inset 3px 0 #8ab4f8}
.thumbnail-canvas{box-shadow:0 2px 7px #0008}
.dictionary-panel{box-shadow:-2px 0 8px #00000008}
.translate-direction{border-radius:8px}
.target-language-chip #targetLanguage{width:96px;max-width:96px;font-size:11px}
@media(max-width:1100px){.target-language-chip #targetLanguage{width:84px;max-width:84px}}
.text-layer span{display:inline-block;white-space:pre;transform-origin:0 0}
.language-control{position:relative;box-sizing:border-box;width:62px;min-width:62px;justify-content:center;gap:6px;padding:0 6px;overflow:hidden}
.toolbar-actions .language-control select{position:absolute;inset:0;width:100%;height:100%;max-width:none!important;opacity:0;cursor:pointer}
@media(min-width:1201px){.app-toolbar{grid-template-columns:minmax(190px,1fr) auto auto;gap:12px}.toolbar-reader-tools{justify-self:end}}
.toolbar-url-button{width:34px;height:34px;flex:none;border:1px solid #5f6368;border-radius:7px;background:#292b2e;color:#dce1e4;font:600 17px 'Manrope','DM Sans',sans-serif;cursor:pointer}
.toolbar-url-button:hover{background:#3b3e42;border-color:#85898d}
@media(max-width:1200px){.app-toolbar{grid-template-columns:minmax(140px,1fr) auto auto;gap:8px}.toolbar-reader-tools{justify-self:end}.toolbar-url-button{width:30px;height:30px}}
.url-help{margin:9px 0 0;color:#848e89;font:400 10px/1.6 'DM Sans',sans-serif}
.result-actions{gap:8px}
.result-action{border-radius:7px}
.panel-bottom{padding-top:15px;padding-bottom:18px}
.empty-tip{border-radius:8px}
.help-modal{border-radius:14px}
.step-row{padding:13px 0}
html[data-theme="light"] body{background:#f4f6f8}
html[data-theme="light"] .dictionary-panel{background:#fff}
html[data-theme="light"] .result-action:hover{background:#f5f8f7}
html[data-theme="dark"] .page-control-group,html[data-theme="dark"] .zoom-control-group{background:#292b2e;border-color:#55595d}
html[data-theme="dark"] .panel-menu{color:#c3c7cb}
.icon{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.toolbar-actions .theme-control>.icon{width:15px;height:15px}
.toolbar-actions .icon-button{display:grid;place-items:center}
.toolbar-actions .icon-button .icon{width:16px;height:16px}
.toolbar-open .upload-plus{display:inline-flex;vertical-align:middle;margin-right:7px}
.toolbar-open .upload-plus .icon,.upload-button .upload-plus .icon{width:16px;height:16px}
.pdf-side-tab .icon{width:17px;height:17px}
.nav-icon{display:inline-flex;align-items:center;justify-content:center}
.nav-icon .icon{width:16px;height:16px}
.tool-button .icon{width:17px;height:17px;margin:auto}
.plan-spark .icon{width:19px;height:19px}
.plan-card button span .icon,.empty-state .primary-button .icon,.modalUpload .icon{display:inline-block;width:13px;height:13px;vertical-align:middle}
.empty-icon .icon{width:23px;height:23px}
.empty-foot .empty-spark{display:inline-flex;vertical-align:middle}
.empty-foot .icon{width:12px;height:12px}
.popup-logo .icon{width:14px;height:14px}
#popupClose .icon,.popup-footer button .icon{width:15px;height:15px;margin:auto}
.popup-heading #popupClose{display:grid;place-items:center}
.popup-footer button{display:grid;place-items:center}
.panel-menu{display:grid;place-items:center}
.panel-menu .icon{width:18px;height:18px}
#providerInfo .icon{width:14px;height:14px}
.modal-close{display:grid;place-items:center}
.modal-close .icon{width:17px;height:17px}
.primary-button>span .icon{display:inline-block;width:14px;height:14px;vertical-align:middle}
.result-action .icon{display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:-3px}
.empty-tip>span{display:inline-flex;vertical-align:middle}
.app-toolbar{position:relative}
.toolbar-reader-tools{position:absolute;left:calc(50% - 30px);top:50%;transform:translate(-50%,-50%);justify-self:auto;grid-column:auto}
@media(max-width:1200px){.toolbar-reader-tools{left:calc(50% - 37.5px)}}
@media(max-width:1100px){.toolbar-reader-tools{left:calc(50% - 32.5px)}}
@media(max-width:1000px){.toolbar-reader-tools{left:calc(50% - 114px)}}
/* Language controls use the app icon set and the popup destination is editable. */
.translate-direction .language-symbol{width:14px;height:14px;flex:none;color:#0b8169}
.lang-chip{display:inline-flex;align-items:center;gap:5px}
.popup-language-row{gap:8px}
.popup-direction-arrow{color:#687078}
.popup-target-language{display:inline-flex;align-items:center;gap:4px;color:#1a73e8;min-width:0}
.popup-target-language>.icon{width:13px;height:13px;flex:none}
.popup-target-language select{max-width:120px;border:0;background:transparent;color:#1a73e8;font:600 11px 'DM Sans','Segoe UI',sans-serif;cursor:pointer;outline:none}
html[data-theme="dark"] .popup-target-language select{color:#8ab4f8}
html[data-theme="dark"] .popup-target-language option{background:#292a2d;color:#e8eaed}

/* PDF reader layout: thumbnail navigation and reader occupy the workspace. */
.sidebar,.dictionary-panel{display:none!important}
.workspace{grid-template-columns:260px minmax(0,1fr)!important}
.pdf-sidebar{grid-column:1!important;grid-row:1!important}
.reader-area{grid-column:2!important;grid-row:1!important;min-width:0}
@media(max-width:1200px){.workspace{grid-template-columns:235px minmax(0,1fr)!important}}
@media(max-width:1100px){.workspace{grid-template-columns:220px minmax(0,1fr)!important}}
@media(max-width:1000px){.workspace{grid-template-columns:42px minmax(0,1fr)!important}.pdf-sidebar{grid-template-columns:42px 0}.pdf-side-panel{display:none}}

/* Keep the PDF controls centered over the reader after removing the dictionary. */
.toolbar-reader-tools{left:calc(50% + 130px)}
@media(max-width:1200px){.toolbar-reader-tools{left:calc(50% + 117.5px)}}
@media(max-width:1100px){.toolbar-reader-tools{left:calc(50% + 110px)}}
@media(max-width:1000px){.toolbar-reader-tools{left:calc(50% + 21px)}}



/* Welcome screen explains the PDF-to-translation workflow without built-in translation. */
#emptyState.empty-state{width:min(100%,780px);max-width:780px;margin:auto;padding:clamp(28px,5vh,58px) clamp(22px,4vw,48px);color:#e8eaed;background:linear-gradient(145deg,#292a2d,#222326);border:1px solid #3c4043;border-radius:20px;box-shadow:0 18px 50px #0003}
#emptyState .empty-icon{width:52px;height:52px;margin-bottom:20px;background:#123f38;color:#56c5a7;border:1px solid #24695b}
#emptyState .eyebrow{color:#8ab4a8;font-size:10px;letter-spacing:1.4px}
#emptyState h1{font-size:clamp(32px,4vw,43px);line-height:1.16;letter-spacing:-1.8px;margin:14px 0 12px;color:#f1f3f4}
#emptyState h1 em{color:#67d2b0}
#emptyState>p{max-width:480px;margin:0 auto 25px;color:#bdc1c6;font-size:14px;line-height:1.65}
.translator-picker{margin:0 auto 20px;max-width:600px;text-align:left}
.translator-label{display:block;margin:0 0 9px 2px;color:#9aa0a6;font-size:9px;font-weight:700;letter-spacing:1.15px}
.translator-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.translator-link{min-width:0;min-height:54px;display:flex;align-items:center;gap:9px;padding:0 11px;border:1px solid #45474b;border-radius:10px;background:#303134;color:#e8eaed;text-decoration:none;text-align:left;font-size:12px;font-weight:600;transition:background .15s,border-color .15s,transform .15s}
.translator-link:hover{background:#383a3d;border-color:#6b7075;transform:translateY(-1px)}
.translator-link>span:nth-child(2){min-width:0;flex:1}
.translator-link>.icon{width:13px;height:13px;color:#9aa0a6;flex:none}
.translator-mark{width:25px;height:25px;display:grid;place-items:center;flex:none;border-radius:7px;background:#3b3c3f;font-size:13px;font-weight:800}
.google-mark{color:#8ab4f8}.deepl-mark{color:#8ab4f8}.bing-mark{color:#75d7b6}
#emptyUpload{min-width:190px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:0 18px;font-size:13px;border-radius:9px;box-shadow:0 5px 18px #087d6644}
#emptyUpload>.icon{width:16px;height:16px}
#emptyUpload .upload-label{margin:0}
#emptyState .empty-foot{margin-top:19px;color:#9aa0a6;font-size:11px}
#emptyState .empty-spark{color:#67d2b0}
@media(max-width:1000px){#emptyState.empty-state{padding:28px 20px}.translator-links{gap:6px}.translator-link{gap:6px;padding:0 7px;font-size:10px}.translator-mark{width:22px;height:22px}}
.workflow-panel{max-width:600px;margin:0 auto 16px;text-align:left}
.workflow-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.workflow-step{min-width:0;min-height:57px;display:flex;align-items:center;gap:10px;padding:0 13px;border:1px solid #45474b;border-radius:10px;background:#303134;color:#e8eaed;text-align:left;font-size:12px;font-weight:600}
.workflow-step .step-number{width:27px;height:27px;display:grid;place-items:center;flex:none;border-radius:8px;background:#123f38;color:#67d2b0;font-size:10px;font-weight:800}
.extension-install{width:min(100%,420px);min-height:45px;display:flex;align-items:center;justify-content:center;gap:10px;margin:0 auto 13px;padding:0 15px;border:1px solid #236b5c;border-radius:9px;background:#123f38;color:#b5f0df;text-decoration:none;font-size:12px;font-weight:700;transition:background .15s,border-color .15s}
.extension-install:hover{background:#165246;border-color:#39a287}
.extension-install>.icon{width:16px;height:16px;flex:none}
.extension-install .install-external{width:13px;height:13px;margin-left:auto;color:#83ceb9}
.other-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:0 auto 19px;color:#969da3;font-size:10px}
.other-tools a{padding:5px 9px;border:1px solid #44464a;border-radius:999px;color:#d3d7db;text-decoration:none;font-weight:600}
.other-tools a:hover{border-color:#73777c;background:#383a3d}
#emptyState .empty-foot{margin-top:16px}
@media(max-width:1000px){.workflow-steps{gap:5px}.workflow-step{gap:6px;padding:0 7px;font-size:10px}.workflow-step .step-number{width:23px;height:23px}.other-tools{gap:5px;font-size:9px}}
.benefit-slide{width:min(100%,600px);min-height:112px;display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,.9fr);align-items:center;gap:18px;margin:0 auto 14px;padding:13px 16px;border:1px solid #3c5550;border-radius:12px;background:linear-gradient(110deg,#252c2b,#24272a);text-align:left;overflow:hidden}
.benefit-copy{min-width:0}
.benefit-label{display:block;margin-bottom:5px;color:#67d2b0;font-size:8px;font-weight:800;letter-spacing:1.1px}
.benefit-copy>strong{display:block;color:#edf2f0;font-size:13px;line-height:1.3;font-weight:700}
.benefit-copy>p{margin:5px 0 0;color:#aeb8b4;font-size:10px;line-height:1.45}
.benefit-demo{position:relative;min-height:84px;display:flex;align-items:center;justify-content:center;padding:8px;border:1px solid #414448;border-radius:9px;background:#202124;overflow:hidden}
.mini-pdf-lines{width:72%;display:grid;gap:6px;padding:4px 6px}
.mini-pdf-lines i{height:4px;border-radius:3px;background:#5e6265;opacity:.68}
.mini-pdf-lines i:nth-child(1){width:86%}.mini-pdf-lines i:nth-child(2){width:98%}.mini-pdf-lines i:nth-child(3){width:89%}.mini-pdf-lines i:nth-child(4){width:82%}.mini-pdf-lines i:nth-child(5){width:65%}
.mini-pdf-lines .mini-selected{height:8px;background:#176c59;outline:1px solid #47b697;opacity:1}
.mini-translation{position:absolute;right:8px;top:8px;width:60%;padding:7px 9px;border:1px solid #5a6065;border-radius:7px;background:#303134;box-shadow:0 5px 18px #0007}
.mini-translation-head{display:flex;align-items:center;gap:5px;color:#e8eaed;font-size:8px}
.mini-translation-head>span{width:14px;height:14px;display:grid;place-items:center;border-radius:50%;background:#8ab4f8;color:#202124;font-size:9px;font-weight:800}
.mini-translation-head small{margin-left:auto;color:#aeb4b9;font-size:7px}.mini-translation-head small i{font-style:normal;padding:0 3px}
.mini-translation>p{margin:7px 0 0;color:#e8eaed;font-size:9px;line-height:1.3}
@media(max-width:1000px){.benefit-slide{grid-template-columns:1fr minmax(185px,.8fr);gap:9px;padding:10px}.benefit-demo{min-height:76px}.mini-translation{width:67%}}
@media(max-height:780px){.benefit-slide{min-height:98px;margin-bottom:10px;padding-top:9px;padding-bottom:9px}.benefit-demo{min-height:72px}}

/* Make the benefit callout prominent and show the user-provided real popup screenshot. */
section.benefit-slide{width:min(100%,740px);min-height:0;grid-template-columns:minmax(220px,.78fr) minmax(0,1.22fr);gap:22px;margin:0 auto 16px;padding:20px 22px;border:1px solid #3a6d60;border-radius:15px;background:linear-gradient(120deg,#173a33 0%,#252b2c 64%,#292a2d 100%);box-shadow:0 10px 28px #0003}
section.benefit-slide .benefit-label{width:max-content;margin:0 0 12px;padding:6px 10px;border:1px solid #367c69;border-radius:999px;background:#123f38;color:#8de2c7;font-size:12px;letter-spacing:1.4px;line-height:1.1}
section.benefit-slide .benefit-copy>h2{color:#f1f3f4;font-size:19px;line-height:1.3;letter-spacing:-.35px}
section.benefit-slide .benefit-copy>p{margin-top:9px;color:#c1cbc7;font-size:12px;line-height:1.55}
section.benefit-slide .benefit-image{min-width:0;margin:0;overflow:hidden;border:1px solid #68716f;border-radius:10px;background:#fff;box-shadow:0 8px 24px #0005;aspect-ratio:16/9}
section.benefit-slide .benefit-image img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
@media(max-width:1000px){section.benefit-slide{grid-template-columns:minmax(190px,.78fr) minmax(0,1.22fr);gap:12px;padding:14px}.benefit-copy>h2{font-size:16px!important}.benefit-copy>p{font-size:10px!important}}
@media(max-height:780px){section.benefit-slide{margin-bottom:10px;padding-top:13px;padding-bottom:13px}}

/* Keep the headline on one line and make PDF upload the unmistakable primary action. */
#emptyState.empty-state{padding-top:clamp(28px,4vh,44px);padding-bottom:32px}
#emptyState h1{white-space:nowrap;font-size:clamp(27px,3.4vw,39px);letter-spacing:-1.8px;margin:0 auto 20px}
#emptyState .upload-hero{width:min(100%,390px);min-height:60px;margin:0 auto 22px;padding:0 24px;border:1px solid #38c9a5;border-radius:12px;background:linear-gradient(135deg,#0da888,#087d66);color:#fff;font-size:16px;font-weight:800;letter-spacing:.1px;box-shadow:0 8px 26px #079b784d, inset 0 1px #ffffff35;transition:transform .16s,box-shadow .16s,filter .16s}
#emptyState .upload-hero:hover{transform:translateY(-2px);filter:brightness(1.12);box-shadow:0 12px 30px #079b7866, inset 0 1px #ffffff45}
#emptyState .upload-hero:focus-visible{outline:3px solid #8de2c7;outline-offset:4px}
#emptyState .upload-hero>.icon{width:20px;height:20px}
#emptyState .upload-hero .upload-label{margin:0}
@media(max-width:1000px){#emptyState h1{font-size:clamp(25px,3.2vw,33px);letter-spacing:-1.25px}#emptyState .upload-hero{min-height:56px;font-size:15px}}



/* Responsive layout for mobile-first crawling and phone-sized screens. */
@media(max-width:720px){
  body{min-width:0;overflow:hidden}
  .app-shell{min-width:0;width:100%}
  .app-toolbar{height:108px;min-height:108px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:52px 48px;gap:0;padding:4px 10px}
  .toolbar-identity{grid-column:1;grid-row:1;min-width:0;gap:7px}
  .toolbar-identity .toolbar-separator,.toolbar-document{display:none}
  .toolbar-identity .brand{gap:7px;font-size:17px}
  .toolbar-identity .brand-mark{width:28px;height:28px}
  .toolbar-actions{grid-column:2;grid-row:1;margin:0;gap:6px;min-width:0}
  .toolbar-actions .language-control{width:44px;min-width:44px;height:34px}
  .toolbar-actions .icon-button{width:30px;height:30px}
  .toolbar-actions .toolbar-open{width:36px;min-width:36px;height:36px;padding:0;justify-content:center;font-size:0}
  .toolbar-actions .toolbar-open .upload-plus{display:inline-flex;margin:0;font-size:16px}
  .toolbar-reader-tools{position:static;grid-column:1/-1;grid-row:2;left:auto;top:auto;transform:none;justify-self:stretch;width:100%;min-width:0;display:flex;justify-content:flex-start;gap:6px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:0 0 3px}
  .toolbar-reader-tools>*{flex:none}
  .reader-mode{min-width:82px;height:32px}
  .page-control-group,.zoom-control-group,.fit-control-group{height:32px}
  .page-control-group .tool-button,.zoom-control-group .tool-button,.fit-control-group .tool-button{width:30px;height:30px}
  .page-control-group .page-indicator{min-width:52px}
  .zoom-control-group #zoomLabel{min-width:42px}
  .toolbar-reader-tools>.fullscreen-button{width:30px;height:30px}
  .workspace{grid-template-columns:minmax(0,1fr)!important}
  .pdf-sidebar{display:none!important}
  .reader-area{grid-column:1!important;grid-row:1!important;min-width:0}
  .reader-scroll{padding:12px 10px}
  .page-wrap{width:100%;min-width:0}
  .reader-footer{height:28px;padding:0 10px;font-size:9px}
  .reader-footer .footer-hint{display:none}
  #emptyState.empty-state{width:100%;max-width:560px;padding:22px 14px;margin:auto;border-radius:14px}
  #emptyState h1{white-space:nowrap;font-size:clamp(21px,6.2vw,28px);letter-spacing:-1.1px;margin-bottom:15px}
  #emptyState .upload-hero{width:min(100%,360px);min-height:56px;margin-bottom:16px;font-size:15px}
  .workflow-panel{margin-bottom:12px}
  .workflow-steps{gap:5px}
  .workflow-step{min-height:49px;gap:5px;padding:0 6px;font-size:9px}
  .workflow-step .step-number{width:20px;height:20px;font-size:8px}
  section.benefit-slide{width:100%;grid-template-columns:minmax(0,1fr);gap:10px;padding:13px;margin-bottom:12px}
  section.benefit-slide .benefit-label{margin-bottom:7px;font-size:10px}
  section.benefit-slide .benefit-copy>h2{font-size:16px!important}
  section.benefit-slide .benefit-copy>p{font-size:10px!important}
  section.benefit-slide .benefit-image{aspect-ratio:16/9}
  .extension-install{margin-bottom:10px}
  .other-tools{gap:5px;font-size:9px}
  .other-tools a{padding:4px 7px}
  #emptyState .empty-foot{font-size:9px}
}

/* Let the compact desktop layout use the available viewport instead of forcing a horizontal page scroll. */
@media (min-width:721px) and (max-width:1000px){
  body{min-width:0!important;overflow:hidden!important}
  .app-shell{min-width:0!important;width:100%!important}
  .workspace{min-width:0!important}
  .toolbar-document{max-width:126px}
  .toolbar-document strong{max-width:92px}
  .toolbar-reader-tools{gap:4px}
  .toolbar-actions{gap:5px}
  .toolbar-actions .theme-control{padding:0 6px}
  .toolbar-actions .theme-control select{max-width:62px}
  .toolbar-open{min-width:40px!important;width:40px;padding:0!important;font-size:0}
  .toolbar-open .upload-plus{display:inline-flex;margin:0;font-size:16px}
}

/* Interaction polish and an explicit loading state for the reader. */
:where(button, select, a):focus-visible{outline:2px solid #8ab4f8;outline-offset:3px}
:where(button, select):disabled{cursor:not-allowed;opacity:.44}
.toolbar-open.is-loading,.upload-hero.is-loading{position:relative;color:transparent!important;pointer-events:none}
.toolbar-open.is-loading::after,.upload-hero.is-loading::after{content:'';position:absolute;inset:0;margin:auto;width:15px;height:15px;border:2px solid #ffffff77;border-top-color:#fff;border-radius:50%;animation:clickread-spin .7s linear infinite}
@keyframes clickread-spin{to{transform:rotate(360deg)}}
.reader-scroll[aria-busy="true"]{cursor:progress}
.reader-scroll[aria-busy="true"] .pdf-pages{opacity:.62;transition:opacity .16s ease}
.text-layer span{color:transparent!important;-webkit-text-fill-color:transparent;user-select:text;-webkit-user-select:text}
.text-layer ::selection{background:#8ab4f899!important;color:transparent!important;-webkit-text-fill-color:transparent!important}

/* Phone layout: spacious welcome screen and thumb-friendly reader controls. */
@media (max-width:720px) {
  .app-shell{height:100vh;height:100dvh;position:relative}
  .app-toolbar{position:static;height:auto;min-height:64px;grid-template-rows:56px;padding:4px 12px;padding-top:max(4px,env(safe-area-inset-top));gap:0;background:#202725}
  .toolbar-identity .brand{font-size:16px;letter-spacing:-.5px}
  .toolbar-actions{gap:4px}
  .toolbar-actions .language-control,.toolbar-actions .icon-button,.toolbar-actions .toolbar-open{min-width:44px;width:44px;height:44px;border-radius:12px}
  .toolbar-actions .toolbar-open{background:#087d66;border:1px solid #38a58b}
  .toolbar-reader-tools{display:none}
  .reader-scroll{padding:16px 12px;touch-action:pan-x pan-y pinch-zoom}
  #emptyState.empty-state{padding:24px 8px 28px;background:transparent;border:0;box-shadow:none}
  #emptyState h1{white-space:normal;font-size:clamp(30px,8.5vw,40px);line-height:1.15;letter-spacing:-1.4px;margin-bottom:16px;text-wrap:balance}
  #emptyState>p{font-size:14px;line-height:1.7;max-width:340px;margin-bottom:24px;color:#bcc7c2}
  #emptyState .upload-hero{width:100%;min-height:58px;border-radius:16px;margin-bottom:28px;font-size:16px}
  section.benefit-slide{padding:18px;border-radius:18px;gap:16px;margin-bottom:24px;box-shadow:none}
  section.benefit-slide .benefit-copy>h2{font-size:20px!important;margin:8px 0}
  section.benefit-slide .benefit-copy>p{font-size:13px!important;line-height:1.65}
  section.benefit-slide .benefit-label{font-size:10px;letter-spacing:1px}
  .workflow-panel{text-align:left;margin-bottom:20px}
  .translator-label{font-size:10px;letter-spacing:1.2px;margin-bottom:12px}
  .workflow-steps{grid-template-columns:1fr;gap:8px}
  .workflow-step{min-height:56px;gap:14px;padding:10px 14px;font-size:14px;border-radius:12px;background:#292f2d;border-color:#3c4842}
  .workflow-step .step-number{width:32px;height:32px;border-radius:10px;font-size:11px}
  .extension-install{display:none}
  .other-tools{gap:8px;font-size:12px;margin-bottom:24px}
  .other-tools>span{width:100%;margin-bottom:4px}
  .other-tools a{min-height:44px;display:inline-flex;align-items:center;padding:10px 14px;border-radius:12px}
  #emptyState .empty-foot{font-size:11px;line-height:1.8;text-wrap:balance}
  .reader-footer{height:auto;min-height:32px;padding:8px 12px;padding-bottom:max(8px,env(safe-area-inset-bottom));font-size:11px}
  .help-modal{width:calc(100% - 24px);max-width:400px;max-height:calc(100dvh - 32px);overflow:auto;padding:28px 24px;border-radius:20px}
  .modal-close{width:44px;height:44px;right:4px;top:4px}
  .step-row p{font-size:14px;line-height:1.6}
  .help-modal .primary-button{min-height:48px;font-size:14px}
  .modal-foot{font-size:11px;line-height:1.6}
  .toast{width:max-content;max-width:calc(100% - 32px);font-size:13px;bottom:calc(132px + env(safe-area-inset-bottom));text-align:center}

  .app-shell:has(#pdfPages:not([hidden])){padding-bottom:calc(112px + env(safe-area-inset-bottom))}
  .app-shell:has(#pdfPages:not([hidden])) .toolbar-reader-tools{display:flex;position:absolute;z-index:10;left:0;right:0;bottom:0;top:auto;transform:none;flex-wrap:wrap;align-content:center;justify-content:center;gap:6px 8px;height:calc(112px + env(safe-area-inset-bottom));padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:#252c29;border-top:1px solid #435149;box-shadow:0 -8px 24px #0002;overflow:visible}
  .toolbar-reader-tools .reader-mode{height:44px;max-width:140px;min-width:110px;font-size:12px;border-radius:10px}
  .toolbar-reader-tools .page-control-group,.toolbar-reader-tools .zoom-control-group,.toolbar-reader-tools .fit-control-group{height:44px;border-radius:10px}
  .toolbar-reader-tools .tool-button,.toolbar-reader-tools>.fullscreen-button{width:44px;height:44px;min-width:44px}
  .toolbar-reader-tools .page-indicator{font-size:13px;min-width:56px}
  .toolbar-reader-tools #zoomLabel{font-size:12px}
  .app-shell:has(#pdfPages:not([hidden])) .reader-scroll{padding:12px 8px}
  .app-shell:has(#pdfPages:not([hidden])) .reader-footer{padding-bottom:8px}
  .pdf-pages{align-items:flex-start;width:max-content;min-width:100%}
  .pdf-page{align-self:center}
}
@media (prefers-reduced-motion:reduce){
  .reader-scroll{scroll-behavior:auto}
  #emptyState .upload-hero,.toast{transition:none}
}

/* The mobile dock is anchored to the app shell, not the header. */
@media (max-width:720px){
  html,body{height:100%;overflow:hidden;overscroll-behavior:none}
  .app-shell{overflow:hidden}
  .app-toolbar{background:#202124;border-bottom:1px solid #ffffff12}
  .app-shell:has(#pdfPages:not([hidden])) .toolbar-reader-tools{
    display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:44px 44px;
    background:#262729;border-color:#ffffff18;box-shadow:0 -4px 20px #0002;
  }
  .toolbar-reader-tools .page-control-group{grid-column:1/3;grid-row:1;justify-self:start;border:0;background:transparent;padding:0;gap:4px}
  .toolbar-reader-tools .reader-mode{grid-column:3;grid-row:1;justify-self:end;width:100%;min-width:0;max-width:150px;background:#323438;border:0;font-size:12px;padding:0 8px}
  .toolbar-reader-tools .zoom-control-group{grid-column:1;grid-row:2;justify-self:start;border:0;padding:0;background:transparent}
  .toolbar-reader-tools .fit-control-group{grid-column:2;grid-row:2;border:0;padding:0;background:transparent}
  .toolbar-reader-tools>.fullscreen-button{grid-column:3;grid-row:2;justify-self:end}
  .toolbar-reader-tools .tool-button{border-radius:12px}
  .app-shell:has(#pdfPages:not([hidden])) .reader-footer{display:none}
  .app-shell:has(#pdfPages:not([hidden])) .reader-scroll{background:#18191b;padding:12px 6px}
  .pdf-pages{gap:12px;padding-bottom:12px}
  .pdf-page{border-radius:3px;box-shadow:0 2px 8px #0003}
  .toolbar-actions .icon-button{background:transparent;border:0}
}

.mobile-more{display:none}
@media(max-width:720px){
  .app-shell:has(#pdfPages:not([hidden])){padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  .app-shell:has(#pdfPages:not([hidden])) .toolbar-reader-tools{
    height:calc(64px + env(safe-area-inset-bottom));
    grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:44px;
    gap:8px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));
    background:#242527;border-top:1px solid #ffffff10;box-shadow:none;
  }
  .toolbar-reader-tools .page-control-group{grid-column:1;grid-row:1;justify-self:start;gap:4px}
  .toolbar-reader-tools .page-indicator{min-width:72px;font-variant-numeric:tabular-nums}
  .toolbar-reader-tools .fit-control-group{grid-column:2;grid-row:1;gap:0}
  .toolbar-reader-tools .fit-control-group #rotatePage,
  .toolbar-reader-tools .zoom-control-group,
  .toolbar-reader-tools .reader-mode,
  .toolbar-reader-tools>.fullscreen-button{display:none}
  .toolbar-reader-tools .fit-button.active{background:transparent;color:#c9d4d0}
  .toolbar-reader-tools .mobile-more{display:grid;place-items:center;grid-column:3;grid-row:1;background:#343638;color:#e8eaed;font-size:16px;letter-spacing:2px;border-radius:14px}
  .mobile-more[aria-expanded="true"]{outline:1px solid #6d9587}
  .app-shell.mobile-tools-expanded:has(#pdfPages:not([hidden])) .toolbar-reader-tools{
    height:calc(176px + env(safe-area-inset-bottom));grid-template-rows:44px 44px 44px;
    border-radius:20px 20px 0 0;box-shadow:0 -12px 30px #0004;
  }
  .mobile-tools-expanded .toolbar-reader-tools .zoom-control-group{display:flex;grid-column:1;grid-row:2}
  .mobile-tools-expanded .toolbar-reader-tools .fit-control-group{grid-row:1}
  .mobile-tools-expanded .toolbar-reader-tools .fit-control-group #rotatePage{display:block;position:absolute;right:68px;top:62px}
  .mobile-tools-expanded .toolbar-reader-tools>.fullscreen-button{display:block;grid-column:3;grid-row:2}
  .mobile-tools-expanded .toolbar-reader-tools .reader-mode{display:block;grid-column:1/-1;grid-row:3;max-width:none;width:100%;font-size:14px}
  .toast{bottom:calc(80px + env(safe-area-inset-bottom))}
}

.feedback-link {
  color: #8de2c7;
  text-underline-offset: 3px;
  padding-block: 5px;
}
.feedback-link:hover { color: #c8f8e8; }
.help-modal .feedback-link:not([hidden]) {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  font-size: 13px;
}

button.feedback-link {
  border: 0;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.feedback-dialog {
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px;
  border: 1px solid #49534e;
  border-radius: 16px;
  background: #292d2b;
  color: #f1f3f4;
  box-shadow: 0 16px 48px #0006;
}
.feedback-dialog::backdrop { background: #0009; }
.feedback-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-heading h2 { margin: 0; font-size: 21px; }
#feedbackClose { background: transparent; color: inherit; border: 0; font-size: 24px; width: 40px; height: 40px; cursor: pointer; }
.feedback-dialog fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.feedback-dialog label { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; }
.feedback-dialog input, .feedback-dialog textarea {
  width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #606964; border-radius: 7px;
  background: #202421; color: inherit; font: inherit; font-weight: 400;
}
.feedback-dialog textarea { resize: vertical; }
.feedback-dialog small { display: block; margin-top: 5px; color: #c4cdc8; font-size: 12px; }
#feedbackStatus { font-size: 14px; line-height: 1.5; }
#feedbackStatus:empty { display: none; }
#feedbackStatus.error { color: #ffb4ab; }
#feedbackSubmit { margin-top: 14px; min-height: 42px; }

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-block: 12px;
  font-size: 12px;
}
.legal-links a { color: #8de2c7; }
