/* Mobile contract: one breakpoint, native page scrolling, visible-bottom navigation, restrained
   surfaces, readable fields and full-width window headers. Loaded after desktop. */
.status-tabs .status-tab-label { font: inherit; }
.create-job-icon { display: none; }
button[data-schedule-icon] { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
button[data-schedule-icon] svg { display: block; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; }
.schedule-chevron-left { transform: rotate(180deg); }
#calendarLegend { display: grid; align-items: stretch; gap: 8px; height: auto; padding: 10px 12px; }
.calendar-people-toolbar { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.calendar-people-picker { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #b5c8df; border-radius: 10px; color: #254b78; background: #f3f7fd; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; }
.calendar-people-picker > span { display: block; min-width: 0; overflow-wrap: anywhere; }
.calendar-people-picker svg { flex: 0 0 18px; width: 18px; height: 18px; }
.calendar-people-down { transform: rotate(90deg); margin-left: auto; }
.calendar-people-chips { display: flex; gap: 6px; min-width: 0; max-width: 100%; padding: 2px; overflow-x: auto; overscroll-behavior-x: contain; }
.calendar-people-chips button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; min-height: 44px; max-width: 230px; padding: 8px 10px; border: 1px solid #c7d5e6; border-radius: 9px; background: #fff; color: #334d6e; font-size: 12px; line-height: 1.3; }
.calendar-people-chips button[aria-pressed="true"] { color: #174ea6; border-color: #3976ce; background: #e7f0ff; box-shadow: inset 0 0 0 1px #3976ce; }
.calendar-people-chips i, .calendar-people-list i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
#calendarTechniciansDialog { width: min(480px, calc(100vw - 24px)); padding: 16px; color: #203c5c; background: #fff; border: 1px solid #b5c8df; border-radius: 16px; }
#calendarTechniciansDialog[open] { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
#calendarTechniciansDialog header { margin: -16px -16px 0; padding: 16px; border-radius: 15px 15px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
#calendarTechniciansDialog h2 { margin: 0; font-size: 20px; }
#calendarTechniciansDialog p { margin: 0; font-size: 14px; color: #52657b; }
.calendar-people-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-people-tools button { min-height: 44px; padding: 8px 10px; border: 1px solid #b5c8df; border-radius: 8px; background: #f3f7fd; color: #254b78; }
.calendar-people-list { display: grid; gap: 6px; min-height: 0; overflow-y: auto; max-height: 44vh; max-height: 44dvh; overscroll-behavior: contain; }
.calendar-people-list label { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px; border: 1px solid #c7d5e6; border-radius: 9px; }
.calendar-people-list label:has(input:checked) { background: #e7f0ff; border-color: #3976ce; }
.calendar-people-list input { flex: 0 0 20px; width: 20px; height: 20px; accent-color: #205cca; }
.calendar-people-list span { min-width: 0; overflow-wrap: anywhere; }
#calendarTechniciansDialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
    --ink: #172b46;
    --muted: #52657b;
    --line: #d2dce8;
    --shadow: 0 2px 8px #162c4810;
  }
  html { scroll-padding-top: 126px; }
  body { background: #f3f6fa; color: var(--ink); padding: 0; -webkit-text-size-adjust: 100%; }
  body, button, input, select, textarea { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
  *, *::before, *::after { box-sizing: border-box; }
  .sidebar { display: none; }
  .app-shell { margin: 0; padding: 0 12px 20px; min-width: 0; }
  .app-shell > *, .workspace > *, .form-grid > *, .settings-content > * { min-width: 0; }
  .topbar {
    position: sticky; top: 0; z-index: 35; display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    align-items: center; gap: 8px; margin: 0 -12px 16px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--line); background: #f3f6fa; box-shadow: none;
  }
  .mobile-menu { display: grid; place-content: center; gap: 4px; width: 44px; height: 44px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .mobile-menu span { width: 18px; height: 2px; background: #334a68; }
  .page-title { grid-column: 2 / 4; }
  .page-title :is(.eyebrow, p) { display: none; }
  .page-title h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.03em; }
  .page-title h1:focus { outline: none; }
  .top-actions { display: contents; }
  #notificationButton { grid-column: 4; grid-row: 1; }
  #globalSearchButton { grid-column: 1 / 4; grid-row: 2; width: 100%; min-width: 0; margin: 0; padding: 0 12px; justify-content: flex-start; }
  #globalSearchButton span { display: block; font-size: 14px; }
  #globalSearchButton kbd, #quickSwitchButton { display: none; }
  #openCreate { display: grid; place-items: center; grid-column: 4; grid-row: 2; width: 44px; min-width: 44px; padding: 0; }
  #openCreate span { display: none; }
  #openCreate::before { content: none; }
  #openCreate .create-job-icon { display: block; width: 24px; height: 24px; margin: 0; }
  .workspace, .metrics article, .dashboard-card, .dashboard-priority-grid button, .report-profitability,
  .calendar-toolbar, .accounting-toolbar, .report-toolbar, .settings-workspace {
    border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow);
  }
  .workspace::before, .metrics article::before, .dashboard-priority-grid button::before { display: none; }
  .workspace, .metrics article, .dashboard-card, .dashboard-priority-grid button { transform: none !important; animation: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .metrics article { min-height: 96px; padding: 12px; gap: 10px; }
  .metrics strong { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .metrics span { font-size: 12px; color: #52657b; }
  .metrics .metric-icon, .metric-icon { width: 32px; height: 32px; box-shadow: none; }
  .button, .icon-button, .text-button, .segmented button, .report-presets button, .pagination button,
  .job-pagination button, .status-picker, .tech-picker, .list-footer button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
  button { touch-action: manipulation; }
  button, a { -webkit-tap-highlight-color: #dbeafe; }
  :is(button, a, input, select, textarea):focus-visible { outline: 2px solid #1d5ed5; outline-offset: 2px; }
  :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(:where(.search-box input, .select-wrap select)) {
    max-width: 100%; min-width: 0; min-height: 46px; font-size: 16px;
    border-radius: 10px; border: 1px solid #8ea4bd; background-color: #fff; color: #172b46;
  }
  input::placeholder, textarea::placeholder { color: #62758b; opacity: 1; }
  :is(input, textarea):not(:placeholder-shown), select { background-color: #f1f6ff; border-color: #7793b4; }
  label { color: #334c69; }
  :is(input, textarea, select, button) { scroll-margin-block: 16px; }
  .status-tabs { display: flex; flex-wrap: wrap; overflow: visible; padding: 8px; gap: 6px; background: #f5f8fc; }
  .status-tabs button { flex: 1 1 85px; min-width: 0; min-height: 44px; height: auto; padding: 8px; white-space: normal; border-radius: 9px; border: 1px solid transparent; line-height: 1.35; font-size: 13px; color: #4c617b; }
  .status-tabs button.active { background: #fff; color: #174ea6; border-color: #b7cbed; box-shadow: 0 1px 3px #102a4310; }
  .list-tools { display: flex; flex-wrap: wrap; padding: 12px; gap: 10px; }
  .list-tools > *, .list-tools .search-box { min-width: 0; max-width: 100%; }
  .list-tools .search-box { flex: 1 1 100%; width: 100%; }
  /* Composite fields have one border and one focus ring on their wrapper. */
  .search-box, .select-wrap { height: auto; min-height: 48px; border: 1px solid #8ea4bd; border-radius: 10px; background: #fff; box-shadow: none; }
  .search-box { padding: 0 12px; gap: 8px; }
  .search-box svg { flex: 0 0 18px; width: 18px; height: 18px; }
  .search-box input, .select-wrap select { min-width: 0; max-width: 100%; width: 100%; min-height: 46px; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #172b46; font-size: 16px; }
  .search-box input { padding: 0; -webkit-appearance: none; appearance: none; }
  .select-wrap { position: relative; padding: 0; }
  .select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid #52657b; border-bottom: 2px solid #52657b; transform: translateY(-65%) rotate(45deg); pointer-events: none; }
  .select-wrap > span { display: none; }
  .select-wrap select { height: 46px; padding: 0 36px 0 12px; -webkit-appearance: none; appearance: none; }
  .search-box:focus-within, .select-wrap:focus-within { border-color: #1d5ed5; outline: 2px solid #1d5ed5; outline-offset: -2px; box-shadow: none; }
  .search-box input:focus, .select-wrap select:focus { outline: none; box-shadow: none; }
  #statusTabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; padding: 10px; box-shadow: none; }
  #statusTabs button { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; min-height: 56px; height: auto; margin: 0; padding: 8px 10px; text-align: left; border: 1px solid #d2dce8; border-radius: 9px; background: #fff; box-shadow: none; transition: none; }
  #statusTabs .status-tab-label { min-width: 0; overflow-wrap: anywhere; }
  #statusTabs button > span { flex: 0 0 auto; min-width: 28px; margin: 0; padding: 2px 6px; text-align: center; line-height: 20px; font-variant-numeric: tabular-nums; }
  #statusTabs button.active { color: #174ea6; border-color: #3976ce; background: #eaf2ff; box-shadow: inset 0 0 0 1px #3976ce; }
  #statusTabs button.active > span { color: #174ea6; background: #dce9ff; }
  #statusTabs button::after { display: none; }
  #statusTabs button[data-status="new_request"] { color: #9f1239; background: #fff5f6; border-color: #edbcc6; }
  #statusTabs button[data-status="new_request"].active { background: #ffe4e8; border-color: #be2941; box-shadow: inset 0 0 0 1px #be2941; }
  #statusTabs button[data-status="new_request"] > span { color: #fff; background: #be2941; }
  #statusTabs .map-tab { grid-column: 1 / -1; justify-content: center; min-height: 44px; }
  #jobsWorkspace .list-tools .tool-group { width: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; gap: 10px; }
  #jobsWorkspace .tool-group > * { min-width: 0; width: 100%; }
  #filterButton { height: auto; min-height: 48px; padding: 8px; flex-wrap: wrap; gap: 6px; background: #fff; color: #334c69; border-color: #8ea4bd; box-shadow: none; }
  #filterButton:disabled { color: #52657b; background: #edf1f6; border-color: #c3cfdd; opacity: 1; }
  .list-footer { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 12px; }
  .list-footer :is(button, select) { min-width: 44px; min-height: 44px; }
  .jobs-table tbody tr, .customers-table tbody tr { background: #fff; box-shadow: none; border: 1px solid var(--line); border-radius: 12px; }
  .jobs-table, .customers-table, .parts-table { display: none; }
  .mobile-job-list, .customer-mobile-list, .parts-mobile-list { display: grid; gap: 10px; padding: 10px; }
  .mobile-job-card, .customer-mobile-card, .parts-mobile-list article { margin: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff !important; box-shadow: none; padding: 14px; }
  .jobs-table td, .customers-table td { color: #415774; }
  .jobs-table .status-picker { padding: 8px 12px; }
  .job-chat-messages .bubble { box-shadow: none; }
  .form-grid, .detail-grid, .expense-fields, .payment-fields { gap: 14px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .wide { grid-column: 1 / -1; }
  .drawer, dialog, [aria-modal="true"] { color: #172b46; border-radius: 16px; }
  body :is(.drawer-head, .customer-drawer-head, dialog > header, [aria-modal="true"] > header) {
    padding: 14px 16px; gap: 12px; background: #edf3fb; color: #203c5c; border-bottom: 1px solid var(--line); box-shadow: none;
  }
  body :is(.drawer-head, dialog > header, [aria-modal="true"] > header) h2 { margin: 0; font-size: 20px; line-height: 1.3; }
  body :is(.quick-picker, .email-composer, .sms-composer, .payment-composer, .expense-composer, .schedule-confirm) > header :is(h2, .eyebrow) { color: #203c5c; }
  body :is(dialog, [aria-modal="true"]) > header .eyebrow { color: #52657b; }
  body :is(.close-button, .window-corner-close, .desk-schedule-close, [data-call-close], #catalogCardClose) {
    display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; margin-left: auto;
    border: 1px solid #b9cbe0; border-radius: 12px; background: #fff; color: #334d6e; box-shadow: none;
  }
  .scrim, dialog::backdrop, [class$="-backdrop"] { backdrop-filter: none; }
  html body :is(#jobDrawer, #customerDrawer) {
    position: fixed; top: var(--overlay-top) !important; left: var(--overlay-left) !important;
    width: var(--overlay-width) !important; height: var(--overlay-height) !important;
    max-height: var(--overlay-height) !important; max-width: none; margin: 0; border: 0; border-radius: 0;
    transform: none !important; box-shadow: none;
  }
  #jobDrawer .job-card-title { background: #17375a; padding: 12px 16px; }
  #jobDrawer .job-card-title h2 { font-size: 20px; }
  .job-title-actions { gap: 8px; }
  .job-title-status { min-height: 44px; max-width: 130px; white-space: normal; }
  .job-command-bar { height: auto; min-height: 0; flex-wrap: wrap; padding: 8px 12px; gap: 8px; background: #fff; }
  .job-command-bar button { flex: 1 1 70px; min-height: 44px; padding: 8px; }
  #jobDrawer .job-card-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .job-section-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--line); }
  .job-section-rail button { min-width: 0; min-height: 44px; padding: 6px; font-size: 12px; }
  .job-primary-column { padding: 16px; scroll-padding-block: 16px; }
  .job-section-rail [data-job-section="history"] { display: flex; }
  #createDrawer { overflow: hidden; }
  #createJobForm { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
  #createJobForm > .drawer-head { flex: 0 0 auto; position: static; }
  .create-form-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; scroll-padding-block: 16px; }
  #createJobForm > .create-actions { flex: 0 0 auto; position: static; bottom: auto; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #fff; box-shadow: none; }
  .create-actions button { flex: 1; min-height: 46px; }
  .form-section { padding: 16px; }
  .form-section + .form-section { border-top: 1px solid var(--line); }
  .stepper { margin: 16px; font-size: 12px; }
  .stepper i { min-width: 8px; }
  .appliance-card { padding: 12px; border: 1px solid #bdcfe3; border-radius: 12px; background: #f2f6fc; }
  .quick-picker-body { scroll-padding-block: 16px; }
  .quick-switch-dialog { display: none; }
  .quick-switch-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
  .quick-switch-list { flex: 1 1 auto; min-height: 0; max-height: none; }
  .quick-switch-list button { min-height: 52px; font-size: 16px; }
  .quick-switch-dialog header button { min-width: 44px; min-height: 44px; }
  .quick-switch-dialog footer { display: none; }
  .settings-layout { display: block; }
  .settings-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; padding: 12px; }
  .settings-nav button { min-width: 0; min-height: 52px; padding: 10px; white-space: normal; }
  .settings-nav button span { min-width: 0; }
  .settings-nav small { display: none; }
  .settings-nav b { font-size: 13px; overflow-wrap: anywhere; }
  .settings-content { padding: 16px; }
  .report-presets, .accounting-tabs, .report-toolbar, .accounting-toolbar { flex-wrap: wrap; }
  .accounting-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
  .accounting-toolbar > div, .accounting-range { min-width: 0; max-width: 100%; }
  .accounting-toolbar p { white-space: normal; overflow-wrap: anywhere; }
  .accounting-toolbar :is(a, button) { max-width: 100%; height: auto; white-space: normal; overflow-wrap: anywhere; }
  .accounting-range .segmented { display: flex; flex-wrap: wrap; width: 100%; gap: 4px; }
  .accounting-range .segmented button { flex: 1 1 90px; min-width: 0; padding: 8px; }
  .report-presets button { flex: 1 1 64px; }
  .report-profitability { overflow-x: auto; }
  .report-profitability-head, .report-profitability-row { min-width: 600px; }
  .notification-panel { z-index: 100; max-height: calc(var(--overlay-height) - 20px); }
  .global-search-panel { position: fixed; inset: calc(var(--overlay-top) + 8px) 8px auto; width: auto; max-width: none; max-height: calc(var(--overlay-height) - 16px); overflow: auto; }
  .global-search-panel > label { padding: 10px; gap: 8px; }
  .global-search-panel kbd { display: none; }
  .global-search-close { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #334d6e; font-size: 24px; }
  #catalogPartCard[open] { display: flex; flex-direction: column; overflow: hidden; }
  #catalogPartCard > header { flex: 0 0 auto; flex-wrap: wrap; }
  #catalogPartCard > header > div { width: 100%; }
  #catalogPartCard > header > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; }
  #catalogPartCard > header .button { min-width: 0; min-height: 44px; padding: 8px; white-space: normal; color: #203c5c; background: #fff; border: 1px solid #8ea4bd; box-shadow: none; }
  #catalogPartCard > header .button:hover { background: #e8f1ff; }
  #catalogPartCard > header .button:disabled { color: #52657b; background: #edf1f6; border-color: #c3cfdd; opacity: 1; }
  #catalogPartCard #catalogCardClose { grid-column: 3; margin: 0; }
  #catalogPartCard .catalog-card-body { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "gallery"; align-content: start; gap: 24px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
  #catalogPartCard .catalog-summary h3 { margin-top: 12px; font-size: 23px; overflow-wrap: anywhere; }
  #catalogPartCard .catalog-hero { min-height: 200px; max-height: 360px; }
  #catalogPartCard > footer { flex: 0 0 auto; padding: 0 16px 12px; }
  .calendar-toolbar { padding: 12px; }
  .calendar-views { width: 100%; display: flex; }
  .calendar-views button { flex: 1; padding: 8px 4px; min-height: 44px; }
  .calendar-legend { flex-wrap: wrap; }
  /* Calendar overview stays a grid; only the day columns scroll sideways. */
  #scheduleWorkspace .calendar-surface:has(.mobile-period-calendar) { max-height: none; overflow: visible; box-shadow: none; }
  .mobile-period-calendar { min-width: 0; max-width: 100%; background: #fff; }
  .mobile-period-overview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 10px 8px; border-bottom: 1px solid #d2dce8; }
  .mobile-period-overview button { min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 0; border: 1px solid transparent; border-radius: 10px; background: #f2f5f9; color: #405571; }
  .mobile-period-overview button > span { font-size: 11px; }
  .mobile-period-overview button > strong { font-size: 17px; line-height: 1.1; }
  .mobile-period-overview button > small { font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
  .mobile-period-overview button[aria-current="date"] { border-color: #3976ce; }
  .mobile-period-overview button[aria-pressed="true"] { background: #205cca; color: #fff; border-color: #205cca; }
  .mobile-calendar-caption { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; color: #52657b; font-size: 12px; }
  .mobile-week-scroll { width: 100%; max-height: 60vh; max-height: 60dvh; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; scroll-snap-type: x proximity; scroll-padding-left: 8px; background: #eef3f8; }
  .mobile-week-scroll.schedule-drag-scrolling { scroll-snap-type: none; }
  .mobile-week-columns { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(148px, 44vw, 184px); align-items: stretch; gap: 8px; padding: 0 8px 10px; min-width: max-content; }
  .mobile-calendar-column { position: relative; min-width: 0; min-height: 250px; border: 1px solid #ccd8e5; border-radius: 12px; background: #f8fafd; scroll-snap-align: start; }
  .mobile-calendar-column > header { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 46px; padding: 0 8px; border-bottom: 1px solid #d2dce8; border-radius: 11px 11px 0 0; background: #e9eff7; color: #344f70; }
  .mobile-calendar-column > header button { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
  .mobile-calendar-column > header strong { font-size: 14px; }
  .mobile-calendar-column > header span { font-size: 11px; white-space: nowrap; }
  .mobile-calendar-column.selected { border-color: #3976ce; }
  .mobile-calendar-column.selected > header { background: #dceaff; color: #174ea6; }
  .mobile-calendar-empty { margin: 0; padding: 28px 12px; text-align: center; color: #52657b; font-size: 13px; }
  .mobile-column-visits { display: grid; gap: 8px; padding: 8px; }
  #calendarSurface .mobile-calendar-visit { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; min-width: 0; margin: 0; padding: 8px; border: 1px solid #cedae7; border-left: 4px solid var(--visit-accent); border-radius: 10px; background: #fff; color: #203c5c; box-shadow: 0 2px 4px #203c5c08; opacity: 1; overflow: visible; }
  #calendarSurface .mobile-calendar-visit:hover { filter: none; }
  #calendarSurface .mobile-calendar-visit .schedule-card-open { grid-column: 1 / -1; min-height: 52px; padding: 0; white-space: normal; overflow-wrap: anywhere; }
  #calendarSurface .mobile-calendar-visit :is(time, strong, span, small) { display: block; white-space: normal; overflow: visible; text-overflow: clip; }
  #calendarSurface .mobile-calendar-visit time { color: #254f82; font-size: 11px; font-weight: 700; line-height: 1.4; }
  #calendarSurface .mobile-calendar-visit strong { margin: 6px 0 4px; font-size: 14px; line-height: 1.35; }
  #calendarSurface .mobile-calendar-visit span { color: #455d79; font-size: 12px; line-height: 1.4; }
  #calendarSurface .mobile-calendar-visit small { color: #52657b; font-size: 11px; line-height: 1.45; margin-top: 8px; }
  #calendarSurface .mobile-calendar-visit .schedule-move-handle { position: static; grid-column: 1; min-height: 44px; min-width: 0; margin: 0; padding: 6px; border: 1px solid #a3b9d4; border-radius: 8px; background: #f7faff; color: #244f83; font-size: 12px; }
  #calendarSurface .mobile-calendar-visit .schedule-cancel-button { position: static; grid-column: 2; width: 44px; height: 44px; padding: 8px; box-shadow: none; }
  .mobile-calendar-column > .drop-preview { position: sticky; bottom: 0; width: auto; min-width: 0; height: auto; padding: 8px; margin: 8px; white-space: normal; }
  .mobile-period-overview .drop-preview, .mobile-month-grid .drop-preview { display: none; }
  .mobile-period-overview .drop-target, .mobile-month-grid .drop-target { outline: 3px solid #176fa6; outline-offset: -3px; }
  .mobile-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; padding: 1px; background: #d2dce8; border-bottom: 1px solid #d2dce8; }
  .mobile-month-weekday { padding: 9px 0; text-align: center; background: #f1f5fa; color: #52657b; font-size: 11px; font-weight: 600; }
  .mobile-month-grid button { min-width: 0; min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; margin: 0; padding: 7px 1px; border: 0; border-radius: 0; background: #fff; color: #334d6e; }
  .mobile-month-grid button > strong { font-size: 15px; line-height: 1.2; }
  .mobile-month-grid button small { font-size: 10px; line-height: 1.2; white-space: nowrap; }
  .mobile-month-grid button.outside { color: #626f80; background: #f2f5f8; }
  .mobile-month-grid button.today > strong { text-decoration: underline; text-underline-offset: 4px; }
  .mobile-month-grid button[aria-pressed="true"] { color: #174ea6; background: #e4efff; box-shadow: inset 0 0 0 2px #3976ce; }
  .mobile-month-marks { display: flex; gap: 3px; height: 5px; }
  .mobile-month-marks i { width: 5px; height: 5px; border-radius: 2px; }
  #scheduleWorkspace .schedule-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  #scheduleWorkspace .schedule-toolbar > div:first-child { display: none; }
  #scheduleWorkspace .calendar-views { margin: 0; }
  #scheduleWorkspace #calendarJump { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 44px; min-height: 44px; padding: 6px 8px; line-height: 1.15; white-space: normal; font-size: 13px; color: #203c5c; }
  #scheduleWorkspace #calendarJump::after { content: ''; flex: 0 0 6px; width: 6px; height: 6px; margin: -3px 0 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header { min-height: 44px; padding: 0 10px; background: #f2f6fb; color: #334d6e; border-block: 1px solid #d2dce8; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header .eyebrow { display: none; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header h3 { margin: 0; font-size: 14px; color: #334d6e; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header > button { background: transparent; color: #334d6e; }
  #scheduleWorkspace:has(.mobile-period-calendar) .calendar-legend { height: auto; min-height: 32px; padding: 8px 12px; }
  #scheduleWorkspace .schedule-toolbar .calendar-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px 44px; width: 100%; gap: 6px; }
  #scheduleWorkspace .schedule-toolbar .calendar-nav .calendar-jump { min-width: 0; }
  #scheduleWorkspace .calendar-nav .button { min-width: 0; padding: 8px; }
  .timeline-event .event-resize { display: none; }
  #scheduleWorkspace { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .calendar-jump-popover { position: fixed; z-index: 60; top: calc(var(--overlay-top, 0px) + 12px); right: auto; left: calc(var(--overlay-left, 0px) + var(--overlay-width, 100vw) / 2); transform: translateX(-50%); width: min(336px, calc(var(--overlay-width, 100vw) - 24px)); max-height: calc(var(--overlay-height, 100dvh) - 24px); overflow: auto; overscroll-behavior: contain; }
  .calendar-jump-popover header { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .calendar-jump-popover .icon-button { width: 44px; height: 44px; }
  .calendar-jump-day { min-height: 44px; }
  .calendar-jump-day.outside { color: #63758a; }
  .calendar-jump-weekdays span { color: #52657b; }
  #scheduleWorkspace .calendar-nav { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  #scheduleWorkspace .calendar-nav .icon-button { flex: 0 0 44px; }
  #scheduleWorkspace #calendarJumpButton { flex: 1 1 100%; }
  #scheduleWorkspace .calendar-nav .calendar-jump { flex: 1 1 100%; }
  #scheduleWorkspace .calendar-nav #calendarToday { flex: 1; }
  body :is(.drawer, dialog, [aria-modal="true"]) button:not([role="gridcell"]):not(.desk-schedule-day) { min-height: 44px; }
  #notificationCount { background: #bf2838; color: #fff; }
  .dashboard-priority-grid small, .dashboard-map-tabs button:not(.active), .calendar-views button:not(.active),
  .report-presets button:not(.active), .accounting-range .segmented button:not(.active),
  #dashboardMapListLabel, .dashboard-map-layout aside button span em,
  .dashboard-desk-filter > span, .dashboard-desk-caption > span, .dashboard-desk > footer > span,
  .dashboard-chat-count, .dashboard-chat-empty > span, #dashboardChatPage,
  .dashboard-today button small, .dashboard-finance-total > span, #dashboardGross,
  .dashboard-finance-bars > div > span, .report-empty, .report-bar-row > div > span,
  #reportBreakdown > div > span, .report-profitability-head > span, .accounting-metrics small { color: #4b6078; }
  .dashboard-map-canvas .map-state :is(strong, span) { color: #51442e; }
  .status.quote, .status-picker.quote { color: #825000; background: #fff2db; }
  .status.work, .status-picker.work { color: #075e89; background: #e3f4fc; }
  .dashboard-today > div > button span small { color: #4b6078; }
  .dashboard-priority-grid em, .metrics small, .select-wrap > span { color: #4b6078; }
  .metrics small b { color: #087449; }
}
@media (max-width: 380px) {
  #jobsWorkspace .list-tools .tool-group { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .payment-fields, .expense-fields { grid-template-columns: minmax(0, 1fr); }
  .job-title-actions { gap: 6px; }
  #jobDrawer .job-card-title { padding: 10px 12px; }
  #jobDrawer .job-card-title h2 { font-size: 18px; }
  .job-title-status { max-width: 105px; font-size: 12px; }
}
@media (max-width: 900px) and (max-height: 500px) {
  .topbar { position: relative; }
  #jobDrawer .job-card-title .eyebrow, #createJobForm > .drawer-head p { display: none; }
  #jobDrawer .job-card-title { padding-block: 6px; }
  .job-command-bar, .job-section-rail { padding-block: 4px; }
}

@media (min-width: 600px) and (max-width: 900px) {
  #statusTabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.calendar-people-toolbar > .calendar-people-picker { flex:1 1 auto;width:auto; }
.calendar-person-step { display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;align-self:center;padding:0;border:1px solid #b5c8df;border-radius:10px;background:#f3f7fd;color:#254b78; }
.calendar-person-step:disabled { opacity:.45;cursor:default; }
.schedule-crew-decision { margin:0 22px 16px;padding:12px;border:1px solid #b5c8df;border-radius:10px;background:#edf4ff; }
.schedule-crew-decision h3 { margin:0 0 8px;color:#203c5c;font-size:16px; }
.schedule-crew-decision p { margin:0 0 10px;font-size:13px;color:#405773;overflow-wrap:anywhere; }
.schedule-crew-decision > div { display:flex;flex-wrap:wrap;gap:8px; }
.schedule-crew-decision .button { min-height:44px;white-space:normal;text-align:center; }
#confirmCrewLead { display:block;margin-top:6px;color:#52657b;font-size:12px; }
#confirmCrewLead[hidden],.schedule-crew-decision [hidden],.schedule-crew-decision[hidden] { display:none; }
#scheduleCrewDialog { width:min(460px,calc(100vw - 24px));max-height:calc(var(--overlay-height,100dvh) - 24px);padding:0;border:1px solid #b5c8df;border-radius:16px;background:#fff;color:#203c5c; }
#scheduleCrewDialog[open] { display:flex;flex-direction:column;overflow:hidden; }
#scheduleCrewDialog header { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid #d2dce8;background:#edf4fc;flex:0 0 auto; }
#scheduleCrewDialog h2 { margin:0;font-size:20px; }
#scheduleCrewDialog .schedule-crew-body { min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px;display:grid;grid-auto-rows:max-content;align-content:start;gap:14px; }
#scheduleCrewDialog p { margin:0;font-size:14px;line-height:1.4; }
#scheduleCrewDialog .calendar-people-list { max-height:none;overflow:visible; }
#scheduleCrewLeadField { display:grid;gap:8px;font-size:14px;color:#405773; }
#scheduleCrewLeadField[hidden] { display:none; }
#scheduleCrewLead { width:100%;min-width:0;min-height:44px;padding:8px;border:1px solid #99b1cd;border-radius:9px;background:#f1f6ff;color:#173957;font:inherit;font-size:16px; }
#scheduleCrewLead[aria-invalid=true] { outline:2px solid #b42335; }
#scheduleCrewMessage { color:#a11e35; }
#scheduleCrewMessage:empty { display:none; }
#scheduleCrewDialog footer { display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid #d2dce8;flex:0 0 auto; }
#scheduleCrewDialog footer .button { min-height:44px;white-space:normal; }

.schedule-confirm { display:flex;flex-direction:column;max-height:calc(var(--overlay-height,100dvh) - 24px);overflow:hidden; }
.schedule-confirm > header,.schedule-confirm > footer { flex:0 0 auto; }
.schedule-confirm-body { min-height:0;overflow:auto;overscroll-behavior:contain; }
.schedule-confirm-body > .check-row { margin:5px 22px 15px; }
.schedule-confirm-body > .form-message { padding:0 22px; }
.schedule-confirm > footer button[hidden] { display:none; }
