/* HSL-400-794: phone-first chrome and shared workspace sizing. Desktop is unchanged. */
@media screen and (max-width:767px) {
 [hidden] { display:none!important; }
 html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
 html,body { min-width:0!important; max-width:100%; }
 body { font-size:16px; line-height:1.45; }
 *,*::before,*::after { box-sizing:border-box; }
 button,.button,input,select,textarea { font-size:16px; }
 button,.button,select,input:not([type=checkbox]):not([type=radio]):not([type=hidden]) { min-height:44px; }
 input:not([type=checkbox]):not([type=radio]),select,textarea { min-width:0; max-width:100%; }
 input[type=checkbox],input[type=radio] { width:20px; height:20px; flex-shrink:0; }
 button,.button { white-space:normal; line-height:1.25; }
 img,video { max-width:100%; }
 h1 { font-size:1.5rem; line-height:1.2; overflow-wrap:anywhere; }
 h2 { font-size:1.25rem; line-height:1.3; overflow-wrap:anywhere; }
 h3 { font-size:1.05rem; line-height:1.35; overflow-wrap:anywhere; }
 p,label { overflow-wrap:anywhere; }
 :focus-visible { outline:3px solid #16859b; outline-offset:3px; }
 /* One scrolling work area, with navigation outside it. */
 body.dashboard-page { height:100dvh; min-height:0; margin:0!important; padding:0!important; display:flex; flex-direction:column; overflow:hidden; }
 .dashboard-page>header.fo-topbar { flex:0 0 auto; min-height:56px; padding:6px max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left)); gap:8px; border-bottom:1px solid #d4e4ea; }
 .fo-mark { min-width:0; gap:7px; }
 .fieldops-mark { width:32px; height:32px; flex-shrink:0; }
 .fo-mark strong { font-size:.9rem; letter-spacing:.02em; }
 .fo-mark small,.fo-company,.fo-search,.fo-chrome-rule { display:none!important; }
 .fo-topbar-meta { gap:0; }
 .fo-icon-btn { width:44px; height:44px; padding:11px; }
 .dashboard-page #containerCapsules { order:10; flex:0 0 auto; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; padding:3px 4px max(3px,env(safe-area-inset-bottom)); border-radius:0!important; border:0; border-top:1px solid #d4e4ea; box-shadow:0 -3px 12px #143c490a; background:#f4fafc; }
 #containerCapsules .nav-module { height:58px; max-height:none; padding:5px 2px; gap:3px; font-size:.75rem; border:0; border-radius:8px!important; background:transparent; }
 #containerCapsules .nav-module:not([data-rail=dashboard]):not([data-rail=jobs]):not([data-rail=schedule]):not([data-rail=system]) { display:none; }
 #containerCapsules .nav-icon { width:24px; height:24px; border:0; border-radius:0; background:transparent; }
 #containerCapsules .nav-icon svg { width:22px; height:22px; }
 #containerCapsules .nav-module::after { display:none; }
 #containerCapsules .nav-module.active { background:#deeff1; color:#104957; }
 #containerCapsules .nav-module.active .nav-icon { background:transparent; color:inherit; }
 .dashboard-page #openContainers { flex:0 0 auto; display:flex; flex-wrap:nowrap; overflow-x:auto; gap:6px; min-height:0; padding:6px 10px; scrollbar-width:thin; background:#eef5f7; }
 #openContainers>strong,#openContainers>span:not(.open-container) { display:none; }
 #openContainers:not(:has(.open-container)) { display:none; }
 .open-container { flex:0 0 auto; max-width:85%; border-radius:8px!important; }
 .open-container button:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:8px 12px; }
 .open-container button:last-child { flex:0 0 44px; }
 .dashboard-page #containerWindows { flex:1 1 0; min-height:0; padding:0!important; margin:0!important; border:0; border-radius:0!important; box-shadow:none; overflow:hidden; }
 .dashboard-page .container-window { display:block; width:100%; height:100%; min-height:0!important; margin:0; padding:0; border:0; border-radius:0!important; }
 .dashboard-page #dashboardHome,.dashboard-page #settingsHome { flex:1 1 0; min-height:0; overflow-y:auto; overscroll-behavior-y:contain; padding:16px 12px 82px; scroll-padding-bottom:80px; }
 .dashboard-page #containerMessage { flex:0 0 auto; margin:0; padding:8px 12px; font-size:.875rem; }
 .dashboard-hero { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
 .dashboard-hero h2 { margin:0; }
 .dashboard-hero .eyebrow { display:none; }
 .dashboard-tiles { display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:12px; }
 .dashboard-tiles>* { grid-column:auto!important; min-width:0; padding:16px; border-radius:12px!important; }
 .dashboard-tiles .workflow { flex-wrap:wrap; }
 .sales-counter-widget { padding:16px; margin-bottom:20px; gap:12px; border-radius:12px!important; }
 .sales-counter-widget h1 { font-size:1.4rem; }
 .counter-start-actions { display:grid; grid-template-columns:minmax(0,1fr); width:100%; max-width:none; gap:8px; }
 .counter-start-actions>* { width:100%; text-align:center; }
 .mobile-module-search { display:grid; gap:6px; margin:0 0 16px; font-weight:600; }
 .mobile-module-search input { width:100%; background:var(--surface,#fff); }
 .settings-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
 .settings-grid .record-card { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; min-width:0; border-radius:10px!important; box-shadow:none; }
 .settings-grid .record-card h3 { margin:0; min-width:0; }
 .settings-grid .record-card button,.settings-grid .record-card .button { flex-shrink:0; }
 /* Embedded modules fill the phone; avoid stacked decorative page frames. */
 .workspace-shell,.workspace-shell-34,.workspace-main,.module-content { min-width:0!important; max-width:100%!important; }
 html.embedded-container body { margin:0!important; padding:0!important; }
 html.embedded-container .workspace-main,html.embedded-container.compact-records .workspace-main,.workspace-main { padding:16px 12px 32px!important; margin:0!important; width:100%!important; border-radius:0!important; }
 .workspace-head { display:flex; flex-direction:column; align-items:stretch; gap:12px; margin-bottom:16px; }
 .workspace-head h1 { margin:0; font-size:1.5rem; }
 .workspace-head .eyebrow { display:none; }
 #moduleDescription:empty { display:none; }
 #moduleDescription { margin:6px 0 0; font-size:.9rem; }
 .head-actions,.record-actions,.button-row { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
 .head-actions>button { flex:1 1 auto; padding:10px 12px; }
 .workspace-toolbar { display:flex; flex-wrap:wrap; gap:8px; padding:10px; margin-bottom:14px; }
 .workspace-toolbar>input,.workspace-toolbar>select { width:100%; flex:1 1 160px; }
 .record-grid,.form-grid,.two-col,.settings-grid { grid-template-columns:minmax(0,1fr)!important; }
 .record-card { min-width:0; max-width:100%; padding:14px; border-radius:12px!important; box-shadow:0 2px 8px #143c4908; }
 .record-card h3,.record-card p { overflow-wrap:anywhere; }
 .record-card .button-row>* { min-height:44px; }
 .module-content { margin:0; padding:0; }
 .table-wrap,.table-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
 /* Dialog has a single scroll surface and reachable actions at phone/keyboard height. */
 dialog { box-sizing:border-box; width:calc(100% - 16px)!important; max-width:560px!important; max-height:calc(100dvh - 16px)!important; padding:0!important; margin:auto!important; border-radius:14px!important; overflow:auto; }
 dialog .dialog-card { width:100%!important; min-width:0!important; max-width:none!important; padding:16px!important; margin:0!important; border-radius:0!important; }
 dialog .title-row { flex-wrap:wrap; align-items:center; gap:8px; }
 dialog .title-row h2 { flex:1 1 130px; margin:0; }
 dialog .dialog-actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:16px; margin-top:16px; border-top:1px solid #d4e4ea; }
 dialog .dialog-actions button { flex:1; min-width:90px; }
 dialog label { min-width:0; }
 dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea { width:100%; }
 .container-close-dialog { padding:20px!important; }
 .dashboard-page .bevis-float.bevis-chat-bubble { width:48px; height:48px; padding:6px; right:12px; bottom:calc(76px + env(safe-area-inset-bottom)); border-radius:50%!important; box-shadow:0 3px 12px #06161d25; }
 .dashboard-page .bevis-float-label { display:none; }
 .dashboard-page .bevis-float b { width:34px; height:34px; }
 .dashboard-page:has(#containerWindows:not([hidden])) .bevis-float { opacity:.9; }
 @media(max-height:500px) { .dashboard-page>header.fo-topbar { min-height:44px; padding-top:0; padding-bottom:0; } #containerCapsules .nav-module { height:48px; } }
}
@media screen and (max-width:767px) {
 body.dashboard-page>header.fo-topbar { flex-direction:row!important; flex-wrap:nowrap!important; align-items:center!important; justify-content:space-between!important; }
 .dashboard-page .fo-topbar-meta { margin-left:auto; flex-direction:row; }
 .workspace-toolbar { flex-direction:row!important; align-items:center!important; }
 .workspace-toolbar>input,.workspace-toolbar>select { flex:1 1 100%; height:44px; min-height:44px; padding:8px 12px; border-radius:8px!important; }
}
@media screen and (max-width:767px) {
 .dashboard-page #openContainers { margin:0!important; }
 html body:not(.it-mode) button,html body:not(.it-mode) .button { border-radius:8px; }
 html body:not(.it-mode) .open-container { border-radius:8px!important; }
 html body:not(.it-mode) .open-container button { border-radius:0!important; }
}
@media screen and (max-width:767px) {
 body.dashboard-page { height:var(--mobile-viewport-height,100dvh); }
 .dashboard-page.mobile-dialog-open .bevis-float { display:none!important; }
 html body:not(.it-mode) .workspace-toolbar input,
 html body:not(.it-mode) .workspace-toolbar select { border-radius:8px!important; }
}
