/* Shared header actions: 40px control inside a 50px two-layer frame.
   Report toolbars already provide this frame; never add a second one.
   Floating form actions remain owned by action_bar.css. */
html:not(#ui-x) body :is(.pg-head .pg-actions, .sx-top .sx-top-r, .mp-top .mp-tools, .kds-head-actions)
    :is(.pg-btn, .sx-btn, .ex-btn, .btn, .mp-icon-btn, .mp-auto, .mp-backhub, .kds-switch):not(.rp-tb *):not(.ex-menu *):not(.dropdown-menu *):not(.ab-bar *) {
    position: relative; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px !important; min-height: 40px !important;
    margin: 5px !important; padding-top: 0 !important; padding-bottom: 0 !important;
    border-radius: var(--look-control-radius, 12px) !important; clip-path: var(--look-control-clip, none) !important;
}
html:not(#ui-x) body :is(.pg-head .pg-actions, .sx-top .sx-top-r, .mp-top .mp-tools, .kds-head-actions)
    :is(.pg-btn, .sx-btn, .ex-btn, .btn, .mp-icon-btn, .mp-auto, .mp-backhub, .kds-switch):not(.rp-tb *):not(.ex-menu *):not(.dropdown-menu *):not(.ab-bar *)::before {
    content: ''; position: absolute; inset: -5px; pointer-events: none;
    border: 4px solid var(--mc-surface, #fff); border-radius: var(--look-frame-radius, 16px);
    box-shadow: 0 0 0 1px var(--mc-border, #ded7ec), 0 4px 14px rgba(0, 0, 0, .04);
}
html:not(#ui-x) body :is(.pg-head .pg-actions, .sx-top .sx-top-r) {
    align-items: center; flex-wrap: wrap;
}
html:not(#ui-x) body :is(.pg-head .pg-actions, .sx-top .sx-top-r) .ex:not(.rp-tb *) {
    display: inline-flex; align-items: center; min-height: 50px;
}
html:not(#ui-x) body .mp-top .mp-tools .mp-icon-btn {
    width: 40px !important; min-width: 40px; flex-shrink: 0;
}
@media (min-width: 1024px) {
    html:not(#ui-x) body .mp-top .mp-tools .mp-backhub { display: none !important; }
}
/* Match the POS toolbar's two-row breakpoint, including portrait tablets. */
@media (max-width: 1023px) {
    html:not(#ui-x) body .mp-top .mp-tools :is(.mp-tools-main, .mp-tools-extra) > :is(.mp-icon-btn, .mp-auto),
    html:not(#ui-x) body .mp-top .mp-tools .mp-backhub {
        width: calc(100% - 10px) !important; min-width: 0;
    }
}
@media (max-width: 767px), (max-width: 1023px) and (max-height: 500px) {
    html:not(#ui-x) body .pg-head .pg-actions .ex .ex-btn { width: calc(100% - 10px); }
}
@media print {
    html:not(#ui-x) body :is(.pg-head .pg-actions, .sx-top .sx-top-r, .mp-top .mp-tools, .kds-head-actions) { display: none !important; }
}
