/* Dev 6: compact Jobs, Quotes and Customers; desktop and other modules retain their layout. */
@media screen and (max-width: 600px) {
  html.compact-records .workspace-main,
  html.embedded-container.compact-records .workspace-main {
    padding: 12px 10px 24px !important;
    min-width: 0;
  }
  .compact-records .workspace-head { gap: 8px; margin-bottom: 10px; }
  .compact-records .workspace-head .eyebrow { display: none; }
  .compact-records .workspace-head h1 { font-size: 1.5rem; margin: 0; }
  .compact-records #moduleDescription { font-size: .85rem; margin: 4px 0; }
  .compact-records .head-actions { gap: 8px; }
  .compact-records .head-actions button { min-height: 44px; padding: 8px 12px; }
  .compact-records .workspace-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; margin: 0 0 10px; min-width: 0; }
  .compact-records .workspace-toolbar select,
  .compact-records .workspace-toolbar input { width: 100%; min-width: 0; box-sizing: border-box; font-size: 16px; }
  .compact-records .job-view-switch { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
  .compact-records .job-view-switch button { flex: 1 1 auto; min-height: 44px; padding: 7px 9px; font-size: .8rem; white-space: normal; }
  .compact-records .module-content { padding: 0; margin-top: 0; }
  .compact-records .job-board.record-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .compact-records .job-board .record-card { min-width: 0; padding: 12px; gap: 5px; border-radius: 10px !important; box-shadow: none; }
  .compact-records .job-board .record-card > .pill { justify-self: start; font-size: .72rem; padding: 3px 8px; }
  .compact-records .job-board .record-card h3 { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
  .compact-records .job-board .record-card p { font-size: .85rem; line-height: 1.4; overflow-wrap: anywhere; }
  .compact-records .job-board .button-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 3px 0 0; }
  .compact-records .job-board .button-row button { min-height: 44px; padding: 8px 12px; font-size: .85rem; }
}
/* Mobile scheduling uses date groups rather than a clipped seven-column grid. */
.cal-mobile-date { display: none; }
@media screen and (max-width:600px) {
 html.scheduler-look .workspace-main { padding: 10px !important; }
 .scheduler-look .cal-page,.scheduler-look .cal-shell,.scheduler-look .cal-board,.scheduler-look .cal-week-board { width:100%;min-width:0;max-width:100%;box-sizing:border-box; }
 .scheduler-look .cal-page { overflow:visible; }
 .scheduler-look .cal-hero { padding:12px;gap:10px; }
 .scheduler-look .cal-hero h2 { font-size:1.4rem; }
 .scheduler-look .cal-kpis { gap:12px; }
 .scheduler-look .cal-kpis b { font-size:1rem;overflow-wrap:anywhere; }
 .scheduler-look .cal-shell { display:flex;flex-direction:column; }
 .scheduler-look .cal-board { order:0; }
 .scheduler-look .cal-pool { order:1;min-width:0;min-height:0;box-sizing:border-box; }
 .scheduler-look .cal-board-bar { padding:8px;gap:8px; }
 .scheduler-look .calendar-scope-switch,.scheduler-look .calendar-navigation,.scheduler-look .cal-board-bar .view-switch { display:flex;flex-wrap:wrap;gap:4px;width:100%;min-width:0;margin:0;box-sizing:border-box; }
 .scheduler-look .cal-board-bar button { min-height:44px;white-space:normal;flex:1;padding:8px;font-size:.8rem; }
 .scheduler-look .calendar-navigation strong { order:-1;flex-basis:100%;text-align:center;overflow-wrap:anywhere; }
 .scheduler-look .calendar-grid.month { width:100%;min-width:0;grid-template-columns:minmax(0,1fr);gap:6px;padding:8px;box-sizing:border-box; }
 .scheduler-look .scheduler-34 .calendar-day { min-width:0;min-height:0;overflow:visible; }
 .scheduler-look .calendar-day-content { min-height:0;padding:10px;gap:6px; }
 .scheduler-look .calendar-job { min-width:0;min-height:44px;padding:10px;margin:4px 0;overflow-wrap:anywhere;box-sizing:border-box; }
 .scheduler-look .calendar-job b { font-size:.95rem;line-height:1.3; }
 .scheduler-look .cal-week-head,.scheduler-look .cal-hours,.scheduler-look .cal-allday,.scheduler-look .cal-hour-line { display:none; }
 .scheduler-look .cal-week-body { display:block;max-height:none;overflow:visible; }
 .scheduler-look .cal-cols { display:flex;flex-direction:column;gap:6px;padding:8px; }
 .scheduler-look .cal-mobile-date { display:grid;gap:4px;padding:10px; }
 .scheduler-look .cal-mobile-date small { font-size:.8rem; }
 .scheduler-look .cal-slots { display:flex;flex-direction:column;gap:4px;padding:0 10px 10px; }
 .scheduler-look .cal-block { position:static;top:auto!important;height:auto!important;left:auto;right:auto;width:100%;overflow:visible; }
 .scheduler-look .cal-foot { gap:8px;flex-wrap:wrap; }
 .scheduler-look .cal-job,.scheduler-look .cal-job b,.scheduler-look .calendar-list-event { overflow-wrap:anywhere;min-width:0; }
 .scheduler-look .cal-pool input,.scheduler-look .cal-pool select { min-width:0;box-sizing:border-box;font-size:16px; }
 .scheduler-look .calendar-list-event { display:flex;flex-wrap:wrap; }
 .scheduler-look .calendar-list-event>div { min-width:0;max-width:100%; }
}
@media screen and (max-width:600px) {
 .compact-records .job-board .record-card .inventory-thumb { width:100%;max-width:100%;height:100px;object-fit:contain;box-sizing:border-box; }
 .compact-records .workspace-toolbar .inventory-filter { display:grid;grid-template-columns:60px minmax(0,1fr);min-width:0;max-width:100%; }
 .compact-records .workspace-toolbar .inventory-filter select { min-width:0;width:100%; }
 .compact-records .workspace-toolbar .production-badge { white-space:normal;overflow-wrap:anywhere; }
 .compact-records .inventory-sheet { max-width:100%;width:100%;min-width:0;box-sizing:border-box;overflow:auto; }
 .compact-records .inventory-view-table { min-width:700px; }
 .compact-records .inventory-sheet input,.compact-records .inventory-sheet select { min-height:44px;font-size:16px; }
 .compact-records .inventory-sheet button { min-height:44px; }
 .compact-records .metric-strip { min-width:0;grid-template-columns:repeat(2,minmax(0,1fr)); }
 .compact-records .metric-card { min-width:0;overflow-wrap:anywhere; }
}
@media screen and (max-width:600px) {
 .compact-records #reportsHub,.compact-records #reportResult { min-width:0;max-width:100%; }
 .compact-records #reportsHub .it-panel,.compact-records #reportResult .it-panel { min-width:0;max-width:100%;padding:10px;box-sizing:border-box; }
 .compact-records #reportsHub .record-grid { grid-template-columns:minmax(0,1fr);gap:8px; }
 .compact-records #reportsHub .record-card { min-width:0;padding:12px;box-sizing:border-box;box-shadow:none; }
 .compact-records #reportsHub .record-card h3 { margin:0 0 6px;font-size:1rem;line-height:1.3;overflow-wrap:anywhere; }
 .compact-records #reportsHub .record-card p { margin:0 0 10px;font-size:.9rem;line-height:1.4;overflow-wrap:anywhere; }
 .compact-records #reportsHub .record-card button { min-height:44px;padding:8px 14px; }
 .compact-records #reportResult .title-row { flex-wrap:wrap;min-width:0;gap:6px; }
 .compact-records #reportResult h3,.compact-records #reportResult small { max-width:100%;overflow-wrap:anywhere; }
 .compact-records #reportResult .table-scroll { max-width:100%;min-width:0;overflow:auto; }
}
@media screen and (max-width:600px) {
 .compact-records .financial-table-wrap { border:0;background:transparent;overflow:visible;min-width:0; }
 .compact-records .financial-list { display:block;min-width:0;width:100%; }
 /* Keep column headings available to assistive technology. */
 .compact-records .financial-list thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
 .compact-records .financial-list tbody { display:grid;gap:8px; }
 .compact-records .financial-list tbody tr { display:block;min-width:0;padding:12px;background:var(--fo-color-surface,#fff);border:1px solid #d8e0dc;border-radius:10px; }
 .compact-records .financial-list td { display:block;min-width:0;padding:4px 0;border:0;text-align:left;overflow-wrap:anywhere; }
 .compact-records .financial-list td[data-label]::before { content:attr(data-label);display:block;font-size:.7rem;font-weight:600;color:var(--fo-color-muted,#5d717a);margin-bottom:2px; }
 .compact-records .financial-list td:first-child b { font-size:1rem; }
 .compact-records .financial-list .record-actions { display:flex;flex-wrap:wrap;gap:6px;min-width:0; }
 .compact-records .financial-list .record-actions button { min-height:44px;padding:8px 12px;white-space:normal; }
}
@media screen and (max-width:600px) {
 .mobile-media #moduleContent,.mobile-media #moduleContent>section { min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere; }
 .mobile-media #moduleContent>.it-panel { padding:12px;margin-bottom:10px; }
 .mobile-media #moduleContent label { display:grid;gap:6px;min-width:0;max-width:100%;margin:12px 0; }
 .mobile-media #moduleContent select,.mobile-media #moduleContent input:not([type=checkbox]) { width:100%;min-width:0;max-width:100%;box-sizing:border-box;font-size:16px;min-height:44px; }
 .mobile-media #moduleContent input[type=file] { padding:8px;font-size:.85rem; }
 .mobile-media #moduleContent input[type=file]::file-selector-button { max-width:100%;min-height:44px;white-space:normal; }
 .mobile-media #moduleContent button { min-width:0;max-width:100%;min-height:44px;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere; }
 .mobile-media [data-upload],.mobile-media [data-project] { width:100%; }
 .mobile-media [data-folder] .record-grid { grid-template-columns:minmax(0,1fr);gap:8px; }
 .mobile-media [data-folder] .record-card { min-width:0;padding:12px;overflow-wrap:anywhere; }
 .mobile-media [data-folder] img,.mobile-media [data-folder] video { max-width:100%;height:auto; }
}
@media screen and (max-width:600px) {
 .gps-module-shell,.gps-module-shell>.it-panel { min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere; }
 .gps-module-shell>.it-panel { padding:12px; }
 .gps-module-shell .table-scroll { min-width:0;max-width:100%;overflow:visible; }
 .gps-measurement-list { display:block;width:100%;min-width:0; }
 .gps-measurement-list thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
 .gps-measurement-list tbody { display:grid;gap:8px; }
 .gps-measurement-list tbody tr { display:block;min-width:0;padding:12px;border:1px solid #d8e0dc;border-radius:10px; }
 .gps-measurement-list td { display:block;min-width:0;padding:4px 0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere; }
 .gps-measurement-list td[data-label]::before { content:attr(data-label);display:block;font-size:.7rem;font-weight:600;color:var(--fo-color-muted,#5d717a);margin-bottom:3px; }
 .gps-measurement-list td b { font-size:1rem;line-height:1.35; }
 .gps-measurement-list button { min-height:44px;max-width:100%;white-space:normal;margin:3px 6px 3px 0; }
}
@media screen and (max-width:600px) {
 .profile-layout { width:100%;min-width:0;max-width:100%;grid-template-columns:minmax(0,1fr); }
 .profile-layout .profile-card { min-width:0;max-width:100%;width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 .profile-header { grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:16px;padding-bottom:14px; }
 .profile-photo-panel { flex-direction:column;align-items:flex-start;width:100%;min-width:0;gap:10px; }
 .profile-photo-panel img { width:80px;height:80px; }
 .profile-photo-actions { width:100%;min-width:0; }
 .profile-photo-actions .button,.profile-photo-actions button { box-sizing:border-box;min-height:44px;max-width:100%;white-space:normal;text-align:center; }
 .profile-form-grid { grid-template-columns:minmax(0,1fr);gap:12px; }
 .profile-form-grid input,.profile-form-grid textarea { min-width:0;max-width:100%;font-size:16px;min-height:44px; }
 .profile-form-actions { margin-top:14px;padding-top:12px; }
 .profile-form-actions button { width:100%;min-width:0;min-height:44px; }
 .profile-layout .title-row { flex-wrap:wrap;min-width:0; }
 .profile-layout .title-row>div { min-width:0;max-width:100%; }
 .profile-layout button { max-width:100%;min-height:44px;white-space:normal; }
 .profile-cert-scroll { width:100%;max-width:100%;min-width:0;overflow:auto; }
 .profile-cert-scroll table { min-width:600px; }
}
@media screen and (max-width:600px) {
 body .feature-truth-panel.feature-truth-panel { width:100%;min-width:0;max-width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body .feature-truth-panel.feature-truth-panel .title-row { display:flex;flex-direction:column;align-items:stretch;gap:12px; }
 body .feature-truth-panel.feature-truth-panel .title-row>div { min-width:0;max-width:100%; }
 body .feature-truth-panel.feature-truth-panel .version-block { text-align:left;min-width:0;max-width:100%; }
 body .feature-truth-panel.feature-truth-panel .version-block strong { font-size:1.4rem;overflow-wrap:anywhere; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-toolbar { display:flex;flex-direction:column;align-items:stretch;gap:8px; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-toolbar label { min-width:0;width:100%;max-width:100%; }
 body .feature-truth-panel.feature-truth-panel input { min-width:0;max-width:100%;width:100%;box-sizing:border-box;font-size:16px;min-height:44px; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-counts { display:flex;flex-wrap:wrap;gap:6px; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-layout { display:grid;grid-template-columns:minmax(0,1fr);gap:10px; }
 body .feature-truth-panel.feature-truth-panel .table-scroll { width:100%;min-width:0;max-width:100%;overflow:auto; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-detail { min-width:0;max-width:100%;max-height:none;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-detail dl { display:grid;grid-template-columns:minmax(0,1fr);gap:4px; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-detail dd { margin:0 0 8px;min-width:0; }
 body .feature-truth-panel.feature-truth-panel .feature-truth-evidence small { grid-template-columns:minmax(0,1fr);min-width:0;overflow-wrap:anywhere; }
 body .feature-truth-panel.feature-truth-panel button,body .feature-truth-panel.feature-truth-panel .feature-truth-accept-actions button,body .feature-truth-panel.feature-truth-panel .feature-truth-counts .pill { min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere; }
}
@media screen and (max-width:600px) {
 body [module-settings-hub].it-panel { width:100%;min-width:0;max-width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body [module-settings-hub] .title-row { display:flex;flex-direction:column;align-items:stretch;gap:12px; }
 body [module-settings-hub] .title-row>div { min-width:0;max-width:100%; }
 body [module-settings-hub] .title-row h2 { font-size:1.4rem; }
 body [module-settings-hub] .title-row .button-row { display:flex;flex-direction:column;align-items:stretch;gap:8px;width:100%; }
 body [module-settings-hub] .title-row .button-row button { width:100%!important;min-width:0;max-width:100%;min-height:44px;white-space:normal;box-sizing:border-box; }
 body [module-settings-hub]>label { display:flex;align-items:center;gap:8px;min-height:44px;margin:12px 0; }
 body [module-settings-hub] .table-scroll { min-width:0;width:100%;max-width:100%;overflow:auto; }
 body [module-settings-hub] .module-settings-table { min-width:650px; }
 body [module-settings-hub] .module-settings-table button { min-height:44px; }
}
@media screen and (max-width:600px) {
 body .estimate-pricing-panel.it-panel { min-width:0;max-width:100%;width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body .estimate-pricing-panel .title-row { display:flex;flex-direction:column;align-items:flex-start;gap:10px; }
 body .estimate-pricing-panel .title-row>div { min-width:0;max-width:100%; }
 body .estimate-pricing-panel h2 { font-size:1.4rem;line-height:1.3; }
 body .estimate-pricing-panel form { display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%; }
 body .estimate-pricing-panel label { display:grid;gap:6px;min-width:0;margin:0; }
 body .estimate-pricing-panel input,body .estimate-pricing-panel textarea { width:100%;min-width:0;max-width:100%;box-sizing:border-box;min-height:44px;font-size:16px; }
 body .estimate-pricing-panel button { min-width:0;max-width:100%;width:100%;min-height:44px;white-space:normal; }
}

/* IT inventory: keep panel minimums inside the phone viewport. */
@media screen and (max-width:600px) {
 body .it-inventory-panel.it-grid { grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%; }
 body .it-inventory-panel .it-panel { min-width:0;max-width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body .it-inventory-panel .title-row { flex-direction:column;align-items:stretch;gap:10px; }
 body .it-inventory-panel .title-row>div,body .it-inventory-panel .setting-card { min-width:0;max-width:100%;box-sizing:border-box; }
 body .it-inventory-panel .setting-card { display:grid;gap:8px; }
 body .it-inventory-panel h2 { font-size:1.4rem;line-height:1.3; }
 body .it-inventory-panel button { max-width:100%;min-height:44px;white-space:normal; }
 body .it-inventory-panel .table-scroll { min-width:0;max-width:100%;overflow-x:auto; }
 body .it-inventory-panel input { font-size:16px;min-height:44px;box-sizing:border-box; }
}

/* Connections: nested provider/calendar grids must shrink with their panel. */
@media screen and (max-width:600px) {
 body .it-connect-panel.it-grid,body .it-connect-panel .it-grid { grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%; }
 body .it-connect-panel .it-panel,body .it-connect-panel .setting-card { min-width:0;max-width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body .it-connect-panel .title-row { flex-direction:column;align-items:flex-start;gap:10px; }
 body .it-connect-panel h2 { font-size:1.4rem;line-height:1.3; }
 body .it-connect-panel form,body .it-connect-panel fieldset,body .it-connect-panel label,body .it-connect-panel .title-row>div { min-width:0;max-width:100%;box-sizing:border-box; }
 body .it-connect-panel input:not([type=radio]):not([type=checkbox]),body .it-connect-panel select { width:100%;min-width:0;max-width:100%;min-height:44px;font-size:16px;box-sizing:border-box; }
 body .it-connect-panel button { min-width:0;box-sizing:border-box;max-width:100%;min-height:44px;white-space:normal; }
 body .it-connect-panel .button-row { flex-wrap:wrap;min-width:0; }
}

/* Bevis profile editing: stack controls within the available phone width. */
@media screen and (max-width:600px) {
 body #bevisProfiles.it-panel { min-width:0;max-width:100%;padding:12px;box-sizing:border-box;overflow-wrap:anywhere; }
 body #bevisProfiles .assistant-profile-grid { grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%; }
 body #bevisProfiles .assistant-profile { min-width:0;max-width:100%;padding:12px;box-sizing:border-box;display:grid;gap:10px; }
 body #bevisProfiles .title-row { flex-direction:column;align-items:stretch;gap:12px; }
 body #bevisProfiles .title-row>div { min-width:0;max-width:100%; }
 body #bevisProfiles label { display:block;min-width:0;max-width:100%; }
 body #bevisProfiles input:not([type=checkbox]),body #bevisProfiles select { display:block;width:100%;min-width:0;max-width:100%;min-height:44px;font-size:16px;box-sizing:border-box;margin-top:6px; }
 body #bevisProfiles h2 { font-size:1.4rem;line-height:1.3; }
 body #bevisProfiles .dialog-actions { flex-wrap:wrap;min-width:0; }
 body #bevisProfiles button { min-width:0;max-width:100%;box-sizing:border-box;white-space:normal;min-height:44px; }
}

/* Phone chat: keep header and composer in flow; conversation owns normal scrolling. */
@media screen and (max-width:600px) {
 body #bevis { box-sizing:border-box;width:calc(100% - 16px);max-width:calc(100% - 16px);max-height:calc(100dvh - 16px);margin:auto;overflow:auto; }
 body #bevis .bevis-panel-34 { width:100%;height:auto;min-height:0;max-height:none;padding:10px;gap:10px;display:flex;flex-direction:column;overflow:visible; }
 body #bevis .bevis-header { position:static;padding:10px;gap:8px;flex-direction:row;flex-wrap:wrap;flex-shrink:0;min-height:0;height:auto; }
 body #bevis .bevis-brand { min-width:0;flex:1 1 150px;overflow-wrap:anywhere; }
 body #bevis .bevis-brand>div { min-width:0; }
 body #bevis .bevis-orb { width:32px;height:32px; }
 body #bevis .bevis-conversation { height:clamp(90px,25dvh,220px);min-height:90px;flex-shrink:0;padding:8px; }
 body #bevis .bevis-message { box-sizing:border-box;max-width:100%;flex-shrink:0; }
 body #bevis .bevis-suggestions { gap:6px; }
 body #bevis .bevis-suggestions button { min-width:0;max-width:100%;white-space:normal; }
 body #bevis .bevis-composer textarea { width:100%;height:64px;min-height:64px;font-size:16px; }
 body #bevis .bevis-composer-actions { gap:6px; }
 body #bevis .bevis-composer-actions button { min-width:0;flex:1 1 auto;box-sizing:border-box; }
 body:has(#bevis[open]) .bevis-float { display:none!important; }
}
