/* Mobile overrides stay within the editor; desktop ribbon and cards retain their layout. */
/* Center .demo-main cleanly on desktop while keeping full width on mobile. */
body.mskw-editor .demo-main{width:100%;max-width:1380px!important;margin-inline:auto!important;box-sizing:border-box}
.mskr-field.mskr-checkbox-field input[type=checkbox]{appearance:auto;width:20px!important;height:20px!important;min-width:20px!important;max-width:20px!important;flex:none;accent-color:var(--msk-blue,#244eb9)}
.mskr-paper-dimensions{align-self:center;min-width:100px;font-size:11px;direction:ltr;text-align:center;color:var(--msk-muted)}
.mskw-mobile-dock[hidden],.msk-start[hidden]{display:none!important}
.msk-at-start .demo-stage,.msk-at-start .mskp-status,.msk-at-start .mskw-mobile-dock,.msk-at-start .msk-layout,.msk-at-start .mskp-pages,.msk-at-start .mskp-size-note{display:none!important}
.msk-start{max-width:1020px;margin:0 auto;padding:18px;color:var(--msk-ink)}
.msk-start-hero{display:flex;align-items:center;gap:24px;padding:20px 28px;border:1px solid var(--msk-line);border-radius:22px;background:linear-gradient(120deg,var(--msk-soft),var(--msk-surface))}
.msk-start-hero>div{flex:1;min-width:0}.msk-start-hero img{width:210px;max-width:35%;height:170px;object-fit:contain}.msk-start-hero h1{font-size:30px;margin:5px 0}.msk-start-hero small{color:var(--msk-blue);font-weight:700}.msk-start-hero p{font-size:13px;margin:0;color:var(--msk-muted)}
.msk-start-actions{display:flex;gap:12px;margin:16px 0}.msk-start-actions .mskw-tool{flex:1;max-width:260px;min-height:64px;border:1px solid var(--msk-line)}
.msk-start h2{font-size:17px}.msk-start-projects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;font-size:13px}.msk-start-project{display:grid;grid-template-columns:34px 1fr;gap:5px 10px;text-align:start;background:var(--msk-surface);color:var(--msk-ink);padding:15px;border:1px solid var(--msk-line);border-radius:15px}.msk-start-project>svg{grid-row:span 2;width:30px;height:30px;color:var(--msk-blue)}.msk-start-project strong{overflow-wrap:anywhere;font-size:13px}.msk-start-project small{font-size:10px;color:var(--msk-muted)}
.msk-start-desktop{display:flex;align-items:center;justify-content:center;gap:14px;width:100%;margin-top:20px;padding:19px;border:0;border-radius:16px;background:linear-gradient(110deg,#234594,#386bc0,#237c96);color:white;font-weight:700}.msk-start-desktop svg{width:35px;height:35px}.msk-start-note{font-size:11px;color:var(--msk-muted)}.msk-exit .mskw-body{display:flex;flex-wrap:wrap;gap:10px}.msk-exit p{flex-basis:100%}.msk-exit .mskw-tool{flex:1}
@media(max-width:760px){
 .mskw-editor main,.mskw-editor .demo-stage,.mskw-editor .msku-workbench,.mskw-editor .msku-ribbon-panels,.mskw-editor .msku-ribbon-panel{min-width:0;max-width:100%;box-sizing:border-box}
 .mskw-editor .msku-ribbon-panel{overflow:hidden!important}
 .mskw-editor .mskr-ribbon-row,.mskw-editor .mskw-export-tools{display:flex!important;flex-wrap:nowrap!important;gap:4px!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-inline:contain;scrollbar-width:thin;scroll-snap-type:x proximity;padding-bottom:3px;max-width:100%;width:100%;box-sizing:border-box}
 .mskw-editor .mskr-ribbon .mskw-tool,.mskw-editor .mskr-field,.mskw-editor .mskw-export-tools>.mskw-tool{flex:0 0 calc((100% - 16px)/5)!important;width:calc((100% - 16px)/5)!important;min-width:0!important;max-width:none!important;height:72px!important;min-height:72px!important;scroll-snap-align:start;padding:4px 2px!important;box-sizing:border-box}
 .mskw-editor .mskr-field input:not([type=checkbox]),.mskw-editor .mskr-field select{width:100%!important;max-width:60px!important;min-width:0!important}
 .mskw-editor .mskw-tool small,.mskw-editor .mskr-field>small{white-space:normal!important;font-size:9px!important;line-height:1.35!important;text-align:center;overflow-wrap:anywhere}
 .mskw-editor .mskr-more,.mskw-editor .mskr-overflow,.mskw-editor .msk-card-eye-btn,.mskw-editor #mskBatchEye{display:none!important}
 .mskw-editor .mskw-mobile-dock{height:auto!important;min-height:0!important;max-height:none!important;padding:5px 7px calc(5px + env(safe-area-inset-bottom))!important;gap:3px!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center!important}
 .mskw-editor .mskw-mobile-dock>.mskw-tool{min-width:0!important;width:100%!important;min-height:52px!important;height:52px!important;padding:3px 1px!important;gap:2px!important}.mskw-editor .mskw-mobile-dock .mskw-glyph{width:27px;height:27px}.mskw-editor .mskw-mobile-dock .mskw-glyph svg{width:17px;height:17px}
 .mskw-editor:not(.msk-has-selection){padding-bottom:0!important}.mskw-editor.msk-has-selection{padding-bottom:76px!important}
 .msku-auth-card,.msku-access,.msku-pending{min-width:0;box-sizing:border-box}.msku-form-options{flex-wrap:wrap;gap:8px}.msku-access button,.msku-coupon div>*{min-width:0;max-width:100%;box-sizing:border-box}.msku-coupon>div{display:flex;gap:6px}.msku-coupon input{flex:1;width:0}.msku-password>[data-password]{display:none!important}
 .msk-start{padding:10px}.msk-start-hero{padding:15px;gap:10px;border-radius:16px}.msk-start-hero h1{font-size:21px}.msk-start-hero p{font-size:11px}.msk-start-hero img{height:110px;max-width:33%}.msk-start-actions{gap:8px}.msk-start-projects{grid-template-columns:1fr;gap:7px}.msk-start-project{padding:12px}.msk-start-desktop{margin-top:14px;padding:16px;font-size:13px}
}
@media print{.msk-start{display:none!important}}

/* Numeric properties need legible labels and native controls, rather than icon tiles. */
@media(max-width:760px){
 body.mskw-editor #msku-panel-image,body.mskw-editor #msku-panel-page{overflow:auto!important;max-height:48dvh!important;scroll-padding-block:12px}
 body.mskw-editor #msku-panel-image .mskr-ribbon-row,body.mskw-editor #msku-panel-page .mskr-ribbon-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important;overflow:visible!important;padding:2px!important}
 body.mskw-editor #msku-panel-image .mskr-field,body.mskw-editor #msku-panel-page .mskr-field{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:6px!important;width:auto!important;min-width:0!important;height:auto!important;min-height:82px!important;max-width:none!important;padding:8px!important;background:var(--msk-soft);border:1px solid var(--msk-line);border-radius:10px}
 body.mskw-editor .mskr-field>.mskw-glyph{display:none!important}
 body.mskw-editor #msku-panel-image .mskr-field>small,body.mskw-editor #msku-panel-page .mskr-field>small{order:-1;text-align:start!important;font-size:12px!important;line-height:1.4!important;overflow-wrap:anywhere}
 body.mskw-editor #msku-panel-image .mskr-field input:not([type=checkbox]),body.mskw-editor #msku-panel-page .mskr-field input:not([type=checkbox]),body.mskw-editor #msku-panel-image .mskr-field select,body.mskw-editor #msku-panel-page .mskr-field select{width:100%!important;max-width:none!important;min-width:0!important;height:40px!important;min-height:40px!important;font-size:16px!important;box-sizing:border-box;padding:5px 7px!important}
 body.mskw-editor #msku-panel-image .mskr-field.mskr-checkbox-field{flex-direction:row!important;align-items:center!important;justify-content:space-between!important}
 body.mskw-editor #msku-panel-image .mskr-field.mskr-checkbox-field>small{max-width:calc(100% - 28px)}
 body.mskw-editor #msku-panel-image .mskw-tool,body.mskw-editor #msku-panel-page .mskw-tool{width:100%!important;min-width:0!important;height:auto!important;min-height:62px!important;padding:8px!important}
 body.mskw-editor #msku-panel-image .mskw-tool small,body.mskw-editor #msku-panel-page .mskw-tool small{font-size:11px!important;line-height:1.4!important;white-space:normal!important}
 .mskr-paper-dimensions{grid-column:1/-1;min-width:0;padding:8px}
}

.msk-account-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-bottom:12px}.msk-account-actions[hidden]{display:none!important}.msk-account-actions button{display:flex;align-items:center;gap:5px;border:1px solid var(--msk-line);background:var(--msk-surface);color:var(--msk-ink);border-radius:10px;padding:8px 10px;cursor:pointer;font:inherit;font-size:11px}.msk-account-actions svg{width:18px;height:18px}.msku-top-actions .msk-account-actions{margin:0}.msku-top-actions .msk-account-actions button{padding:6px}.msku-top-actions .msk-account-actions span{display:none}

/* High contrast, authentic white header mark inside rounded blue square in both themes. */
.msku-topbar .msku-mark,.mskv-brand .msku-mark{background:linear-gradient(145deg,#2563EB,#1D4ED8)!important;border:1px solid rgba(255,255,255,.28)!important;border-radius:11px!important;padding:5px!important;box-sizing:border-box;box-shadow:0 4px 12px rgba(29,78,216,.28),inset 0 1px 0 rgba(255,255,255,.35)!important;display:inline-grid;place-items:center}
.msku-topbar .msku-mark img,.mskv-brand .msku-mark img{object-fit:contain;filter:brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.2))!important}
.msku-topbar .msku-mark svg,.mskv-brand .msku-mark svg{width:24px;height:24px;color:#fff!important}
.msku-topbar .msku-mark:after{display:none}.msku-back svg{transform:rotate(180deg)}[dir=rtl] .msku-back svg{transform:none}
.msku-flag-switcher{display:inline-flex!important;align-items:center;gap:3px;padding:2px 4px!important;border-radius:9px!important;background:var(--msk-soft);order:990}
.msku-flag-btn{display:inline-flex!important;align-items:center;justify-content:center;width:28px!important;height:24px!important;min-width:28px!important;min-height:24px!important;border-radius:6px!important;padding:2px!important;text-decoration:none;opacity:.62;transition:all .15s ease}
.msku-flag-btn.is-active,.msku-flag-btn:hover{opacity:1;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18);transform:translateY(-1px)}
.msku-flag-btn svg{width:20px!important;height:14px!important;border-radius:2px;display:block}
.msku-office2007-close{order:999!important;display:inline-flex!important;align-items:center;justify-content:center;width:36px!important;min-width:36px!important;height:32px!important;min-height:32px!important;padding:0!important;border-radius:8px!important;color:#fff!important;border:1px solid #7F1D1D!important;background:linear-gradient(180deg,#FCA5A5 0%,#EF4444 18%,#DC2626 49%,#991B1B 52%,#B91C1C 84%,#F87171 100%)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.72),0 2px 6px rgba(185,28,28,.38)!important;text-decoration:none;cursor:pointer;margin-inline-start:4px!important}
.msku-office2007-close:hover{background:linear-gradient(180deg,#FECACA 0%,#F87171 18%,#EF4444 49%,#B91C1C 52%,#DC2626 84%,#FCA5A5 100%)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 0 12px rgba(239,68,68,.65)!important;transform:translateY(-1px)}
.msku-office2007-close svg{width:15px!important;height:15px!important;color:#fff!important;stroke:#fff!important}
.msku-wallet-switch-btn{display:inline-flex!important;align-items:center;gap:6px;width:auto!important;min-width:auto!important;padding:0 12px!important;height:34px!important;border-radius:9px!important;background:linear-gradient(135deg,#0D9488,#059669)!important;color:#fff!important;font-weight:700!important;font-size:12px!important;box-shadow:0 3px 10px rgba(13,148,136,.26)!important}
.msku-wallet-switch-btn svg{width:16px!important;height:16px!important;color:#fff!important;stroke:#fff!important}

/* Fill the available desktop canvas; keep paper proportions independent of zoom. */
body.mskw-editor .demo-main{max-width:none!important;width:100%;padding-inline:20px!important}
body.mskw-editor .demo-stage.demo-creative{max-width:none!important;width:100%!important;margin-inline:0!important;box-sizing:border-box}
body.mskw-editor .msku-workbench,body.mskw-editor .msk-layout{max-width:none!important;width:100%;margin-inline:0!important}
body.mskw-editor .msk-layout{grid-template-columns:240px minmax(0,1fr);justify-content:stretch}
body.mskw-editor .msk-stage-wrap{min-width:0;max-width:none;width:100%;box-sizing:border-box}
body.mskw-editor #mskA4Host{width:100%;min-width:0;margin-inline:auto;align-items:center}
body.mskw-editor .msk-a4{margin-inline:auto!important}
/* A zoomed page scrolls inside its workspace on narrow screens, without clipping its left edge. */
@media screen{body.mskw-editor #mskA4Host{width:max(100%,var(--mskw-page-width,100%))}}

/* One wallet-home control, one avatar entry, and a final red-door logout. */
body.mskw-editor .msku-top-actions>button[data-workspace-home]{display:inline-flex!important;width:auto!important;min-width:34px!important;padding-inline:10px!important;gap:6px;white-space:nowrap}
body.mskw-editor .msku-top-actions>.msk-account-actions{order:1000!important;margin:0!important;padding-inline:3px!important}
body.mskw-editor .msku-btn-logout-door{width:34px;min-width:34px;height:34px;padding:6px!important;border:0;background:transparent;color:#dc2626!important}
body.mskw-editor .msku-btn-logout-door:hover{background:#fee2e2}
body.mskw-editor .msku-btn-logout-door svg{width:22px;height:22px;stroke:currentColor!important}
body.mskw-editor .mrp-avatar{border-radius:9px!important;padding:0!important;overflow:hidden}
body.mskw-editor .mrp-avatar img{border-radius:inherit!important;width:100%;height:100%;object-fit:cover}
body.mskw-editor .msku-top-actions>.mrp-avatar{display:inline-flex!important}
body.mskw-editor .msku-top-actions>.mrp-avatar[hidden]{display:none!important}

/* Typography only: each ribbon keeps its own layout and colors. */
body.mskw-editor .msku-ribbon-tabs button,
body.mskw-editor .msku-ribbon-panel button,
body.mskw-editor .msku-ribbon-panel label,
body.mskw-editor .msku-ribbon-panel small,
body.mskw-editor .msku-ribbon-panel input,
body.mskw-editor .msku-ribbon-panel select{font-family:inherit!important;font-weight:700!important}
/* Ordered app actions; layout follows the document direction in Arabic and English. */
body.mskw-editor .msku-top-actions{direction:inherit;gap:4px;padding:4px;border:1px solid var(--msk-line);border-radius:12px;background:var(--msk-surface);flex-wrap:wrap!important;justify-content:flex-start}
body.mskw-editor .msku-top-actions>button,body.mskw-editor .msku-top-actions .msku-theme button,body.mskw-editor .msku-top-actions>.msku-office2007-close,body.mskw-editor .msku-top-actions .msku-btn-logout-door{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:7px!important;border:0!important;border-radius:8px!important;background:transparent!important;box-shadow:none!important;margin:0!important}
body.mskw-editor .msku-top-actions>button:hover,body.mskw-editor .msku-top-actions .msku-theme button:hover{background:var(--msk-soft)!important}
body.mskw-editor .msku-top-actions>button[data-workspace-home]{order:0!important;width:auto!important;padding-inline:10px!important;background:var(--msk-soft)!important;color:var(--msk-blue)!important;font-size:12px!important}
body.mskw-editor .msku-top-actions>button[data-workspace-home] svg{color:inherit!important;stroke:currentColor!important}
body.mskw-editor .msku-top-actions>[data-header-action=folder]{order:1!important}
body.mskw-editor .msku-top-actions>[data-header-action=save]{order:2!important}
body.mskw-editor .msku-top-actions>[data-header-action=print]{order:3!important}
body.mskw-editor .msku-top-actions>[data-header-action=settings]{order:4!important}
body.mskw-editor .msku-top-actions>.msku-theme{display:flex!important;order:5!important}
body.mskw-editor .msku-top-actions>[data-header-info]{order:6!important}
body.mskw-editor .msku-top-actions>.mrp-avatar{order:7!important}
body.mskw-editor .msku-top-actions>.byb-vip-gold-badge{order:8!important}
body.mskw-editor .msku-top-actions>.msku-flag-switcher{order:9!important;margin-inline:3px}
body.mskw-editor .msku-top-actions>.msku-office2007-close{order:10!important;color:#dc2626!important}
body.mskw-editor .msku-top-actions>.msku-office2007-close svg{stroke:currentColor!important;color:inherit!important}
body.mskw-editor .msku-top-actions>.msk-account-actions{order:11!important;margin:0!important;padding:0!important}
body.mskw-editor .msku-top-actions .msku-btn-logout-door{color:#dc2626!important}
body.mskw-editor .msku-top-actions>.msku-office2007-close:hover,body.mskw-editor .msku-top-actions .msku-btn-logout-door:hover{background:#dc262614!important}
body.mskw-editor .msku-top-actions>[hidden]{display:none!important}
/* Native checkbox and caption express the setting; a second decorative shield is redundant. */
body.mskw-editor .mskr-checkbox-field>.mskw-glyph{display:none!important}
body.mskw-editor .mskr-checkbox-field{justify-content:center!important;gap:6px!important}
@media(max-width:760px){
 body.mskw-editor .demo-main{padding-inline:8px!important}
 body.mskw-editor .msk-layout{display:flex;flex-direction:column}
 body.mskw-editor .msku-topbar{grid-template-columns:1fr}
 body.mskw-editor .msku-topbar>.mskw-project-name{grid-column:1;grid-row:auto}
 body.mskw-editor .msku-top-actions{grid-column:1;justify-self:stretch;width:100%!important;justify-content:flex-start;flex-wrap:wrap!important}
 body.mskw-editor .msku-top-actions>button[data-workspace-home]{padding-inline:8px!important;font-size:11px!important}
 body.mskw-editor .msku-top-actions>[data-header-action]{display:inline-flex}
}

/* Editing guides are visible on screen without becoming printed document borders. */
@media screen{
 body.mskw-editor .msk-a4 .msk-card{border:1px solid #9ca3af!important;background:#fff!important}
 body.mskw-editor .msk-a4 .msk-img-holder{border:1px dashed #9ca3af!important}
 body.mskw-editor .msk-a4 .msk-card.has-image .msk-img-holder{border:0!important;outline:1px solid #9ca3af;outline-offset:-1px}
}
/* Use the original proportional Mustamsakati mark in both shared headers. */
.msku-topbar .msku-mark{width:42px!important;height:42px!important}
.msku-topbar .msku-mark img,.mskv-brand .msku-mark img{display:block;width:100%!important;height:100%!important;max-width:100%;max-height:100%;object-fit:contain}
body.mskw-editor .msku-top-actions>.mrp-avatar{padding:0!important}
@media(max-width:760px){.msku-topbar .msku-mark{width:32px!important;height:32px!important}}
