/* RC3 Compact Workspace UX — shared responsive layout, no editor object changes. */
body.sw63-ready .sw-quick-toolbar,
body.sw63-ready #swTableDock,
body.sw63-ready #mobileTextActions,
body.sw63-ready #swTDBackdrop{display:none!important}
body.sw63-ready .main-area{position:relative}
body.sw63-ready .toolstrip{height:56px;min-height:56px;padding-top:4px;padding-bottom:4px;overflow:visible;position:relative;z-index:28}
body.sw63-ready .toolstrip:has(#sw63Context:not([hidden])) .tools-primary{display:none!important}
body.sw63-ready .toolstrip:has(#sw63Context:not([hidden])) .toolstrip-right{display:none!important}
.sw63-context[hidden],.sw63-add-palette[hidden],.sw63-zoom-menu[hidden]{display:none!important}
.sw63-context{display:flex;flex:1;align-items:center;gap:7px;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding:1px 3px;scrollbar-width:thin;overscroll-behavior-inline:contain}
.sw63-context .sw63-tool{height:37px;min-height:37px;border-radius:8px;border:1px solid #d7e2f0;color:#294368;background:#fff;padding:6px 10px;font-size:12px;font-weight:650;flex:0 0 auto}
.sw63-context .sw63-tool:hover,.sw63-context .sw63-tool:focus-visible{border-color:#8cb6f3;background:#f0f6ff;outline-offset:1px}
.sw63-context .sw63-tool.active{background:#e3edff;color:#1253b3;border-color:#82aef2}
.sw63-context .sw63-add{background:#eaf3ff;border-color:#a8cafa;color:#1656b6}
.sw63-context .sw63-label{flex:0 0 auto;color:#174a98;background:#ecf4ff;border-radius:7px;padding:8px 10px;font-size:12px;font-weight:800;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.sw63-context .sw63-field{display:flex;align-items:center;gap:5px;flex:0 0 auto}
.sw63-context .sw63-field select{width:118px;height:37px;font-size:12px;border:1px solid #d2dfec;border-radius:8px;background:white;padding:0 5px}
.sw63-context .sw63-field input[type=number]{width:59px;height:37px;border-radius:8px;border:1px solid #d2dfec;padding:4px 7px;font-size:12px}
.sw63-context .sw63-field input[type=color]{width:42px;height:37px;border-radius:8px;border:1px solid #d2dfec;background:#fff;padding:3px;cursor:pointer}
.sw63-context .sw63-more{margin-left:auto;background:#f5f8fc}
.sw63-context .sw63-tool[hidden],.sw63-context .sw63-field[hidden]{display:none!important}
.sw63-add-palette{position:absolute;z-index:65;top:56px;left:12px;max-width:min(370px,calc(100vw - 24px));width:350px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:13px;background:white;border:1px solid #cfdbec;border-radius:13px;box-shadow:0 18px 48px #1b335333;max-height:min(60dvh,390px);overflow-y:auto}
.sw63-add-palette button{border:1px solid #e0e8f4;background:#f8faff;border-radius:9px;padding:12px 4px;font-size:12px;color:#284266;font-weight:650;min-height:46px}
.sw63-add-palette button:hover{background:#e6f1ff;border-color:#93baff}
.sw63-page-extra{display:flex;align-items:center;gap:5px;flex:0 0 auto;position:relative}
.sw63-zoom-menu{position:absolute;top:calc(100% + 5px);right:0;background:#fff;border:1px solid #d5e1ef;box-shadow:0 10px 35px #2136512f;border-radius:9px;z-index:65;padding:5px;width:140px;display:grid;gap:2px}
.sw63-zoom-menu button{width:100%;text-align:left;border:0;border-radius:6px;background:transparent;padding:9px 8px;font-size:12px;color:#294266}
.sw63-zoom-menu button:hover{background:#eaf2ff}
.sw63-page-extra .btn{font-size:11px;min-height:30px;padding:4px 9px}
body.sw63-ready #sw63CellEditorHost:has(#swTDComposer:not([hidden])){display:block;padding:6px 10px;background:#f9fbff;border-bottom:1px solid #d8e2ef;flex:none}
body.sw63-ready #sw63CellEditorHost:has(#swTDComposer:not([hidden])) #swTDComposer{display:flex;flex-wrap:wrap;align-items:center;gap:7px}
body.sw63-ready #sw63CellEditorHost:has(#swTDComposer:not([hidden])) #swTDComposeText{flex:1;min-width:120px;min-height:47px;max-height:98px;font-size:16px;padding:7px}
body.sw63-ready #sw63CellEditorHost:has(#swTDComposer:not([hidden])) #swTDCancel,
body.sw63-ready #sw63CellEditorHost:has(#swTDComposer:not([hidden])) #swTDDone{min-height:40px}
body.sw63-ready .sw63-add-palette button:focus-visible{outline:3px solid #bfdbfe}
/* Focus mode is a real area expansion. Keep topbar for Save, Undo and PDF, and page nav for zoom. */
body.sw63-focus .toolstrip,body.sw63-focus .statusbar,body.sw63-focus #sw63AddPalette{display:none!important}
body.sw63-focus .page-toolbar{min-height:37px;padding-block:3px}
body.sw63-focus .workspace-inner{padding-top:8px}
@media(max-width:1180px){
 body.sw63-ready .sw63-context{gap:5px}
 body.sw63-ready .sw63-context .sw63-label{max-width:105px}
 .sw63-context .sw63-field select{width:100px}
}
@media(max-width:960px){
 body.sw63-ready .toolstrip{height:52px;min-height:52px;padding:3px 6px}
 body.sw63-has-selection .toolstrip .tools-edge{display:none!important}
 body.sw63-ready .toolstrip:has(#sw63Context:not([hidden])) .toolstrip-right{display:none!important}
 body.sw63-ready .sw63-context{width:100%;gap:5px}
 .sw63-context .sw63-tool{height:40px;min-height:40px;padding:6px 8px;font-size:12px}
 .sw63-context .sw63-label{font-size:12px;padding:10px 6px}
 .sw63-context .sw63-field select,.sw63-context .sw63-field input[type=number],.sw63-context .sw63-field input[type=color]{height:40px}
 .sw63-add-palette{top:52px;left:6px}
 .sw63-page-extra .btn{min-width:31px;padding:3px 6px}
 /* Touch inspector becomes a bottom sheet, while side panels used for Templates remain unchanged. */
 body.sw63-ready .right-sidebar.open{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:65px!important;width:100vw!important;max-width:100vw!important;height:min(64dvh,560px)!important;max-height:min(64dvh,560px)!important;transform:translateY(0)!important;border:1px solid #cbd9eb;border-radius:17px 17px 0 0;box-shadow:0 -13px 45px #13294d35;z-index:62!important}
 body.sw63-ready .right-sidebar:not(.open){transform:translateY(120%)!important}
 body.sw63-ready .right-sidebar .side-head{padding:12px 18px 6px}
 body.sw63-ready .right-sidebar .side-scroll{flex:1;overscroll-behavior:contain}
}
@media(max-width:700px){
 body.sw63-ready .toolstrip{height:50px;min-height:50px}
 .sw63-context .sw63-field,.sw63-context #sw63Bold{display:none!important}
 .sw63-context .sw63-more{margin-left:auto}
 .sw63-context .sw63-label{max-width:112px}
 .sw63-context .sw63-tool{height:40px;font-size:11px;min-height:40px}
 .sw63-add-palette{top:50px}
 body.sw63-ready .page-toolbar{gap:4px}
 body.sw63-ready .sw63-page-extra #sw63Focus{font-size:0;min-width:32px}
 body.sw63-ready .sw63-page-extra #sw63Focus::first-letter{font-size:16px}
 body.sw63-ready .sw63-page-extra #sw63ZoomOptions{font-size:13px;min-width:30px}
 body.sw63-ready .sw63-add-palette{grid-template-columns:repeat(2,minmax(0,1fr));width:min(300px,94vw)}
 body.sw63-ready .sw63-zoom-menu{top:calc(100% + 5px)}
}
@media(max-width:390px){
 body.sw63-ready .sw63-page-extra #sw63Focus{display:none}
 body.sw63-ready .sw63-context{gap:3px}
 body.sw63-ready .sw63-context .sw63-label{max-width:85px;padding-inline:5px;font-size:11px}
 body.sw63-ready .sw63-context .sw63-tool{padding:5px 7px}
}
@media print{
 .sw63-context,.sw63-add-palette,.sw63-zoom-menu,.sw63-page-extra,#sw63CellEditorHost{display:none!important}
}

/* Touch deletion is never buried under additional tools. */
.sw63-context .sw63-delete{display:none;background:#fff5f6;border-color:#efc5cf;color:#9f2741;font-size:17px;font-weight:800}
@media(pointer:coarse){.sw63-context .sw63-delete{display:inline-flex;align-items:center;justify-content:center;min-width:40px}}
@media(max-width:700px){.sw63-context #sw63Delete{margin-left:0}}

/* Multi-select actions share the same single row, no second selection bar. */
body.sw63-ready #selectionActions{display:none!important}
