/* QPrinty Studio 18 — full workbench layout inspired by professional editors.
   Entirely original implementation; preserves existing QPrinty Canvas state. */
:root{--qp18-ink:#1b2c3d;--qp18-muted:#697783;--qp18-rail:#f4f7f9;--qp18-line:#e0e7eb;--qp18-blue:#2864bd;--qp18-teal:#17746f}
html:has(.qp18-toolbar){scroll-padding-top:0}
body:has(.qp18-toolbar){background:#e7ecf1!important}
body:has(.qp18-toolbar) :is(#header,#header-box,.qp-announcement,#footer,.qp-footer-cta){display:none!important}
body:has(.qp18-toolbar) main.qp-studio-route{max-width:100vw!important;width:100%!important;padding:0!important;margin:0 auto!important;min-height:100vh;overflow:visible}
body:has(.qp18-toolbar) .qp-studio-route>.qprinty-breadcrumb,body:has(.qp18-toolbar) .qp-studio-route-top{display:none!important}
body:has(.qp18-toolbar) .qp-studio-route .qp-purchase-form{margin:0!important;padding:0!important;gap:0!important}
body:has(.qp18-toolbar) .qp-studio-route .qprinty-studio{background:#fff!important;border:0!important;border-radius:0!important;margin:0!important;padding:0!important;overflow:visible!important;box-shadow:none!important}
body:has(.qp18-toolbar) .qp-studio-heading{display:none!important}
.qp18-toolbar{height:66px;display:flex;align-items:center;gap:14px;padding:0 clamp(12px,2vw,28px);background:#fff;border-bottom:1px solid var(--qp18-line);color:var(--qp18-ink);font-size:13px;position:relative;z-index:55;box-shadow:0 2px 6px #2d435008;direction:rtl}
.qp18-brand{display:flex;align-items:center;gap:10px;white-space:nowrap;flex-shrink:0}
.qp18-brandmark{width:35px;height:35px;background:#225cc2;border-radius:11px;color:#fff;display:grid;place-items:center;font-size:23px}
.qp18-brand div{display:flex;flex-direction:column;gap:1px}.qp18-brand b{font-family:Arial,sans-serif;letter-spacing:-.3px;font-size:17px;line-height:1.15}.qp18-brand em{font-size:11px;color:#4583c4;font-style:normal}.qp18-brand small{font-size:10px;color:var(--qp18-muted)}
.qp18-bar-separator{width:1px;height:27px;background:var(--qp18-line);flex-shrink:0}
.qp18-product{display:flex;flex-direction:column;line-height:1.45;min-width:0;max-width:290px;position:relative}.qp18-product-label{font-size:10px;color:#84929f}.qp18-product strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qp18-save-bullet{position:absolute;left:-10px;top:8px;color:#c4d6e5;font-size:8px}
.qp18-toolbar-middle,.qp18-toolbar-end{display:flex;align-items:center;gap:7px;white-space:nowrap}.qp18-toolbar-middle{margin-inline:auto}
.qp18-toolbar button{font-family:inherit;font-size:12px;font-weight:700;line-height:1.5;border:1px solid #d9e3e9;cursor:pointer;transition:background .16s,border-color .16s;display:flex;align-items:center;justify-content:center;gap:6px;min-height:35px;border-radius:8px;background:#fff;color:#354a5b;padding:6px 12px}.qp18-toolbar button:hover{background:#eff5fb;border-color:#aec2d6}.qp18-toolbar button:focus-visible{outline:2px solid var(--qp18-blue);outline-offset:2px}.qp18-toolbar .qp18-icon-command{font-size:22px;padding:0;width:36px;font-weight:500}.qp18-toolbar .qp18-cta{background:#1f6271;color:white;border-color:#1f6271;font-weight:800;padding-inline:18px}.qp18-toolbar .qp18-cta:hover{background:#194e59}.qp18-toolbar .qp18-cta:disabled{opacity:.55;cursor:not-allowed;background:#708189}
.qp-studio-route .qp-designer-shell{display:grid!important;grid-template-columns:minmax(300px,332px) minmax(400px,1fr) minmax(216px,254px)!important;gap:0!important;align-items:stretch!important;min-height:calc(100vh - 66px)!important;background:#fff;direction:rtl}
.qp-studio-route .qp-sidebar{display:grid!important;grid-template-columns:69px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;overflow:hidden!important;max-height:calc(100vh - 66px)!important;min-height:620px!important;background:#fff!important;border-inline-end:1px solid var(--qp18-line)!important;direction:rtl}
.qp-studio-route .qp-tool-tabs{grid-column:1;grid-row:1;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:4px!important;padding:16px 5px!important;background:var(--qp18-rail)!important;border-inline-end:1px solid var(--qp18-line)!important;border-bottom:0!important;min-height:0;overflow-y:auto!important;scrollbar-width:thin}
.qp-studio-route .qp-tool-tabs button{flex-shrink:0;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;border:1px solid transparent!important;background:transparent!important;color:#4b6174!important;border-radius:11px!important;padding:10px 2px!important;min-height:67px!important;line-height:1.25!important;white-space:normal!important;font-size:10px!important;font-weight:750!important;letter-spacing:normal!important;box-shadow:none!important}
.qp-studio-route .qp-tool-tabs button:hover{background:#e8f0f7!important}.qp-studio-route .qp-tool-tabs button.is-active{background:white!important;color:#1d60b1!important;border-color:#d5e3f1!important;box-shadow:0 1px 5px #274e7710!important}
.qp18-tool-icon{display:block;font:800 24px/1.1 Arial,sans-serif;letter-spacing:-1px}.qp18-tool-label{font-size:10px;font-weight:700}.qp18-dynamic-icon{font-size:22px;line-height:1.1}
.qp-studio-route .qp-panel{grid-column:2;grid-row:1;min-width:0!important;min-height:0!important;overflow:auto!important;max-height:calc(100vh - 66px)!important;padding:21px 17px!important;background:#fff!important;scrollbar-width:thin;overscroll-behavior:contain}
.qp-studio-route .qp-panel.is-active{display:block!important}.qp-studio-route .qp-panel h3{font-size:15px!important;margin:2px 0 14px!important;line-height:1.5}
.qp-studio-route .qp-panel :is(input:not([type=color]):not([type=range]),textarea,select){background:#fbfcfd!important;border:1px solid #dce5ed!important;border-radius:8px!important;color:var(--qp18-ink)!important;padding:9px!important;font-size:12px!important;max-width:100%!important}
.qp-studio-route .qp-panel .qp13-font-results{max-height:230px!important}
.qp-studio-route .qp-panel textarea{min-height:85px!important;resize:vertical!important}
.qp-studio-route .qp-panel label{line-height:1.65!important}.qp-studio-route .qp-panel button:not(.qp13-font-option){border-radius:8px!important}
.qp-studio-route .qp-workbench{background:#e9eef3!important;min-width:0!important;padding:0 18px 12px!important;border-inline-end:1px solid var(--qp18-line)!important;display:flex!important;flex-direction:column!important;min-height:620px!important}
.qp-studio-route .qp-workbench-head{margin:0 -18px 0!important;background:#fff!important;border-bottom:1px solid var(--qp18-line)!important;min-height:54px!important;padding:8px 19px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;flex-wrap:wrap!important;gap:7px!important}
.qp-studio-route .qp-workbench-head strong{font-size:12px!important}.qp-studio-route .qp-workbench-head small{font-size:10px!important;color:#80909b!important}
.qp-studio-route .qp-workbench-actions button{background:#f8fafb!important;border:1px solid #dce5ee!important;color:#344c5b!important;font-size:10px!important;padding:6px 8px!important;border-radius:7px!important;min-height:31px!important}.qp-studio-route .qp-workbench-actions button:hover{background:#e9f1f9!important}
.qp-studio-route .qprinty-stage-tabs{margin:10px auto 3px!important;justify-content:center!important;gap:5px!important}.qp-studio-route .qprinty-stage-tabs button{padding:6px 17px!important;background:#fff!important;border:1px solid #d5dee7!important;border-radius:7px!important;color:#3e5361!important;font-size:11px!important;min-height:33px!important}.qp-studio-route .qprinty-stage-tabs button.is-active{background:#215f74!important;border-color:#215f74!important;color:#fff!important}
.qp-studio-route .qp-canvas-holder{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;min-height:480px!important;padding:8px!important;overflow:hidden!important;background:transparent!important;border-radius:0!important;flex:1 1 auto!important}
.qp-studio-route .qp-product-stage{width:min(100%,min(64vh,650px))!important;max-width:650px!important;border-radius:4px!important;border:1px solid #d8e0e7!important;background:radial-gradient(circle,#ffffff 20%,#f6f8f8 98%)!important;box-shadow:0 10px 36px #1b3b4a16!important}
.qp-studio-route .qp-product-stage>img{filter:drop-shadow(0 15px 15px #223e4721)!important}
.qp-studio-route .qp-workbench-foot{margin:5px 0!important;gap:9px!important;padding:4px!important}.qp-studio-route .qp-workbench-foot>span{font-size:11px!important;color:#526577!important}
.qp-studio-route .qp-preview-panel{background:#fff!important;display:flex!important;flex-direction:column!important;padding:17px 13px!important;max-height:calc(100vh - 66px)!important;overflow:auto!important;gap:9px!important;min-width:0!important;scrollbar-width:thin}
.qp-studio-route .qp-preview-panel h3{font-size:13px!important;border-bottom:1px solid var(--qp18-line);padding-bottom:10px!important;margin:0!important}.qp-studio-route .qp-mini-preview.qp-live-mockup{height:195px!important;max-width:100%;border-radius:9px!important;background:#f7f9fa!important}.qp-studio-route .qp-preview-panel label{font-size:11px!important}.qp-studio-route .qp-preview-panel>p{font-size:10px!important;line-height:1.8!important;color:#788b97!important}.qp-studio-route .qp-preview-panel>p:not(.qp-preview-hint){display:block!important}.qp-studio-route .qp-preview-panel button{width:100%!important;background:#f9fbfc!important;font-size:11px!important;padding:9px!important;border-radius:8px!important}
.qp-studio-route .qp-order-config{max-width:1200px;margin:12px auto!important;width:calc(100% - 32px)!important}.qp-studio-route .qp-order-submit{margin:0 auto 20px!important;max-width:1200px;width:calc(100% - 32px)!important}
body:has(.qp18-toolbar) .qp-back-product{display:none}
@media(max-width:1320px){.qp-studio-route .qp-designer-shell{grid-template-columns:minmax(274px,305px) minmax(340px,1fr) minmax(195px,220px)!important}.qp-studio-route .qp-sidebar{grid-template-columns:62px minmax(0,1fr)!important}.qp18-toolbar{gap:9px}.qp18-toolbar-middle{gap:4px}.qp18-toolbar .qp18-quiet-button{padding-inline:9px}}
@media(max-width:1080px){.qp-studio-route .qp-designer-shell{grid-template-columns:minmax(270px,308px) minmax(320px,1fr)!important}.qp-studio-route .qp-preview-panel{grid-column:1/-1;max-height:none!important;display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;gap:12px!important;border-top:1px solid var(--qp18-line);padding:10px 20px!important}.qp-studio-route .qp-preview-panel .qp-mini-preview{width:126px!important;height:116px!important}.qp-studio-route .qp-preview-panel>p{max-width:250px}.qp-studio-route .qp-preview-panel button{width:auto!important}.qp18-product{max-width:175px}.qp18-toolbar-middle{margin-inline-start:auto;margin-inline-end:0}}
@media(max-width:760px){.qp18-toolbar{height:auto;min-height:56px;flex-wrap:wrap;padding:9px 10px;gap:6px}.qp18-brandmark{width:30px;height:30px}.qp18-brand b{font-size:15px}.qp18-product-label,.qp18-brand small,.qp18-save-bullet,.qp18-bar-separator{display:none}.qp18-product{max-width:145px}.qp18-product strong{font-size:11px}.qp18-toolbar-middle{order:3;flex:1;justify-content:flex-start}.qp18-toolbar-end{order:4;margin-inline-start:auto}.qp18-toolbar .qp18-quiet-button{display:none}.qp18-toolbar .qp18-cta{padding-inline:9px;font-size:11px}.qp18-toolbar .qp18-menu-button{font-size:11px;padding-inline:8px}.qp-studio-route .qp-designer-shell{display:flex!important;flex-direction:column!important;min-height:0!important}.qp-studio-route .qp-workbench{order:0!important;padding:0 10px 9px!important;min-height:0!important;width:100%!important}.qp-studio-route .qp-workbench-head{margin:0 -10px!important;padding:7px 12px!important}.qp-studio-route .qp-canvas-holder{min-height:330px!important;padding:8px!important}.qp-studio-route .qp-product-stage{width:min(100%,440px)!important}.qp-studio-route .qp-sidebar{order:1!important;display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;grid-template-rows:minmax(260px,auto)!important;width:100%!important;max-height:none!important;min-height:290px!important;border-top:1px solid var(--qp18-line)!important}.qp-studio-route .qp-tool-tabs{display:flex!important;flex-direction:column!important;grid-column:1;grid-row:1;gap:2px!important;padding:7px 4px!important}.qp-studio-route .qp-tool-tabs button{min-height:52px!important;font-size:9px!important}.qp18-tool-icon{font-size:19px}.qp-studio-route .qp-panel{grid-column:2;grid-row:1;max-height:370px!important;min-height:0!important;padding:12px!important}.qp-studio-route .qp-preview-panel{order:2!important;max-height:none!important;display:grid!important;grid-template-columns:110px minmax(0,1fr)!important;padding:10px!important}.qp-studio-route .qp-preview-panel .qp-mini-preview{grid-row:1/5;grid-column:1;width:108px!important;height:122px!important}.qp-studio-route .qp-preview-panel>*{max-width:100%!important}.qp-studio-route .qp-preview-panel h3{grid-column:2}.qp-studio-route .qp-preview-panel>p{display:none!important}.qp-studio-route .qp-preview-panel button{width:100%!important}.qp-studio-route .qp-workbench-actions{gap:3px!important}.qp-studio-route .qp-workbench-actions button{font-size:9px!important;padding:4px 5px!important}.qp-studio-route .qp-order-config,.qp-studio-route .qp-order-submit{width:calc(100% - 16px)!important}}
@media(prefers-reduced-motion:reduce){.qp18-toolbar button{transition:none}}
/* One canonical action per command: desktop header owns history and grid. */
.qp-studio-route .qp-workbench-actions :is(#qp-undo,#qp-redo,#qp-grid){display:none!important}
@media(max-width:760px){
 .qp-studio-route .qp-sidebar{display:flex!important;flex-direction:column!important;max-height:none!important;min-height:0!important}
 .qp-studio-route .qp-tool-tabs{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-template-rows:auto!important;width:100%!important;overflow:visible!important;padding:5px!important;border-inline-end:0!important;border-bottom:1px solid var(--qp18-line)!important;gap:3px!important}
 .qp-studio-route .qp-tool-tabs button{min-height:52px!important;max-height:62px!important;padding:5px 1px!important}
 .qp-studio-route .qp-panel{max-height:370px!important;min-height:0!important;width:100%!important;overflow:auto!important;padding:14px!important}
}
.qp18-context-menu[hidden]{display:none!important}
.qp18-context-menu{position:fixed;z-index:9999;min-width:162px;padding:5px;border-radius:10px;border:1px solid #dae3e9;background:#fff;box-shadow:0 15px 44px #162c4250;display:flex;flex-direction:column;gap:1px;direction:rtl}
.qp18-context-menu button{padding:9px 12px;border:0;background:transparent;text-align:right;font-family:inherit;font-size:12px;color:#20394b;border-radius:7px;cursor:pointer}
.qp18-context-menu button:hover{background:#eaf2f9}
.qp18-shortcuts{border:1px solid #d6e4ed;background:#fff;color:#1b3348;border-radius:15px;padding:26px;max-width:390px;width:calc(100% - 24px);box-shadow:0 28px 90px #12263b55}
.qp18-shortcuts::backdrop{background:#12263b78}.qp18-shortcuts h2{font-family:inherit;font-weight:800;font-size:20px;line-height:1.5;margin:0 0 16px}.qp18-shortcuts dl{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px}.qp18-shortcuts dt{font:700 13px Arial;direction:ltr;background:#eef3f8;border-radius:6px;text-align:center;padding:8px}.qp18-shortcuts dd{font-size:12px;margin:0;align-self:center}.qp18-shortcuts button{margin-top:14px;background:#205e70;color:#fff;border:0;border-radius:8px;padding:9px 22px;cursor:pointer}

.qp18-back-product{padding:7px 10px;display:inline-flex;align-items:center;gap:6px;flex-shrink:0;border-radius:8px;color:#476172!important;border:1px solid transparent;text-decoration:none!important;font-weight:750;font-size:12px}.qp18-back-product:hover{background:#eef3f8;border-color:#d9e4e9}.qp18-toolbar a:focus-visible{outline:2px solid var(--qp18-blue);outline-offset:2px}
@media(max-width:760px){.qp18-back-product{padding:6px}.qp18-back-product span{display:none}}
