/* V106: compact main tools, bounded dialogs and consistent option controls. */
.editor-toolbar > .commandbar { grid-template-columns:minmax(112px,1.05fr) minmax(96px,.8fr) minmax(144px,1.25fr) minmax(112px,.95fr) minmax(250px,2.1fr) minmax(126px,1fr) minmax(80px,.65fr) minmax(116px,1fr) minmax(100px,.85fr)!important; }
.editor-toolbar .document-command .command-buttons { grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important; }
.editor-toolbar .security-command .command-buttons,.editor-toolbar .capture-command .command-buttons { grid-template-columns:minmax(0,1fr)!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;gap:5px!important; }
.editor-toolbar .security-command .tool-tile,.editor-toolbar .capture-command .tool-tile { width:100%!important;height:100%!important;min-height:0!important;padding:3px!important;gap:3px!important; }
.editor-toolbar .security-command .tool-glyph,.editor-toolbar .capture-command .tool-glyph { height:20px!important;min-height:20px!important;font-size:19px!important; }
.commandbar > .capture-command { --panel-start:#06a6ae;--panel-end:#087d93;--panel-rgb:9,155,165;--panel-tint:#e9fafb;--panel-ink:#08798b; }
html[data-theme="dark"] .capture-command { --panel-tint:#183b43;--panel-ink:#73e2e6; }
.drop-icons > span { font-size:11px!important;letter-spacing:.02em; }
#officeEditorToolbar.office-ribbon > .office-ribbon-groups { grid-template-columns:4fr 6fr 3fr 3fr!important; }
#officeEditorToolbar .office-tool-split { position:relative;min-width:0; }
#officeEditorToolbar .office-tool-split > .office-ribbon-tool { padding-inline-end:29px!important; }
#officeEditorToolbar .office-tool-split .office-tool-drop-icon { display:none!important; }
#officeEditorToolbar .office-dropdown-button { position:absolute;z-index:4;inset:1px 1px 2px auto;width:27px;min-width:27px;margin:0;padding:0;display:grid;place-items:center;border:0;border-inline-start:1px solid #adc9f3;border-radius:0 6px 5px 0;background:#e1ecff;color:#1254bc;font:800 19px/1 Arial,sans-serif;cursor:pointer; }
#officeEditorToolbar .office-dropdown-button:hover,#officeEditorToolbar .office-dropdown-button[aria-expanded="true"] { background:#bad5ff;color:#003984; }
#officeEditorToolbar .office-dropdown-button[aria-expanded="true"] > span { transform:rotate(180deg); }
#officeEditorToolbar .office-ribbon-lists .office-tool-split { flex:0 0 88px; }
#officeEditorToolbar .office-ribbon-lists .office-tool-split > .office-ribbon-action { width:88px!important; }
#officeEditorToolbar #officePageBorderBtn { padding-inline-end:29px!important; }
#officeEditorToolbar.office-ribbon .page-border-arrow,.preview-edit-toolbar .preview-tool-drop-icon,.preview-edit-toolbar .page-border-arrow { inset:1px 1px 2px auto!important;width:27px!important;height:auto!important;border-inline-start:1px solid #adc9f3!important;border-radius:0 6px 5px 0!important;background:#e1ecff!important;color:#1254bc!important;font-size:17px!important;opacity:1!important; }
.preview-edit-toolbar > button.has-preview-dropdown,.preview-edit-toolbar .page-border-split { padding-inline-end:30px!important; }
#pageBorderToolBtn .page-border-arrow { width:27px!important;font-size:17px!important; }
html[data-theme="dark"] #officeEditorToolbar .office-dropdown-button,html[data-theme="dark"] #officeEditorToolbar.office-ribbon .page-border-arrow { background:#2b4771!important;color:#d7e8ff!important;border-color:#4b6f9e!important; }
#officeVisualOptions,#officeColorPalettePopover,#officeListStylePopover { max-height:calc(100dvh - 220px)!important;overflow-y:auto!important;overscroll-behavior:contain; }
#pageBorderModal { padding:12px!important;overflow:hidden!important; }
#pageBorderModal .page-border-properties-card { display:flex!important;flex-direction:column!important;width:min(850px,100%)!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important;min-height:0!important;overflow:hidden!important;padding:14px!important;box-sizing:border-box!important;background:var(--ui-surface)!important; }
#pageBorderModal .page-border-properties-head,#pageBorderModal .page-border-actions { flex:0 0 auto!important; }
#pageBorderModal .page-border-properties-head { margin:0!important;padding-bottom:10px!important; }
#pageBorderModal .page-border-scroll { flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:8px 3px 8px 0;scrollbar-gutter:stable; }
#pageBorderModal .page-border-actions { padding-top:9px!important;border-top:1px solid var(--ui-line); }
#pageBorderModal .page-border-properties-layout { display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:10px!important;align-items:start!important; }
#pageBorderModal .page-border-style-menu { grid-template-columns:repeat(2,minmax(0,1fr))!important;box-shadow:none!important; }
#pageBorderModal .page-border-color-palette { grid-template-columns:repeat(10,minmax(0,1fr))!important;gap:4px!important; }
#pageBorderModal .page-border-color-palette button { width:100%!important;max-width:25px; }
#pageBorderModal .page-border-target-box { margin-top:10px!important; }
#pageBorderModal .page-border-accordion-toggle { min-height:36px!important;padding:8px 10px!important; }
#pageBorderModal .page-border-sliders-row { grid-template-columns:minmax(0,1fr)!important; }
#pageBorderModal .page-border-scroll :is(.page-border-accordion-body,.page-border-style-menu,.settings-grid).hidden { display:none!important; }
/* Shared compact confirmation dialog. */
.mio-dialog-modal { z-index:14000!important;padding:16px!important;background:#101c3c75; }
.mio-dialog-card { width:min(450px,100%);max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border-radius:18px;border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-text);box-shadow:0 24px 65px #06132645; }
.mio-dialog-card header { display:flex;align-items:center;justify-content:space-between;gap:15px; }
.mio-dialog-card h2 { margin:0;font-size:21px;line-height:1.2; }
.mio-dialog-close { flex:0 0 32px;width:32px;height:32px;border:0;border-radius:9px;background:var(--ui-raised);color:var(--ui-text);font-size:24px;cursor:pointer; }
.mio-dialog-card p { color:var(--ui-muted);font-size:14px;line-height:1.6;margin:18px 0 24px; }
.mio-dialog-actions { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px; }
.mio-dialog-actions button { min-height:42px;padding:9px 15px;border-radius:10px;font-family:inherit;font-size:12px;font-weight:700;line-height:1.3;cursor:pointer; }
.mio-dialog-actions .modal-primary { background:#ed173d;color:#fff;border:1px solid #ed173d; }
.mio-dialog-actions .modal-secondary { background:var(--ui-raised);color:var(--ui-text);border:1px solid var(--ui-line); }
.mio-dialog-card :is(button,input):focus-visible { outline:3px solid var(--ui-focus);outline-offset:3px; }
/* Existing field controls reuse the same page data inside the page editor. */
.office-form-workspace { grid-column:1!important;grid-row:2!important;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--ui-surface); }
.office-form-workspace.hidden { display:none!important; }
.office-fields-mode > #officeNativeViewport { display:none!important; }
.office-form-workspace > .form-viewport { flex:1 1 0;min-height:100px; }
.office-form-workspace .form-editor-toolbar { gap:5px;padding:7px 10px; }
.office-form-workspace .form-editor-toolbar > button { min-height:32px;font-size:11px; }
.office-form-workspace .form-download { display:none!important; }
.office-form-workspace .form-navigation { padding:6px 10px; }
.office-form-workspace .form-editor-footer { padding:5px 10px;font-size:10px; }
.office-fields-mode #officeZoomControls { visibility:hidden; }
#officeEditorToolbar #officeCreateFieldsBtn.active { background:linear-gradient(145deg,#b4349a,#862789)!important;border-color:#9d247d!important;color:#fff!important; }
#officeEditorToolbar #officeCreateFieldsBtn.active .office-tool-glyph { color:#fff!important; }
/* V109: paste-only capture and image editing controls. */
.editor-toolbar .capture-command .command-buttons { grid-template-rows:minmax(0,1fr)!important; }
.editor-toolbar .capture-command .capture-paste-tile { gap:9px!important; }
.capture-paste-tile kbd { padding:4px 8px;border:1px solid #8dd4df;border-radius:6px;background:#ddf5f8;color:#08798b;font-family:inherit;font-size:11px;font-weight:700;line-height:1.2;white-space:nowrap; }
.capture-command[aria-busy="true"] .tool-tile { cursor:progress; }
.capture-help { z-index:12500!important;padding:12px!important; }
.capture-help.hidden { display:none!important; }
.capture-help-card { width:min(440px,100%);max-height:calc(100dvh - 24px);overflow:auto;padding:20px;box-sizing:border-box;border:1px solid var(--ui-line);border-radius:18px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 20px 60px #00133355;overscroll-behavior:contain; }
.capture-help header { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.capture-help h2 { font-size:20px;line-height:1.25;margin:0; }
.capture-help p { color:var(--ui-muted);font-size:13px;line-height:1.55;margin:14px 0; }
.capture-help .capture-feedback { color:#8d4c08;background:#fff5e4;border:1px solid #f6cf89;border-radius:10px;padding:10px 12px; }
.capture-paste-target { display:grid;gap:14px;margin-top:18px;padding:20px 16px;text-align:center;border:2px dashed #7fc8d5;border-radius:12px;background:#eefafb;color:#145e6b; }
.capture-paste-target strong { font-size:15px;line-height:1.4; }
.capture-paste-target > span { font-size:13px;line-height:1.5; }
.capture-paste-target kbd { display:inline-block;padding:4px 7px;border:1px solid #a7d0d7;border-bottom-width:3px;border-radius:6px;background:#fff;font-family:inherit;font-size:12px;font-weight:700;line-height:1.2;color:#145e6b; }
.capture-paste-key kbd { font-size:18px; }
.capture-buttons { display:flex;align-items:center;flex-wrap:wrap;gap:8px; }
.capture-help header button,.capture-preview header button { font-size:24px;line-height:1;padding:6px 11px; }
.capture-help footer { justify-content:flex-end; }
.capture-help button { min-height:40px;padding:8px 12px;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-raised);color:var(--ui-text);font-family:inherit;font-size:12px;font-weight:700;cursor:pointer; }
.capture-help button:disabled { opacity:.4;cursor:default; }
.capture-help .capture-primary { color:#fff;background:#087e94;border-color:#087e94; }
.capture-help header button { font-size:24px;line-height:1;padding:6px 11px; }
.capture-help :is(button,[tabindex]):focus-visible { outline:3px solid var(--ui-focus);outline-offset:2px; }
.capture-pending-image { display:block;max-width:100%;max-height:180px;object-fit:contain;margin:12px auto; }
html[data-theme="dark"] .capture-paste-target { background:#183b43;color:#aeedf2;border-color:#3a7883; }
html[data-theme="dark"] .capture-paste-target kbd,html[data-theme="dark"] .capture-paste-tile kbd { background:#123039;color:#aeedf2;border-color:#3a7883; }
html[data-theme="dark"] .capture-help .capture-feedback { background:#48361f;color:#fbd696;border-color:#796138; }
#officeImageControls { display:flex;flex-direction:column;gap:9px;width:100%; }
#officeImageControls.hidden { display:none!important; }
#officeImageControls > div { display:flex;align-items:center;justify-content:space-between;gap:7px;flex-wrap:wrap; }
#officeImageControls button { padding:8px 10px;min-height:36px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-raised);color:var(--ui-text);font:inherit;cursor:pointer; }
#officeImageControls output { min-width:34px;text-align:center;font-weight:700;color:var(--ui-text); }
#officeImageControls small { color:var(--ui-muted);line-height:1.5; }
@media(max-width:1250px) { .editor-toolbar > .commandbar { grid-template-columns:repeat(5,minmax(0,1fr))!important; }.editor-toolbar .document-command .command-buttons { grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(3,minmax(0,1fr))!important; } }
@media(max-width:1000px) { #officeEditorToolbar.office-ribbon > .office-ribbon-groups { grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important; } }
@media(max-width:800px) { .editor-toolbar > .commandbar { grid-template-columns:repeat(2,minmax(0,1fr))!important; }.office-form-workspace { flex:1 0 350px!important; } }
@media(max-width:650px) { #officeEditorToolbar.office-ribbon > .office-ribbon-groups { grid-template-columns:minmax(0,1fr)!important; }#pageBorderModal .page-border-properties-layout { grid-template-columns:minmax(0,1fr)!important; }#pageBorderModal .page-border-properties-card { padding:10px!important; }#pageBorderModal .page-border-sliders-row { grid-template-columns:1fr 1fr!important; } }
@media(max-width:520px) { .editor-toolbar .document-command .command-buttons { grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important; }.mio-dialog-card { padding:18px; } }
@media(prefers-reduced-motion:reduce) { .office-dropdown-button > span { transition:none; } }

#officeEditorToolbar .field-format-disabled { opacity:.45; }
.capture-help [hidden] { display:none!important; }
#officeEditorToolbar .office-page-orientation { display:flex; align-items:center; gap:7px; flex:0 0 auto; min-height:34px; padding:3px 7px; border:1px solid var(--ribbon-line); border-radius:7px; background:var(--ribbon-field); color:var(--ribbon-ink); font-size:10px; font-weight:800; }
#officeEditorToolbar .office-page-orientation[hidden] { display:none; }
#officeEditorToolbar .office-page-orientation select { width:100px; height:26px; padding:0 4px; border:1px solid var(--ribbon-line); border-radius:5px; background:var(--ribbon-field); color:var(--ribbon-ink); font:inherit; }
#officeEditorToolbar .office-page-orientation select:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }
.office-pdf-content { isolation:isolate; }
