/* Phone layout is deliberately different from the desktop Azia workspace.
   Existing links, controls and permission-filtered navigation are retained.
   Load after the desktop styles. Print and tablet/desktop geometry are untouched. */
.boq-mobile-main-nav,.boq-mobile-home-nav{display:none}
@media screen and (max-width:767px), screen and (max-width:991px) and (hover:none) and (pointer:coarse) {
  :root {--boq-mobile-rail:64px;--boq-mobile-header:56px;--boq-mobile-vh:100dvh;--boq-mobile-top:0px;--boq-mobile-safe-bottom:env(safe-area-inset-bottom,0px);}
  html {scroll-padding-bottom:calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom) + 16px);}
  html[data-theme] .workspace.boq-sidebar-modern {
    display:block;grid-template-columns:minmax(0,1fr);height:auto;min-height:100dvh;overflow:visible;max-width:100%;
  }
  html[data-theme] .workspace.boq-sidebar-modern>.main-shell {
    display:block;margin-left:0;width:100%;min-width:0;height:auto;min-height:100dvh;overflow:visible;
    padding-top:0;padding-bottom:calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom) + 16px);
  }
  html[data-theme] .workspace.boq-sidebar-modern .main {
    display:block;width:100%;height:auto;min-width:0;min-height:0;max-width:100%;overflow:visible;padding:8px 8px 16px;
  }
  /* Three direct destinations. Desktop section selection is left untouched. */
  html[data-theme] .workspace.boq-sidebar-modern>.sidebar,
  html[data-theme] .workspace.boq-sidebar-modern>.sidebar.open {
    position:fixed;inset:auto 0 0;width:100%;height:calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom));
    padding:0;transform:none;overflow:visible;z-index:100;background:#183ff5;box-shadow:0 -1px 8px #00143a20;
  }
  html[data-theme] .workspace.boq-sidebar-modern .boq-iconbar {
    position:relative;inset:auto;display:flex;flex-direction:row;align-items:stretch;width:100%;height:100%;
    padding:0 4px var(--boq-mobile-safe-bottom);overflow:visible;
  }
  html[data-theme] .sidebar .boq-iconbar-home {
    flex:0 0 calc(100% / 6);width:calc(100% / 6);height:var(--boq-mobile-rail);min-height:44px;margin:0;padding:0 8px;
  }
  .boq-iconbar-home .boq-logo {width:38px;max-width:100%;height:30px;}
  .boq-iconbar-tabs {flex:1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;width:auto;gap:0;min-width:0;}
  html[data-theme] .sidebar .boq-iconbar-tab {
    display:flex;flex-direction:column;gap:4px;width:100%;min-width:0;height:var(--boq-mobile-rail);min-height:44px;
    padding:7px 2px 5px;color:#fff;opacity:.8;border-top:3px solid transparent;
  }
  html[data-theme] .sidebar .boq-iconbar-tab.active,
  html[data-theme] .sidebar .boq-iconbar-tab[data-mobile-current="true"] {border-top-color:#fff;background:#ffffff20;opacity:1;}
  html[data-theme] .sidebar .boq-iconbar-tab::after,
  html[data-theme] .sidebar .boq-iconbar-tab.active::after {
    content:attr(aria-label);position:static;display:block;width:100%;height:auto;min-width:0;max-width:100%;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;line-height:12px;letter-spacing:0;background:transparent;
  }
  .sidebar .boq-iconbar-tab .boq-nav-section-icon {width:23px;height:23px;flex:none;}
  html[data-theme] .workspace.boq-sidebar-modern .boq-sidebar-panel {
    position:fixed;inset:auto 8px calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom) + 8px);
    width:auto;max-width:none;height:auto;max-height:calc(var(--boq-mobile-vh) - var(--boq-mobile-header) - var(--boq-mobile-rail) - var(--boq-mobile-safe-bottom) - 32px);
    min-height:0;padding:14px 16px 16px;border:1px solid #ffffff30;box-shadow:0 8px 32px #00143a40;overflow:hidden;
  }
  html[data-theme] .workspace.boq-sidebar-modern .boq-sidebar-panel[hidden] {display:none!important;}
  .boq-sidebar-panel-header {min-height:44px;margin-bottom:8px;}
  html[data-theme] .sidebar .boq-sidebar-panel-close {width:44px;height:44px;min-height:44px;opacity:1;}
  .boq-sidebar-panel-close>.boq-sidebar-close-back {display:none;}
  .boq-sidebar-panel-close>.boq-sidebar-close-cross {display:block;}
  .boq-sidebar-panel>.boq-sidebar-nav-scroll {flex:1 1 auto;min-height:0;overflow:auto;}
  .sidebar .boq-sidebar-panel .boq-nav-children {padding:0 0 0 12px;}
  html[data-theme] .sidebar .boq-sidebar-panel .nav-link {min-height:48px;padding:10px 6px;font-size:15px;line-height:1.4;}
  .boq-sidebar-panel>.sidebar-note {display:none!important;}
  html[data-theme] .workspace.boq-sidebar-modern>.sidebar>:is(.boq-iconbar,.boq-sidebar-panel){display:none!important}
  html[data-theme] .sidebar>.boq-mobile-main-nav{display:grid;grid-template-columns:repeat(var(--boq-mobile-destinations,3),minmax(0,1fr));height:100%;padding:0 4px var(--boq-mobile-safe-bottom);box-sizing:border-box}
  .boq-mobile-main-nav>a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:44px;min-width:0;padding:5px 3px;border-top:3px solid transparent;color:#fff;text-decoration:none;font-size:11px;line-height:14px;text-align:center;overflow-wrap:anywhere}
  .boq-mobile-main-nav>a[aria-current="page"]{border-top-color:#fff;background:#ffffff20}
  .boq-mobile-main-nav>a>svg{width:24px;height:24px;flex:none}
  .boq-mobile-main-nav>a:focus-visible{outline:2px solid #fff;outline-offset:-4px}
  .home-team>.home-column{display:none!important}
  [data-boq-mobile-desktop-only="true"]{display:none!important}
  .boq-mobile-desktop-message{padding:16px;border:1px solid var(--line);background:var(--white);max-width:100%;box-sizing:border-box}
  .boq-mobile-desktop-message h1{font-size:20px;line-height:1.3;margin:0 0 8px;overflow-wrap:anywhere}
  .boq-mobile-desktop-message p{font-size:14px;line-height:1.5;margin:0 0 12px}
  .boq-mobile-desktop-message nav{display:flex;flex-wrap:wrap;gap:8px}
  .boq-mobile-desktop-message nav>a{min-height:44px;max-width:100%;white-space:normal}
  /* Phone keeps bottom navigation; its header has logo/search/title/controls. */
  html[data-theme] .workspace.boq-sidebar-modern.boq-header-over-sidebar .boq-shell-header.boq-shell-over-sidebar.topbar,
  html[data-theme] .workspace .boq-shell-header.topbar {
    display:grid;grid-template-columns:44px 44px minmax(0,1fr) auto;align-items:center;gap:4px;
    height:calc(var(--boq-mobile-header) + env(safe-area-inset-top,0px));min-height:calc(var(--boq-mobile-header) + env(safe-area-inset-top,0px));
    padding:env(safe-area-inset-top,0px) 8px 0;position:sticky;top:0;z-index:90;overflow:visible;
  }
  .workspace .boq-shell-leading {grid-column:1;grid-row:1;display:flex;width:44px;min-width:0;gap:0;}
  html[data-theme] .workspace .boq-shell-leading .boq-shell-nav-toggle {display:none;}
  html[data-theme] .workspace .boq-shell-leading .boq-shell-brand {width:44px;min-width:44px;height:44px;}
  .workspace .boq-shell-leading .boq-shell-brand .boq-logo {width:40px;height:30px;}
  .workspace .boq-shell-header>.breadcrumb,.workspace .boq-shell-header>.preview {display:none;}
  html[data-theme] .workspace .boq-shell-header>.boq-shell-company {
    position:static;left:auto;transform:none;grid-column:3;grid-row:1;min-width:0;width:100%;max-width:100%;
    margin:0;font-size:11px;letter-spacing:.5px;line-height:20px;text-align:center;
  }
  .workspace .boq-shell-header>.topbar-right,.workspace .boq-shell-header>.boq-shell-controls {
    grid-column:4;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:0;margin:0;min-width:0;width:auto;
  }
  html[data-theme] .workspace .boq-shell-header .boq-shell-icon {width:44px;height:44px;min-height:44px;flex:0 0 44px;}
  .workspace .boq-shell-header .boq-shell-avatar img {width:32px;height:32px;}
  .workspace .boq-site-search {grid-column:2;grid-row:1;width:44px;flex:0 0 44px;height:44px;margin:0;border:0;}
  .workspace .boq-site-search-trigger {width:44px;height:44px;flex:0 0 44px;}
  html[data-theme] .workspace .boq-site-search.is-open {
    position:absolute;left:8px;right:8px;top:calc(100% + 8px);width:auto;height:48px;
    border:1px solid var(--line);padding-right:10px;background:var(--field,var(--white));z-index:181;
  }
  html[data-theme] .workspace .boq-site-search.is-open input {display:block;height:46px;min-height:44px;font-size:16px;}
  .workspace .boq-shell-header .boq-shell-menu {
    position:fixed;top:calc(var(--boq-mobile-top) + var(--boq-mobile-header) + env(safe-area-inset-top,0px) + 8px);
    right:8px;left:auto;bottom:auto;width:min(320px,calc(100vw - 16px));min-width:0;max-width:calc(100vw - 16px);
    max-height:calc(var(--boq-mobile-vh) - var(--boq-mobile-header) - 24px);overflow:auto;overscroll-behavior:contain;
  }
  .workspace .boq-shell-header .boq-shell-menu::before {display:none;}
  html[data-theme] .workspace .boq-shell-menu :is(a,button) {min-height:44px;padding:10px 16px;font-size:15px;}
  .boq-site-search-results {max-height:calc(var(--boq-mobile-vh) - 132px)!important;}
  /* One fixed-height action lane below search. The temporary wrapper keeps
     original controls alive and is removed when returning to the desktop. */
  html[data-theme] .workspace .boq-directory-taskbar {flex-wrap:wrap;align-items:center;gap:4px;padding:6px;min-width:0;}
  html[data-theme] .workspace .boq-directory-taskbar.boq-mobile-taskbar {display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:4px;}
  html[data-theme] .workspace .boq-directory-taskbar>:is(.search,.boq-directory-search) {
    display:flex!important;flex-direction:row;align-items:center;
    flex:1 1 100%;width:100%;min-width:0;max-width:none;height:44px!important;min-height:44px!important;
  }
  html[data-theme] .workspace .boq-directory-taskbar.boq-mobile-taskbar>:is(.search,.boq-directory-search) {flex:none;}
  /* The compound search owns its focus ring; its live input fills the space
     beside the icon instead of retaining a native intrinsic input width. */
  html[data-theme] .workspace .boq-directory-taskbar>:is(.search,.boq-directory-search) input {
    display:block;flex:1 1 0;min-width:0!important;width:100%!important;max-width:none!important;
    height:42px!important;min-height:42px!important;border:0!important;box-shadow:none!important;
  }
  html[data-theme] .workspace .boq-directory-taskbar>:is(.search,.boq-directory-search) input:is(:focus,:focus-visible) {outline:none!important;box-shadow:none!important;}
  html[data-theme] .workspace .boq-directory-taskbar>:is(.search,.boq-directory-search):focus-within {outline:2px solid var(--focus);outline-offset:2px;border-color:var(--boq-ui-focus-border);box-shadow:none;}
  html[data-theme] .workspace .boq-mobile-taskbar-actions {
    display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:4px;flex:none;width:100%;min-width:0;max-width:100%;
    min-height:48px;padding:2px 0;overflow-x:auto;overflow-y:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-padding-inline:2px;
  }
  html[data-theme] .workspace .boq-mobile-taskbar-actions>* {flex:0 0 auto;}
  html[data-theme] .workspace .boq-mobile-taskbar-actions:focus-visible {outline:2px solid var(--teal);outline-offset:-2px;}
  html[data-theme] .workspace :is(.boq-directory-taskbar,.toolbar)>:is(.icon-btn,.boq-action-compact),
  html[data-theme] .workspace .boq-mobile-taskbar-actions>:is(.icon-btn,.boq-action-compact),
  html[data-theme] .workspace :is(.boq-directory-taskbar,.toolbar) :is(.boq-directory-menu,.boq-table-columns)>summary {
    width:44px;height:44px;min-width:44px;min-height:44px;padding:10px!important;flex:none;
  }
  /* Filters and selected-row actions become reachable sheets, not off-screen flyouts. */
  html[data-theme] :is(.boq-compact-table,.boq-directory) .boq-directory-menu>.boq-directory-popup,
  html[data-theme] :is(.boq-compact-table,.boq-directory) .boq-table-columns>.boq-column-choices,
  .ms-selection-menu[open]>div {
    position:fixed;left:8px;right:8px;top:auto;bottom:calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom) + 8px);
    width:auto;min-width:0;max-width:none;max-height:calc(var(--boq-mobile-vh) - var(--boq-mobile-header) - var(--boq-mobile-rail) - 32px);
    overflow:auto;overscroll-behavior:contain;z-index:110;
  }
  html[data-theme] :is(.boq-compact-table,.boq-directory) .boq-directory-popup :is(button,.btn),
  .boq-column-choices label,.ms-selection-menu>div .btn {min-height:44px;align-items:center;}
  html[data-theme] :is(.boq-compact-table,.boq-directory) .boq-directory-menu.advanced-filters>.filter-grid {grid-template-columns:minmax(0,1fr);}
  /* Avoid iOS focus zoom without disabling pinch-to-zoom or user text scaling. */
  html[data-theme] :is(.workspace,dialog,.ms-modal) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
    font-size:16px!important;scroll-margin-block:80px 110px;
  }
  html[data-theme] :is(.field,.form-panel,.modal-body,.ms-modal-body) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) {
    min-height:44px;height:auto;max-width:100%;
  }
  html[data-theme] :is(.workspace,dialog,.ms-modal) input:is([type=checkbox],[type=radio]) {width:22px;height:22px;flex-shrink:0;}
  html[data-theme] :is(dialog,.ms-modal,.form-panel,.term-grid) :is(.btn,.icon-btn) {min-height:44px;}
  html[data-theme] :is(dialog,.ms-modal) .icon-btn {min-width:44px;width:44px;}
  html[data-theme] dialog {
    position:fixed;inset:calc(var(--boq-mobile-top) + 8px) 8px auto;width:calc(100vw - 16px);max-width:none;margin:0;
    max-height:calc(var(--boq-mobile-vh) - 16px);height:auto;padding:0;overflow:auto;overscroll-behavior:contain;
  }
  html[data-theme] dialog.wide,html[data-theme] dialog.crm-modal {width:calc(100vw - 16px);max-width:none;max-height:calc(var(--boq-mobile-vh) - 16px);}
  .modal-head,.modal-body,.modal-foot {padding:12px;}
  .modal-head {gap:8px;align-items:center;}
  .modal-head h2 {font-size:19px;overflow-wrap:anywhere;}
  .modal-foot {flex-wrap:wrap;position:sticky;bottom:0;}
  .modal-foot .btn {flex:1;min-width:0;white-space:normal;}
  .ms-modal-backdrop {padding:8px;align-items:start;}
  .ms-modal {width:100%;max-height:calc(var(--boq-mobile-vh) - 16px);}
  .ms-modal-body {padding:14px;}
  html[data-theme] :is(.field-grid,.term-grid,.settings-grid,.directory-grid,.fn-detail .field-grid,.fn-modal .field-grid,.fn-cash .field-grid) {grid-template-columns:minmax(0,1fr);}
  html[data-theme] :is(dialog,.workspace,.ms-modal) .field-grid {gap:10px;}
  html[data-theme] :is(dialog,.workspace,.ms-modal) .field {gap:4px;font-size:12px;line-height:1.4;}
  html[data-theme] :is(dialog,.workspace,.ms-modal) .field small {font-size:11px;line-height:1.35;}
  .field-grid>.field.full {grid-column:1;}
  /* Only predictable numeric pairs use two columns; long names, departments,
     payment terms and all other forms retain the safe single-column layout. */
  html[data-theme] .workspace .calculation-terms>.field-grid,
  html[data-theme] .workspace .calculation-terms [data-vat-split] {grid-template-columns:repeat(2,minmax(0,1fr));}
  html[data-theme] .workspace .calculation-terms>.field-grid>.full {grid-column:1/-1;}
  html[data-theme] .workspace .calculation-terms>.field-grid>.field:not(.full) {display:flex;flex-direction:column;justify-content:flex-end;}
  html[data-theme] [data-budget-form]>.field-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  html[data-theme] [data-budget-form]>.field-grid>.field:is(:has(input[name="Budget_WBS_Section"]),:has(input[name="Budget_Section_Name"]),.full) {grid-column:1/-1;}
  .project-group-control .field {min-width:0;flex-basis:100%;}
  .form-panel {padding:12px;}
  html[data-theme] .workspace .page-title {flex-wrap:wrap;gap:6px;margin-bottom:8px;}
  html[data-theme] .workspace .page-title h1 {font-size:22px;line-height:1.2;overflow-wrap:anywhere;}
  html[data-theme] .workspace .page-title p {font-size:12px;line-height:1.35;margin-top:4px;}
  html[data-theme] .workspace .heading-stats {display:flex;flex-wrap:nowrap;gap:10px;max-width:100%;overflow-x:auto;white-space:nowrap;font-size:10px;line-height:16px;margin:0;}
  html[data-theme] .workspace .heading-stats>* {flex:none;}
  .page-actions {flex-wrap:wrap;max-width:100%;justify-content:flex-start;gap:6px;}
  .page-actions .btn {min-height:44px;white-space:normal;}
  html[data-theme] .workspace .boqux-breadcrumbs {gap:4px;font-size:9px;letter-spacing:.15px;margin-bottom:4px;line-height:1.3;flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;}
  .boqux-breadcrumbs a {display:inline-flex;align-items:center;min-height:44px;flex:none;}
  .tabs {max-width:100%;overflow-x:auto;flex-wrap:nowrap;gap:20px;overscroll-behavior-x:contain;}
  .tabs>.tab {min-height:44px;flex:none;}
  .notifications {bottom:calc(var(--boq-mobile-rail) + var(--boq-mobile-safe-bottom) + 12px);left:8px;right:8px;max-width:none;}
  /* The homepage uses the shared personal widget grid, never legacy navigation cards. */
  /* Cascades/registries retain their existing controls, arranged top to bottom. */
  .crm-browser-tools {display:flex;flex-wrap:wrap;gap:4px;padding:6px;}
  .crm-browser-tools>.crm-search {flex:1 1 100%;width:100%;min-width:0;max-width:100%;}
  .crm-browser-tools>.crm-search input {height:44px;min-height:44px;width:100%;}
  .crm-browser-tools>.filter-toggle {min-height:44px;padding:8px 0;font-size:14px;white-space:normal;}
  .crm-miller {grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:minmax(0,1fr);overflow:visible;}
  .crm-miller .boq-column-handle {display:none!important;}
  .crm-miller .boq-resizable-heading {padding-right:10px!important;}
  .crm-column {border-right:0;border-bottom:1px solid var(--line);}
  .crm-column h3 {height:44px;font-size:14px;}
  .crm-column-list {height:auto;max-height:240px;min-height:0;}
  .crm-tree-row,.crm-tree-card {height:auto;min-height:48px;}
  .crm-tree-card strong {font-size:15px;line-height:21px;}
  .crm-tree-card small {max-width:80px;font-size:11px;}
  .crm-tree-row>.icon-btn {min-width:44px;min-height:44px;}
  .crm-hierarchy {flex-wrap:wrap;}
  .crm-hierarchy ol {width:100%;}
  .crm-hierarchy li {min-height:44px;height:auto;}
  .ms-registry-viewport {min-height:0;height:auto;overflow:visible;}
  .ms-registries {display:flex;flex-direction:column;gap:14px;min-width:0;min-height:0;height:auto;}
  .ms-registry {min-height:0;overflow:visible;}
  .ms-registry-scroll {flex:none;max-height:400px;min-height:0;overflow:auto;}
  .ms-link-gap,.ms-wires {display:none;}
  .fc-layout {grid-template-columns:minmax(0,1fr);overflow:visible;flex:none;}
  .fc-sidebar,.fc-main,.fn-portal,.fn-page {min-width:0;max-width:100%;overflow:visible;}
  .fn-portal,.fn-page {height:auto;flex:none;}
  .fc-options form {grid-template-columns:minmax(0,1fr)!important;}
  .fc-options form>:is(.field,.btn,.fc-toggles) {grid-column:1!important;grid-row:auto!important;}
  .fc-detail .field-grid,.fc-curves,.fn-curves {grid-template-columns:minmax(0,1fr);}
  .fc-board-panel,.fn-timeline-panel {min-width:0;max-width:100%;}
  .fc-timeline-scroll,.fn-timeline-scroll {max-width:100%;overflow:auto;}
  .fc-board-panel>header {flex-wrap:wrap;padding:12px;}
  html[data-theme] .workspace :is(.fc-zoom,.fc-chart-window,.fn-zoom,.fn-chart-window) .btn {min-width:44px;min-height:44px!important;padding:8px!important;}
  .fc-chart-panel,.fn-chart-panel {padding:12px;min-width:0;max-width:100%;overflow:hidden;}
  .fn-chart {height:240px;}
  .fn-controls .field {min-width:0;flex-basis:100%;}
  .fn-controls .toolbar {margin:0;max-width:100%;}
  /* One shared saved-plan control serves revenue, costs and financial overview. */
  html[data-theme] .workspace .sf-controls {display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:8px;padding:8px;}
  html[data-theme] .workspace .sf-controls .field {width:100%;min-width:0;max-width:none;margin:0;}
  html[data-theme] .workspace .sf-controls :is(select,input) {width:100%;min-width:0;max-width:100%;height:auto!important;min-height:44px!important;}
  html[data-theme] .workspace .sf-controls>.btn {width:100%;min-width:0;min-height:44px;white-space:normal;}
  .fn-totals {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .fn-totals>div {min-width:0;padding:8px;}
  .fn-totals strong {font-size:16px;overflow-wrap:anywhere;}
  .image-editor-body {flex-wrap:wrap;}
  .image-editor-controls {min-width:0;flex-basis:100%;}
  html[data-theme] [data-p7-form="material"]>.field-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  html[data-theme] [data-p7-form="material"]>.field-grid>:not(.field:has(input[type="number"])){grid-column:1/-1}
  html[data-theme] [data-p7-form="material"]>.field-grid>.field:has(input[type="number"]){display:flex;flex-direction:column;justify-content:flex-end;min-width:0}
  html[data-theme] [data-p7-form="material"] .p7-photo{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 0}
  html[data-theme] [data-p7-form="material"] .p7-photo>.image-preview{width:80px;height:80px;max-width:80px;object-fit:contain;flex:none}
  html[data-theme] [data-p7-form="material"] .p7-photo>.field{flex:1 1 180px;min-width:0}
  html[data-theme] [data-p7-form="material"] .p7-photo>:is(.filter-toggle,.help-text){flex:1 1 100%;min-height:44px}
  /* Authentication, employee settings and administration use the same phone
     controls, but do not acquire the ERP's bottom navigation. */
  html[data-theme] body:not(:has(.workspace))>header.boq-shell-header {
    display:flex;align-items:center;flex-wrap:nowrap;gap:4px;position:sticky;top:0;z-index:90;overflow:visible;
    height:calc(var(--boq-mobile-header) + env(safe-area-inset-top,0px));min-height:calc(var(--boq-mobile-header) + env(safe-area-inset-top,0px));
    padding:env(safe-area-inset-top,0px) 8px 0;max-width:100%;white-space:normal;
  }
  body:not(:has(.workspace))>header.boq-shell-header>.brand {order:0;flex:0 0 44px;width:44px;margin:0;padding:0;}
  body:not(:has(.workspace))>header.boq-shell-header .brand .boq-logo {width:44px;height:32px;}
  body:not(:has(.workspace))>header.boq-shell-header>.preview {display:none;}
  html[data-theme] body:not(:has(.workspace))>header.boq-shell-header>.boq-shell-company {
    position:static;left:auto;transform:none;order:2;flex:1 1 auto;min-width:0;max-width:none;width:auto;
    font-size:11px;line-height:20px;letter-spacing:.3px;margin:0;text-align:center;
  }
  body:not(:has(.workspace))>header.boq-shell-header>.boq-shell-controls {order:3;gap:0;flex:0 0 auto;margin-left:auto;flex-wrap:nowrap;}
  body:not(:has(.workspace))>header.boq-shell-header>[data-shell-account] {order:4;flex:none;margin-left:0;}
  html[data-theme] body:not(:has(.workspace))>header.boq-shell-header .boq-shell-icon {width:44px;height:44px;min-height:44px;}
  body:not(:has(.workspace))>header.boq-shell-header>.boq-site-search {order:1;flex:0 0 44px;width:44px;height:44px;margin:0;border:0;}
  body:not(:has(.workspace))>header.boq-shell-header .boq-site-search-trigger {width:44px;height:44px;flex-basis:44px;}
  body:not(:has(.workspace))>header.boq-shell-header>.boq-site-search.is-open {
    position:absolute;left:8px;right:8px;top:calc(100% + 8px);width:auto;height:48px;flex:none;border:1px solid var(--line);z-index:181;
  }
  body:not(:has(.workspace))>header.boq-shell-header>.boq-site-search.is-open input {display:block;font-size:16px;height:46px;min-height:44px;}
  body:not(:has(.workspace))>header.boq-shell-header .boq-shell-menu {
    position:fixed;top:calc(var(--boq-mobile-top) + var(--boq-mobile-header) + env(safe-area-inset-top,0px) + 8px);
    left:auto;right:8px;width:min(320px,calc(100vw - 16px));min-width:0;max-width:calc(100vw - 16px);
    max-height:calc(var(--boq-mobile-vh) - var(--boq-mobile-header) - 24px);overflow:auto;
  }
  body:not(:has(.workspace))>header.boq-shell-header .boq-shell-menu::before {display:none;}
  html[data-theme] body:not(:has(.workspace))>header.boq-shell-header .boq-shell-menu :is(button,a) {min-height:44px;padding:10px 16px;font-size:15px;}
  html[data-theme] body:not(:has(.workspace))>main#main {width:100%;max-width:100%;min-width:0;margin:20px auto;padding:0 12px;}
  body:not(:has(.workspace)) :is(.grid,.team) {grid-template-columns:minmax(0,1fr);gap:14px;}
  body:not(:has(.workspace)) :is(.card,.narrow,.narrow-left,form,fieldset) {min-width:0;max-width:100%;}
  body:not(:has(.workspace)) .card {padding:16px;}
  html[data-theme] body:not(:has(.workspace)) #main :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
    font-size:16px;min-height:44px;max-width:100%;scroll-margin-block:80px 24px;
  }
  html[data-theme] body:not(:has(.workspace)) #main :is(button,.button) {min-height:44px;white-space:normal;}
  body:not(:has(.workspace)) #main input:is([type=checkbox],[type=radio]) {width:22px;height:22px;flex:none;}
  body:not(:has(.workspace)) .permission-portal {max-width:100%;overflow:auto;overscroll-behavior:contain;}
  body:not(:has(.workspace)) .permission-matrix th:first-child {min-width:160px;width:160px;max-width:160px;font-size:13px;white-space:normal;overflow-wrap:anywhere;}
  body:not(:has(.workspace)) dl {grid-template-columns:100px minmax(0,1fr);gap:8px;}
  /* The keyboard temporarily owns the bottom of the viewport. */
  html[data-boq-mobile-keyboard="true"] .workspace.boq-sidebar-modern>.sidebar {display:none!important;}
  html[data-boq-mobile-keyboard="true"] .boq-site-search-results {max-height:calc(var(--boq-mobile-vh) - 132px)!important;}
}
