/* V1.6.4.9-RC3.2 — Unified mobile editor / explicit language / safe template insertion.
   No changes to printed objects, export appearance or the 48-template catalog. */
.sw632-mobile-actions,.sw632-mobile-sheet{display:none}
.sw632-language-menu[hidden],.sw632-template-warning[hidden],.sw632-mobile-sheet:not([open]){display:none!important}
.topbar{position:relative}
#languageBtn{white-space:nowrap;font-weight:750;min-width:64px}
.sw632-language-menu{position:absolute;right:12px;top:calc(100% - 2px);z-index:160;width:min(250px,calc(100vw - 20px));padding:8px;background:#fff;border:1px solid #cbd8ec;border-radius:12px;box-shadow:0 16px 45px #10243d34;display:grid;gap:2px}
.sw632-language-title{font-size:11px;color:#62758d;padding:6px 10px 8px;font-weight:700}
.sw632-language-menu button{min-height:44px;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:white;border:none;border-radius:8px;color:#203550;font-size:13px;text-align:left}
.sw632-language-menu button.is-current{background:#edf5ff;color:#1255a7;font-weight:800}
.sw632-language-menu button:focus-visible{outline:2px solid #2563eb;outline-offset:-2px}
.sw632-lang-check{font-size:16px;min-width:18px;text-align:center}
.sw632-template-choice{border:0;padding:2px 0 0;margin:3px 0 0;min-width:0;display:grid;gap:7px}
.sw632-template-choice legend{color:#284367;font-size:12px;font-weight:800;padding:0 0 7px}
.sw48-template-config .sw632-template-choice label{margin:0;border:1px solid #d7e3f1;border-radius:10px;background:#fff;display:flex;align-items:center;gap:10px;padding:9px 10px;cursor:pointer;min-width:0;font-weight:500}
.sw632-template-choice label:has(input:checked){border-color:#6a9fe9;background:#f0f6ff}
.sw632-template-choice input{width:17px;height:17px;flex:none;accent-color:#2563eb}
.sw632-template-choice label span{display:flex;flex-direction:column;gap:3px;min-width:0}
.sw632-template-choice strong{font-size:12px;color:#1c385c}
.sw632-template-choice small{font-size:10px;color:#64748b;line-height:1.35}
.sw632-template-choice label:has(input:disabled){opacity:.48;cursor:not-allowed}
.sw632-template-warning{margin:4px 0 0;background:#fff7ea;border:1px solid #e8c691;border-radius:9px;padding:9px;color:#75461e;font-size:11px;line-height:1.5}
.sw632-template-warning.sw632-confirming{background:#fff0ec;border-color:#e8a396;color:#913c32;font-weight:700}
@media(max-width:900px){.sw632-template-choice{gap:5px}}
@media(max-width:700px){
 /* One global mobile command surface. Old duplicate top toolbar/nav stay functional
    behind IDs but are visually removed. Paper becomes the main working area. */
 body.sw63-ready .toolstrip,body.sw63-ready .mobile-nav,body.sw63-ready .statusbar{display:none!important}
 body.sw63-ready .topbar{height:49px;min-height:49px;padding:0 8px;gap:3px}
 body.sw63-ready .brand{min-width:0;flex-shrink:1}
 body.sw63-ready .brand a{white-space:nowrap;font-size:15px;gap:3px}
 body.sw63-ready .brand-logo{width:27px;height:27px}
 body.sw63-ready .top-actions{gap:1px;min-width:0;flex-shrink:0}
 body.sw63-ready .top-actions #showShortcuts{display:none}
 body.sw63-ready #pdfBtn{width:45px;min-width:45px;height:37px;min-height:37px;padding:3px 1px;gap:0;font-size:0}
 body.sw63-ready #pdfBtn span{display:none}
 body.sw63-ready #pdfBtn::after{content:'↓ PDF';font-size:11px;font-weight:800}
 body.sw63-ready #undoBtn,body.sw63-ready #redoBtn{min-width:28px;width:28px;padding:4px;font-size:19px}
 body.sw63-ready #languageBtn{height:35px;min-width:56px;padding:5px 3px;font-size:11px}
 body.sw63-ready .app-shell{height:calc(100dvh - 49px - 60px - env(safe-area-inset-bottom));min-height:0;overflow:hidden}
 body.sw63-ready .main-area{min-height:0}
 body.sw63-ready .page-toolbar{min-height:42px;height:42px;gap:4px;padding:4px 7px;overflow:visible;flex-wrap:nowrap;justify-content:space-between}
 body.sw63-ready .page-toolbar .page-nav{flex:0 0 auto;gap:3px;min-width:0}
 body.sw63-ready .page-toolbar .page-count{font-size:11px;white-space:nowrap;min-width:0}
 body.sw63-ready .page-toolbar #prevPage,body.sw63-ready .page-toolbar #nextPage{width:29px;min-width:29px;height:31px;padding:3px}
 body.sw63-ready .page-toolbar .nav-separator,
 body.sw63-ready .page-toolbar #addPage,body.sw63-ready .page-toolbar #duplicatePage,body.sw63-ready .page-toolbar #deletePage{display:none!important}
 body.sw63-ready #sw48OpenPaper{min-width:0;max-width:94px;flex:0 1 94px;padding:4px 5px;font-size:10px;height:31px;white-space:nowrap}
 body.sw63-ready .zoom-controls{flex:0 0 auto;gap:2px;min-width:0}
 body.sw63-ready .zoom-controls .zoom-hint,body.sw63-ready #zoomOut,body.sw63-ready #zoomIn{display:none!important}
 body.sw63-ready #zoomReadout{font-size:10px;min-width:28px}
 body.sw63-ready #fitPage{height:31px;min-width:30px;padding:3px 4px;font-size:11px}
 body.sw63-ready #sw63ZoomOptions{height:31px;min-width:29px;padding:3px 4px}
 body.sw63-ready #sw63Focus{display:none!important}
 body.sw63-ready .sw63-page-extra{gap:0}
 body.sw63-ready .sw63-add-palette{position:fixed;top:auto;bottom:calc(65px + env(safe-area-inset-bottom));left:8px;width:min(330px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:min(55dvh,390px);z-index:95;box-shadow:0 15px 45px #101f3939}
 body.sw63-ready .workspace-inner{padding:12px 9px 35px}
 body.sw63-ready .right-sidebar.open{bottom:calc(60px + env(safe-area-inset-bottom))!important;max-height:min(70dvh,565px)!important;height:min(70dvh,565px)!important}
 body.sw63-ready #overlay.active{inset:49px 0 calc(60px + env(safe-area-inset-bottom))}
 body.sw63-ready .left-sidebar{top:49px;bottom:calc(60px + env(safe-area-inset-bottom))}
 body.sw63-ready .sw632-mobile-actions{position:fixed;left:0;right:0;bottom:0;z-index:80;height:calc(60px + env(safe-area-inset-bottom));padding:3px 4px calc(3px + env(safe-area-inset-bottom));background:#fff;box-shadow:0 -2px 12px #132c4811;border-top:1px solid #dce5f0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;box-sizing:border-box}
 .sw632-mobile-actions button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;border:0;border-radius:8px;background:transparent;color:#355474;min-width:0;min-height:0;padding:3px 1px;font-weight:700;touch-action:manipulation}
 .sw632-mobile-actions button:active{background:#e8f1ff}
 .sw632-mobile-actions button:focus-visible{outline:2px solid #2563eb;outline-offset:-2px}
 .sw632-mobile-actions button>b{font-size:19px;line-height:23px;height:23px;font-weight:650}
 .sw632-mobile-actions button>span{font-size:9px;line-height:12px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
 .sw632-mobile-actions button:disabled{opacity:.35}
 .sw632-mobile-actions .sw632-selected-action{display:none}
 .sw632-mobile-actions.has-selection .sw632-idle-action{display:none}
 .sw632-mobile-actions.has-selection .sw632-selected-action{display:flex}
 .sw632-mobile-actions.has-selection{grid-template-columns:repeat(6,minmax(0,1fr))}
 .sw632-mobile-actions #sw632NavMore{background:#f0f6ff;color:#155cbb}
 .sw632-mobile-sheet[open]{display:block;position:fixed;inset:auto 0 0 0;margin:0;border:0;border-radius:18px 18px 0 0;background:#fff;color:#1c304c;width:100vw;max-width:100vw;max-height:min(73dvh,620px);box-shadow:0 -12px 45px #112a4833;padding:0;overflow:hidden;z-index:200}
 .sw632-mobile-sheet::backdrop{background:#0d1c34a1}
 .sw632-sheet-inner{max-height:min(73dvh,620px);overflow-y:auto;overscroll-behavior:contain;padding:14px 13px calc(18px + env(safe-area-inset-bottom))}
 .sw632-sheet-head{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px}
 .sw632-sheet-head h2{font-size:17px;font-weight:800;margin:0}
 .sw632-sheet-head button{border:0;border-radius:8px;width:40px;height:40px;background:#f0f3f8;font-size:22px;color:#4a627d}
 .sw632-sheet-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .sw632-sheet-grid button{min-height:46px;display:flex;gap:7px;align-items:center;border:1px solid #d9e4f1;background:#f8faff;border-radius:10px;padding:9px;color:#28456e;font-size:15px;touch-action:manipulation}
 .sw632-sheet-grid button>span{font-size:12px;font-weight:700;text-align:left}
 .sw632-sheet-grid button:disabled{opacity:.4}
 /* More room for the real worksheet in a template picker, while action choices
    remain visible and accessible in the scrolling configuration section. */
 .sw48-template-config .sw632-template-choice{grid-column:1/-1}
 .sw48-template-config .sw632-template-warning{grid-column:1/-1}
 .sw632-template-choice label{padding:7px 8px}
 .sw48-template-dialog{max-height:92dvh}
 .sw48-preview-area{max-height:26dvh!important}
 .sw48-template-config{padding-bottom:calc(9px + env(safe-area-inset-bottom))}
}
@media(max-width:370px){
 body.sw63-ready .topbar .brand-light{display:none}
 body.sw63-ready #zoomReadout{display:none}
 body.sw63-ready #sw48OpenPaper{max-width:73px;flex-basis:73px}
 body.sw63-ready .page-toolbar{padding-inline:4px;gap:2px}
 .sw632-mobile-actions button>span{font-size:8.5px}
}
@media print{.sw632-mobile-actions,.sw632-mobile-sheet,.sw632-language-menu{display:none!important}}
@media(max-width:700px){body.sw63-ready .sw632-mobile-actions.has-selection{grid-template-columns:repeat(6,minmax(0,1fr))}}
/* Final RC3.2 touch fix: never allow contextual commands to wrap into a second row.
   Grid auto-placement previously placed More below five selected commands on small iPhones. */
@media(max-width:700px){
 body.sw63-ready .sw632-mobile-actions,
 body.sw63-ready .sw632-mobile-actions.has-selection{display:flex!important;flex-direction:row;flex-wrap:nowrap;align-items:stretch;justify-content:stretch;gap:2px;overflow:hidden}
 body.sw63-ready .sw632-mobile-actions button{flex:1 1 0;width:0;min-width:0;max-width:none}
 body.sw63-ready .sw632-mobile-actions:not(.has-selection) .sw632-selected-action{display:none!important}
 body.sw63-ready .sw632-mobile-actions.has-selection .sw632-idle-action{display:none!important}
 body.sw63-ready .sw632-mobile-actions.has-selection .sw632-selected-action{display:flex!important}
}
