/* Staff-only controls. No zoom/scale: text reflows and the viewport remains the layout boundary. */
body.ftaps-app { --ft422-text:14px; --ft422-note:13px; --ft422-label:14px; --ft422-h1:28px; --ft422-h2:20px; --ft422-h3:17px; --ft422-pad:10px; }
body.ftaps-app[data-ft422-size="small"] { --ft422-text:13px; --ft422-note:12px; --ft422-label:13px; --ft422-h1:25px; --ft422-h2:18px; --ft422-h3:16px; --ft422-pad:8px; }
body.ftaps-app[data-ft422-size="large"] { --ft422-text:16px; --ft422-note:15px; --ft422-label:16px; --ft422-h1:32px; --ft422-h2:23px; --ft422-h3:20px; --ft422-pad:12px; }
@media screen {
 body.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) :is(.btn,.button,button,input[type="submit"],input[type="button"],.ftaps-primary,.ftaps-secondary):not(.ftaps-modal-close):not(.ftdoc-paper *):not(.ftag-calendar-head *) {
  box-sizing:border-box!important; height:auto!important; min-height:44px!important; min-width:0!important; max-width:100%!important;
  padding:var(--ft422-pad) 14px!important; font-family:inherit!important; font-size:var(--ft422-text)!important; font-weight:600!important;
  line-height:1.4!important; white-space:normal!important; overflow-wrap:anywhere; text-align:center; gap:8px!important;
  align-items:center; justify-content:center; letter-spacing:normal!important; vertical-align:middle; transform:none!important;
 }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) :is(.btn,.button,button,.ftaps-primary,.ftaps-secondary)>svg { position:static!important; width:18px; height:18px; flex:0 0 18px; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.btn,.button,button,.ftaps-primary,.ftaps-secondary)>span { min-width:0; overflow-wrap:anywhere; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.staff-actions,.ftm-row-actions,.oq-calendar-row-actions,.wonderbox-row-actions,.form-actions,.ftm-form-actions,.oq-calendar-form-actions,.ftdoc-savebar,.ftaps-form-footer,.ft415-editor-footer,.ft412-filter-actions,.ftaps-head-actions,.ftinv-quick-actions) {
  display:flex!important; flex-wrap:wrap!important; align-items:center!important; justify-content:flex-start!important; gap:10px!important; min-width:0; max-width:100%; height:auto!important;
 }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.ftm-row-actions,.oq-calendar-row-actions,.wonderbox-row-actions,.staff-actions)>form { flex:0 1 auto!important; width:auto!important; max-width:100%; margin:0!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.ftm-row-actions,.oq-calendar-row-actions,.wonderbox-row-actions)>a {
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; max-width:100%; padding:8px 12px; border:1px solid #d5deea; border-radius:9px;
  background:#fff; color:#155fa8; font-size:var(--ft422-text)!important; line-height:1.4!important; font-weight:600; text-decoration:none; white-space:normal!important; overflow-wrap:anywhere;
 }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(td,th):not(.ftdoc-paper *) { font-size:var(--ft422-text)!important; line-height:1.5!important; vertical-align:top; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) td :is(.btn,.button,.ftm-inline-form) { margin:3px 4px 3px 0!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(p,label,legend):not(.ftdoc-paper *):not(.eyebrow) { font-size:var(--ft422-label)!important; line-height:1.5!important; overflow-wrap:anywhere; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.small-note,small):not(.ftdoc-paper *) { font-size:var(--ft422-note)!important; line-height:1.5!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not(.ftdoc-paper *) { font-size:var(--ft422-text)!important; line-height:1.5!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) h1:not(.ftdoc-paper *) { font-size:var(--ft422-h1)!important; line-height:1.2!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) h2:not(.ftdoc-paper *) { font-size:var(--ft422-h2)!important; line-height:1.3!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) h3:not(.ftdoc-paper *) { font-size:var(--ft422-h3)!important; line-height:1.4!important; }
 body.ftaps-app :is(.ftaps-nav-button,.ftaps-page-head>div>span,.ftaps-stats article span,.ftaps-profile strong) { font-size:var(--ft422-text)!important; line-height:1.5!important; }
 body.ftaps-app :is(.ftaps-stats article small,.ftaps-profile small) { font-size:var(--ft422-note)!important; line-height:1.5!important; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.staff-edit-tabs,.ftdoc-tabs,.ft344-tabs,.oq-dashboard-tabs,.oq-v345-tabs,.oq-v346-tabs,.ftinv-section-nav,.ftrm-tabs) { display:flex!important; flex-wrap:wrap!important; gap:8px!important; width:100%!important; max-width:100%; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.staff-edit-tabs,.ftdoc-tabs,.ft344-tabs,.oq-dashboard-tabs,.oq-v345-tabs,.oq-v346-tabs,.ftinv-section-nav,.ftrm-tabs) :is(a,button) { flex:0 1 auto!important; white-space:normal!important; min-height:44px!important; padding:10px 12px!important; font-size:var(--ft422-text)!important; line-height:1.4!important; }
 /* A nested save bar and a close footer must not occupy the same sticky bottom position. */
 body.ftaps-app .ft415-dialog :is(.form-actions,.ftm-form-actions,.ftdoc-savebar,.ftaps-form-footer,.oq-calendar-form-actions) { position:static!important; inset:auto!important; margin-top:16px!important; }
 body.ftaps-app .ftaps-modal>header { display:grid!important; grid-template-columns:minmax(0,1fr) 44px!important; gap:12px!important; align-items:start!important; }
 body.ftaps-app .ftaps-modal>header h2 { min-width:0; margin:0!important; overflow-wrap:anywhere; }
 body.ftaps-app .ftaps-modal-close { position:static!important; flex:0 0 44px; width:44px!important; min-width:44px!important; height:44px!important; padding:0!important; font-size:26px!important; line-height:1!important; }
 body.ftaps-app .ft415-editor-footer>small { flex:1 1 220px; min-width:0; }
 body.ftaps-app .ft415-editor-footer>button { flex:0 0 auto; width:auto!important; }
 body.ftaps-app .ftaps-content .ft422-users-layout { display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:18px!important; align-items:start; width:100%!important; }
 body.ftaps-app .ft422-users-layout>* { grid-column:1 / -1!important; min-width:0!important; width:100%!important; max-width:100%!important; }
 body.ftaps-app .ft422-users-list .ftm-user-row { display:grid!important; grid-template-columns:minmax(0,1fr) minmax(180px,.7fr)!important; align-items:start!important; gap:16px!important; padding:18px 0!important; border-bottom:1px solid #e1e7ef; }
 body.ftaps-app .ft422-users-list .ftm-user-row>div { min-width:0; overflow-wrap:anywhere; }
 body.ftaps-app .ft422-users-list .ftm-user-row :is(strong,small,span) { line-height:1.5; }
 body.ftaps-app .ft422-users-list .ftm-user-row small { display:block; margin-top:4px; }
 body.ftaps-app .ftm-permission-grid { display:grid!important; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))!important; gap:8px 16px!important; }
 body.ftaps-app .ftm-permission-grid .check { display:flex!important; align-items:flex-start!important; gap:9px!important; min-height:44px; padding:8px!important; }
 body.ftaps-app .ftm-permission-grid input { flex:0 0 18px; width:18px!important; height:18px!important; margin:3px 0 0!important; }
 body.ftaps-app .ft344-permission-level-grid { display:grid!important; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))!important; gap:12px 16px!important; }
 body.ftaps-app .ft344-permission-level-grid label { display:grid; align-content:start; gap:6px; min-width:0; }
 body.ftaps-app .ftm-permission-group label[hidden] { display:none!important; }
 body.ftaps-app .ft422-section-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
 body.ftaps-app .ft422-section-head>div { flex:1 1 250px; min-width:0; }
 body.ftaps-app .ft422-user-search { display:grid; gap:5px; flex:0 1 340px; min-width:0; width:100%; }
 body.ftaps-app .ft422-user-search input { width:100%; max-width:100%; min-height:44px; border:1px solid #d5deea; border-radius:9px; padding:9px 12px; }
 body.ftaps-app .ft422-delivery-table { table-layout:fixed; width:100%!important; min-width:0!important; }
 body.ftaps-app .ft422-delivery-table :is(td,th) { white-space:normal!important; overflow-wrap:anywhere; padding:14px 12px!important; }
 body.ftaps-app .ft422-delivery-table small { display:block; margin-top:5px; }
 body.ftaps-app .ft422-delivery-state { display:inline-block; padding:5px 8px; border-radius:8px; font-weight:600; background:#eaf2fd; color:#174e84; }
 body.ftaps-app :is(.ft422-state-read,.ft422-state-seen) { background:#e7f6ee; color:#165b3e; }
 body.ftaps-app .ft422-state-warning { background:#fff3d6; color:#725008; }
 body.ftaps-app .ft422-access-warning { color:#87520a; }
 /* Preferences belong to the top bar, outside every editor and independent of permissions. */
 body.ftaps-app .ftaps-topbar { height:auto!important; min-height:76px; flex-wrap:wrap; padding-top:10px!important; padding-bottom:10px!important; gap:12px; }
 body.ftaps-app .ftaps-search { flex:1 1 180px; max-width:340px; }
 body.ftaps-app .ftaps-profile span { min-width:0; }
 body.ftaps-app .ft422-display-tools { display:flex; flex:0 1 auto; flex-wrap:wrap; align-items:flex-end; justify-content:flex-end; gap:10px; min-width:0; margin-left:auto; }
 body.ftaps-app .ft422-size-label { display:grid; gap:3px; font-size:12px; color:#516174; font-weight:600; }
 body.ftaps-app .ft422-size-label select { min-height:44px; min-width:105px; width:100%; max-width:100%; padding:8px 10px; border:1px solid #d5deea; border-radius:9px; background:#fff; color:#233246; font:inherit; font-size:14px; }
 body.ftaps-app .ft422-dashboard-menu { position:relative; min-width:0; margin:0; padding:0; border:0; background:transparent; }
 body.ftaps-app .ft422-dashboard-menu summary { display:list-item; min-height:44px; box-sizing:border-box; padding:10px 12px; border:1px solid #d5deea; border-radius:9px; color:#155fa8; background:#fff; cursor:pointer; font-size:14px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
 body.ftaps-app .ft422-dashboard-options { position:absolute; top:calc(100% + 8px); right:0; z-index:40; width:min(340px,calc(100vw - 28px)); max-height:min(560px,65dvh); overflow:auto; padding:18px; border:1px solid #d5deea; border-radius:12px; background:#fff; box-shadow:0 12px 32px #17283e26; color:#233246; }
 body.ftaps-app .ft422-dashboard-options>label { display:flex; gap:10px; align-items:flex-start; min-height:44px; padding:10px 0; font-size:14px; line-height:1.45; }
 body.ftaps-app .ft422-dashboard-options input { flex:0 0 18px; width:18px; height:18px; margin:1px 0 0; }
 body.ftaps-app .ft422-dashboard-options p { font-size:13px; line-height:1.5; margin:8px 0; }
 body.ftaps-app .ft422-dashboard-options small { display:block; font-size:12px; margin-top:12px; }
 body.ftaps-app .ft422-dashboard-options .ftaps-secondary { min-height:44px; height:auto; padding:10px 12px; margin:8px 4px 0 0; font-size:14px; line-height:1.4; white-space:normal; }
 body.ftaps-app :is([data-ft422-widget],.ftaps-dash-grid,.ftm-user-row,[data-ft422-dashboard-empty])[hidden] { display:none!important; }
 body.ftaps-app .ftaps-dash-grid:not(:has(>.ftaps-panel:not([hidden])~.ftaps-panel:not([hidden])))>.ftaps-panel:not([hidden]) { grid-column:1 / -1; }
 body.ftaps-app :is(.ft422-display-tools,.ft422-users-list) :is(button,a,input,select,summary):focus-visible { outline:3px solid #2575bd; outline-offset:3px; }
 @media(max-width:1200px) {
  body.ftaps-app .ft422-display-tools { order:5; flex:1 0 100%; }
  body.ftaps-app .ftaps-search { max-width:none; }
  body.ftaps-app .ft422-delivery-table,body.ftaps-app .ft422-delivery-table tbody { display:block; }
  body.ftaps-app .ft422-delivery-table thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
  body.ftaps-app .ft422-delivery-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid #e1e7ef; border-radius:10px; margin-bottom:14px; padding:8px; }
  body.ftaps-app .ft422-delivery-table td { display:block; min-width:0; border:0!important; }
  body.ftaps-app .ft422-delivery-table td::before { content:attr(data-label); display:block; font-size:12px; color:#5a697c; font-weight:600; margin-bottom:6px; }
 }
 @media(max-width:760px) {
  body.ftaps-app .ft422-users-list .ftm-user-row { grid-template-columns:minmax(0,1fr)!important; gap:10px!important; }
  body.ftaps-app .ftaps-topbar { position:relative!important; }
  body.ftaps-app .ft422-display-tools { justify-content:space-between; align-items:flex-end; }
  body.ftaps-app .ft422-size-label { flex:0 1 110px; }
  body.ftaps-app .ft422-dashboard-menu { flex:0 1 calc(100% - 120px); }
  body.ftaps-app .ft422-dashboard-menu summary { font-size:13px; }
  body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not(.ftdoc-paper *),body.ftaps-app .ft422-size-label select { font-size:16px!important; }
 }
 @media(max-width:520px) {
  body.ftaps-app .ft422-delivery-table tr { grid-template-columns:minmax(0,1fr); }
  body.ftaps-app .ft422-users-list .ftm-row-actions>* { flex:1 1 135px!important; }
  body.ftaps-app .ft422-users-list .ftm-row-actions>form>button { width:100%; }
 }
}
@media print { body.ftaps-app .ft422-display-tools,body.ftaps-app .ft422-user-search { display:none!important; } }
