/* Final narrow-screen presentation layer. Loaded after page-specific styles. */
@media(max-width:700px){
  html:not(.calendar-only):not(.calendar-standalone) .notification-drawer{
    top:64px;bottom:0;z-index:74;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .notification-drawer{
    top:calc(78px + env(safe-area-inset-top));
  }
  main{overflow-x:clip}

  .page-head{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:18px}
  .page-head>div:first-child,.page-head .actions{width:100%;min-width:0}
  .page-head .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
  .page-head .actions>*{width:100%;min-width:0;min-height:44px;padding:9px 10px;white-space:normal;overflow-wrap:anywhere;text-align:center;line-height:1.2}
  .page-head .actions>*:only-child{grid-column:1/-1}
  .page-head h1{font-size:25px}
  .page-head .subtitle{display:none}
  #content.job-mode .page-head .subtitle{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:8px;color:var(--muted);font-size:12px;line-height:1.45}
  #content.job-mode .page-head .subtitle .procedure-tabs{display:inline-flex!important;gap:5px}
  #content.job-mode .page-head .subtitle .procedure-tabs>span{padding:4px 8px;font-size:11px}

  .stats,.bookings-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:14px}
  .stat{min-height:0;padding:11px 12px;border-radius:9px}
  .stat-top{gap:6px;margin-bottom:6px;font-size:11px;line-height:1.2}
  .stat-top svg{width:15px;height:15px}
  .stat-number{font-size:23px;line-height:1.05}
  .stat-note{margin-top:6px;font-size:10.5px;line-height:1.25}

  .panel-head{padding:14px}
  .notice{margin:14px 0;padding:12px 14px}
  .directory-card{padding:16px}
  .directory-card h2{margin-top:12px}
  .card-bottom{margin-top:13px;padding-top:12px}

  .sets-summary-cards,.ex-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:14px}
  .sets-summary-cards article,.ex-summary>div{min-height:0;padding:10px 12px}
  .sets-summary-cards strong{font-size:20px}
  .ex-summary>div:last-child{grid-column:1/-1}

  .bookings-filters summary{min-height:48px;padding:12px 14px}
  .bookings-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:5px 12px 12px}
  .bookings-filter-grid label{min-width:0}
  .bookings-search{grid-column:1/-1}
  .bookings-filter-grid input,.bookings-filter-grid select{width:100%;min-height:44px;padding:9px;font-size:16px}
  .bookings-clear{grid-column:1/-1;width:100%;margin-top:1px}
  .bookings-location-status{padding:0 12px 12px;line-height:1.45}
}

/* iPad portrait: use a deliberate tablet shell instead of squeezing the
   desktop sidebar and toolbar into the narrow side of the device. Landscape
   keeps the wider desktop workspace. */
@media(min-width:701px) and (max-width:1024px) and (orientation:portrait){
  html:not(.calendar-only):not(.calendar-standalone){overflow-x:hidden;background:var(--bg)}
  html:not(.calendar-only):not(.calendar-standalone) body{
    min-height:100%;padding-top:calc(72px + env(safe-area-inset-top));
    overflow-x:hidden;background:var(--bg);
  }
  html:not(.calendar-only):not(.calendar-standalone) body::before{
    content:"";position:fixed;z-index:69;inset:0 0 auto;height:env(safe-area-inset-top);
    background:#18313d;pointer-events:none;
  }
  html:not(.calendar-only):not(.calendar-standalone) .main-shell{
    min-height:calc(100dvh - 72px - env(safe-area-inset-top));margin-left:0!important;
    overflow:visible;background:var(--bg);
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar{
    position:fixed;z-index:70;inset:env(safe-area-inset-top) 0 auto;width:100%;
    height:72px;min-height:72px;padding:0 18px;display:flex;flex-direction:row;
    align-items:center;justify-content:space-between;background:linear-gradient(110deg,#18313d,#263d77);
    transform:none!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar .brand{
    height:72px;padding:0;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar .brand-lockup{width:128px}
  html:not(.calendar-only):not(.calendar-standalone) .sidebar .brand-caption{
    margin-top:2px;color:#b8c8d5;font-size:7px;letter-spacing:1.8px;
  }
  html:not(.calendar-only):not(.calendar-standalone) .workspace-label,
  html:not(.calendar-only):not(.calendar-standalone) .sidebar-bottom,
  html:not(.calendar-only):not(.calendar-standalone) .sidebar-collapse-toggle,
  html:not(.calendar-only):not(.calendar-standalone) .sidebar-restore-toggle{display:none!important}
  html:not(.calendar-only):not(.calendar-standalone) .mobile-menu-toggle{
    display:flex;position:absolute;z-index:73;top:14px;right:16px;width:44px;height:44px;
    padding:10px;flex-direction:column;justify-content:space-around;align-items:center;
    border:1px solid #ffffff30;border-radius:22px;background:#ffffff14;color:#fff;
  }
  html:not(.calendar-only):not(.calendar-standalone) .mobile-menu-toggle span{
    display:block;width:21px;height:2px;border-radius:2px;background:currentColor;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar #navigation{display:none}
  html:not(.calendar-only):not(.calendar-standalone) .topbar{
    position:fixed;z-index:72;top:env(safe-area-inset-top);right:72px;width:auto;height:72px;
    padding:0;gap:10px;border:0;background:transparent;
  }
  html:not(.calendar-only):not(.calendar-standalone) .topbar .breadcrumb,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .global-search,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .account-button,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .sign-out,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .top-back-button{display:none}
  html:not(.calendar-only):not(.calendar-standalone) .topbar .team-calendar-link,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .top-export,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .app-refresh,
  html:not(.calendar-only):not(.calendar-standalone) .topbar .notification-toggle{
    display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;
    padding:0;border:1px solid #ffffff30;border-radius:22px;background:#ffffff14;color:#fff;
    font-size:0;
  }
  html:not(.calendar-only):not(.calendar-standalone) .topbar .team-calendar-link::before{
    content:"";display:block;flex:0 0 18px;width:18px;height:18px;border:0;
    background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h1a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h1V2Zm11 4H6a2 2 0 0 0-2 2v1h16V8a2 2 0 0 0-2-2Zm2 5H4v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7Z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h1a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h1V2Zm11 4H6a2 2 0 0 0-2 2v1h16V8a2 2 0 0 0-2-2Zm2 5H4v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7Z'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  html:not(.calendar-only):not(.calendar-standalone) .topbar .top-export span{font-size:20px}
  html:not(.calendar-only):not(.calendar-standalone) .topbar .top-export b{display:none}
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"]{
    inset:env(safe-area-inset-top) 0 0;height:auto;min-height:0;display:flex;
    flex-direction:column;align-items:stretch;justify-content:flex-start;padding:0 18px 18px;
    overflow:hidden;background:var(--navy);
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] .brand{
    flex:0 0 72px;height:72px;align-self:flex-start;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation{
    display:flex;width:min(100%,620px);max-height:none;margin:0 auto;padding:10px 0 20px;
    flex-direction:column;gap:4px;overflow-y:auto;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation .nav-item{
    width:100%;min-height:48px;margin:0;padding:11px 15px;font-size:15px;
  }
  html.mobile-menu-open,html.mobile-menu-open body{overflow:hidden!important;overscroll-behavior:none}
  main{max-width:920px;padding:28px 24px 18px;overflow-x:clip}
  .page-head{align-items:flex-start;gap:18px;margin-bottom:22px}
  #content.overview-mode .page-head{display:grid;grid-template-columns:1fr}
  #content.overview-mode .page-head .actions{width:100%;margin:0}
  #content.overview-mode .dashboard-action-groups{width:100%;justify-items:stretch}
  #content.overview-mode .dashboard-action-row{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;
  }
  #content.overview-mode .dashboard-action-row>*{width:100%;min-width:0;justify-content:center}
  #content.overview-mode .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  #content.overview-mode .dashboard-span-full,#content.overview-mode .dashboard-span-double{grid-column:1/-1}
  .notification-drawer{top:calc(72px + env(safe-area-inset-top))}
}

/* iOS standalone PWAs can add a translucent scroll-edge treatment above fixed
   content. Paint one continuous opaque app bar through the status safe area so
   the controls keep their intended contrast without changing normal Safari. */
@media (max-width:700px){
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone){
    background:#18313d!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) body{
    padding-top:calc(78px + env(safe-area-inset-top))!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) body::before{
    height:calc(78px + env(safe-area-inset-top));
    background:#18313d!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .sidebar{
    background:#18313d!important;
    height:78px!important;
    min-height:78px!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .sidebar .brand{
    height:78px!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar{
    top:calc(env(safe-area-inset-top) + 14px)!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .mobile-menu-toggle{
    top:26px!important;
  }
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar .top-back-button,
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar .team-chat-link,
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar .notification-toggle,
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar .app-refresh,
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .topbar .top-export,
  html.standalone-pwa:not(.calendar-only):not(.calendar-standalone) .mobile-menu-toggle{
    background:#28495b!important;
    border-color:#587181!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
}

/* Follow-up phone refinements from live staff review. */
@media(max-width:700px){
  #content.overview-mode .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #content.overview-mode .dashboard-tile:not(.dashboard-key-figure){grid-column:1/-1}
  #content.overview-mode .dashboard-key-figure{grid-column:auto}

  #content.eod-mode .eod-procedure-picker>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.eod-mode .eod-procedure-picker label{display:flex;align-items:center;gap:8px;min-height:43px;padding:8px 10px;border-radius:9px}
  #content.eod-mode .eod-procedure-picker input{
    position:relative;display:grid;place-items:center;flex:0 0 19px;width:19px!important;height:19px!important;
    min-width:19px!important;min-height:19px!important;margin:0!important;padding:0!important;
    border:1.5px solid #aab9c1;border-radius:5px;background:#fff;-webkit-appearance:none;appearance:none;
  }
  #content.eod-mode .eod-procedure-picker input:checked{border-color:var(--teal);background:var(--teal)}
  #content.eod-mode .eod-procedure-picker input:checked::after{content:'✓';color:#fff;font-size:13px;font-weight:800;line-height:1}
  #content.eod-mode .eod-procedure-picker label span,
  #content.eod-mode .eod-procedure-picker input:checked+span{display:block;padding:0;background:transparent;border:0;color:var(--ink);font-size:11px;line-height:1.2}

  #content.lots-mode .page-head .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.lots-mode .page-head .actions>*{grid-column:auto!important;width:100%;min-width:0;min-height:43px;padding:8px 7px;font-size:10.5px;white-space:normal;line-height:1.2}
}

/* Keep the standalone Calendar controls below the iPhone status/glass area. */
@media(max-width:700px){
  html.calendar-standalone .topbar{
    box-sizing:border-box!important;
    position:relative!important;
    min-height:calc(62px + env(safe-area-inset-top))!important;
    height:calc(62px + env(safe-area-inset-top))!important;
    padding:env(safe-area-inset-top) 12px 4px!important;
    align-items:flex-end!important;
    background:#12384f!important;
    overflow:visible!important;
    isolation:isolate;
  }
  html.calendar-standalone .calendar-app-brand{
    display:flex!important;
    align-items:center!important;
    height:54px!important;
    min-height:54px!important;
  }
  html.calendar-standalone .calendar-header-menu{
    position:relative!important;
    z-index:5!important;
    flex:0 0 44px!important;
    width:44px!important;
    height:44px!important;
    margin:0 max(0px,env(safe-area-inset-right)) 5px auto!important;
    border:1px solid #76d6c4!important;
    background:#087f76!important;
    box-shadow:0 3px 12px rgba(3,27,39,.28)!important;
  }
  html.calendar-standalone .calendar-header-menu span{
    background:#fff!important;
    opacity:1!important;
  }
  html.calendar-standalone .calendar-options{
    padding:calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom))!important;
  }
}

/* Native Team Calendar: never let the remote calendar canvas exceed the phone viewport. */
@media(max-width:700px){
  html.calendar-standalone,
  html.calendar-standalone body{
    width:100%!important;max-width:100%!important;overflow-x:hidden!important;
  }
  html.calendar-standalone .main-shell,
  html.calendar-standalone .main-shell>main,
  html.calendar-standalone #content,
  html.calendar-standalone .content-enter,
  html.calendar-standalone .team-calendar,
  html.calendar-standalone .team-calendar-board,
  html.calendar-standalone .bookings-month,
  html.calendar-standalone .bookings-weekdays,
  html.calendar-standalone .bookings-month-grid{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
  }
  html.calendar-standalone .main-shell,
  html.calendar-standalone .main-shell>main,
  html.calendar-standalone #content,
  html.calendar-standalone .content-enter,
  html.calendar-standalone .team-calendar-board{
    overflow-x:hidden!important;
  }
  html.calendar-standalone .calendar-global-add{
    right:max(18px,env(safe-area-inset-right))!important;
  }
  html.calendar-standalone .calendar-mobile-add{
    display:none!important;
  }
}

@media(max-width:340px){
  .page-head .actions,.bookings-filter-grid{grid-template-columns:1fr}
  .bookings-search,.bookings-clear{grid-column:auto}
}

/* Very narrow phones need a single reading column; two-up controls make long
   operational labels force the page wider than the viewport. */
@media(max-width:480px){
  .page-head .actions,.stats,.bookings-stats{grid-template-columns:1fr}
  .page-head .actions>*{grid-column:auto}
}

/* Keep the phone shell quiet and the dashboard shortcuts compact. */
@media(max-width:700px){
  .sidebar .brand-lockup{width:100px}
  .sidebar .brand-caption{margin-top:1px;font-size:6px;letter-spacing:1.45px}
  #content.overview-mode .page-head .actions{display:block}
  #content.overview-mode .dashboard-action-groups{width:100%;gap:7px}
  #content.overview-mode .dashboard-action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;width:100%}
  #content.overview-mode .dashboard-action-row>*{width:100%;min-width:0;min-height:42px;padding:8px 7px;gap:6px;white-space:nowrap;overflow-wrap:normal;word-break:normal;text-align:center;font-size:11.5px;font-weight:550;line-height:1.2}
  #content.overview-mode .dashboard-action-row>*>svg{width:14px;height:14px;flex:0 0 14px}
}

@media(max-width:360px){
  #content.overview-mode .dashboard-action-row>*{padding-inline:5px;gap:4px;font-size:10.25px}
  #content.overview-mode .dashboard-action-row>*>svg{width:12px;height:12px;flex-basis:12px}
}

/* Compact, consistent phone layouts for operational pages. */
@media(max-width:700px){
  /* End of Day: two concise view tabs and two-up summary figures. */
  #content.eod-mode .eod-view-tabs{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:4px;width:100%;margin-bottom:12px;padding:4px;border-radius:9px}
  #content.eod-mode .eod-view-tabs button{min-height:38px;padding:6px 8px;font-size:12px;line-height:1.15}
  #content.eod-mode .eod-view-tabs span{min-width:19px;padding:1px 5px;font-size:10px}
  #content.eod-mode .eod-stats{grid-template-columns:repeat(2,minmax(0,1fr))}

  /* Exhibitions: every control and event is readable without horizontal scrolling. */
  .ex-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .ex-summary>div{padding:9px 11px}
  .ex-summary>div:last-child{grid-column:1/-1}
  .ex-layout{gap:12px}
  .ex-sidebar .panel-head{padding:11px 13px}
  .ex-sidebar .panel-head h2{font-size:16px}
  .ex-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;overflow:visible;padding:0 10px 10px}
  .ex-filters button{min-width:0;padding:7px 4px;font-size:10px;white-space:normal}
  .ex-events{display:grid;overflow:visible}
  .ex-event{min-width:0;padding:11px 13px;border-right:0}
  .ex-event strong{font-size:13px}
  .ex-event small{font-size:10px;line-height:1.35}
  .ex-detail{gap:14px;padding:13px}
  .ex-detail-top{gap:9px}
  .ex-detail-top h2{font-size:21px;line-height:1.15}
  .ex-detail-top p{font-size:11px;line-height:1.4}
  .ex-detail-top .secondary{min-height:36px;padding:7px 10px;font-size:11px}
  .ex-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin:0;padding:3px;border:1px solid var(--line);border-radius:8px;background:#f4f8f9;overflow:visible}
  .ex-tabs button{min-width:0;padding:7px 5px;border:0;border-radius:6px;font-size:11px;white-space:normal}
  .ex-tabs button.active{border:0;background:#fff;box-shadow:0 1px 4px #18364a14}
  .ex-facts{gap:10px;padding:12px}
  .ex-plan-grid{gap:11px}

  /* Consumables: replace the wide director matrix with compact vertical cards. */
  .consumables-section-tabs{gap:6px;margin-bottom:12px}
  .consumables-section-tabs>a{min-height:51px;padding:7px 9px;column-gap:6px;font-size:11px}
  .consumables-section-tabs span{font-size:8.5px;line-height:1.25;white-space:normal}
  .stock-toolbar{margin-bottom:11px}
  .company-stock-matrix{border:0;background:transparent;overflow:visible;box-shadow:none}
  .company-stock-scroll{overflow:visible}
  .company-stock-matrix table,.company-stock-matrix tbody{display:block;width:100%;min-width:0!important}
  .company-stock-matrix colgroup,.company-stock-matrix thead{display:none}
  .company-stock-matrix tbody{display:grid;gap:9px}
  .company-stock-matrix tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#fff}
  .company-stock-matrix tbody th:first-child{position:static;grid-column:1/-1;min-width:0;padding:11px 12px!important;border-bottom:1px solid var(--line);background:#f8fbfb;text-align:left}
  .company-stock-matrix tbody th strong{font-size:13px;line-height:1.3}
  .company-stock-matrix tbody th small{margin-top:3px;font-size:9px}
  .company-stock-matrix tbody td{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px;min-width:0;padding:7px 9px!important;border-bottom:1px solid #edf2f4;text-align:right;white-space:normal}
  .company-stock-matrix tbody td::before{content:attr(data-label);min-width:0;color:#728894;font-size:8.5px;line-height:1.2;text-align:left;overflow-wrap:anywhere}
  .company-stock-matrix tbody td:nth-last-child(2){grid-column:1/-1}
  .company-stock-matrix .team-stock-stepper{width:72px;margin:0}
  .company-stock-matrix .company-stock-action-cell{display:flex;grid-column:1/-1;justify-content:flex-end;padding:7px 9px!important;border-bottom:0}
  .company-stock-matrix .company-stock-action-cell::before{display:none}
  .company-stock-matrix .company-stock-manage{width:34px;height:30px}

  /* Fibre stock: three compact selectors and smaller active detail controls. */
  .fibre-page-alert{margin-bottom:10px;padding:9px 11px;font-size:10.5px;line-height:1.4}
  .fibre-sizes{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:11px}
  .fibre-size-card,.fibre-size-card.active{min-height:0;padding:9px 8px;border-radius:8px}
  .fibre-size-card.active{padding:8px 7px}
  .fibre-size-card>span{font-size:9px}
  .fibre-size-card strong{font-size:16px;line-height:1.15}
  .fibre-size-card small{font-size:8.5px;line-height:1.3}
  .fibre-size-card i{display:none}
  .fibre-detail-head{gap:11px;padding:13px}
  .fibre-detail-head h2{font-size:19px}
  .fibre-detail-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .fibre-detail-actions button{min-width:0;min-height:36px;padding:7px 6px;font-size:11px}
  .fibre-counts article{padding:10px 12px}
  .fibre-counts strong{font-size:21px}

  /* HoLEP sets: compact actions, status figures and section navigation. */
  #content.sets-mode .sets-page-heading{gap:11px;margin-bottom:12px}
  #content.sets-mode .sets-page-heading p{font-size:12px;line-height:1.45}
  #content.sets-mode .sets-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #content.sets-mode .sets-actions button{min-height:38px;padding:7px 8px;font-size:11.5px}
  #content.sets-mode .sets-status-panel{margin-bottom:10px}
  #content.sets-mode .sets-status-panel>summary{gap:8px;padding:9px 11px;font-size:12px}
  #content.sets-mode .sets-status-action{font-size:10px}
  #content.sets-mode .sets-status-panel .sets-summary-cards{gap:6px;padding:0 8px 8px}
  #content.sets-mode .sets-summary-cards article{gap:2px;padding:8px 9px}
  #content.sets-mode .sets-summary-cards small{font-size:8px;letter-spacing:.35px}
  #content.sets-mode .sets-summary-cards strong{font-size:18px}
  #content.sets-mode .sets-summary-cards span{display:none}
  #content.sets-mode .sets-three-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px;margin-bottom:8px}
  #content.sets-mode .sets-three-tabs>button{display:flex;min-width:0;align-items:center;justify-content:center;gap:5px;padding:8px 4px;font-size:10.5px;text-align:center}
  #content.sets-mode .sets-three-tabs svg{grid-row:auto;width:14px;height:14px;margin:0}
  #content.sets-mode .sets-three-tabs span{display:none}
}

@media(max-width:360px){
  .fibre-sizes{grid-template-columns:1fr}
  .fibre-size-card i{display:block}
}

/* Second phone pass: keep dense operational screens consistent and remove
   avoidable sideways navigation. */
@media(max-width:700px){
  /* Tapping an exhibition now jumps here, below the event picker. */
  #content.exhibitions-mode .ex-main{scroll-margin-top:74px}

  /* The director stock view is one connected register, with each product
     divided cleanly into its holders instead of appearing as floating boxes. */
  #content.consumables-mode .company-stock-matrix{overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#fff}
  #content.consumables-mode .company-stock-matrix tbody{gap:0}
  #content.consumables-mode .company-stock-matrix tbody tr{border:0;border-bottom:7px solid #edf3f5;border-radius:0}
  #content.consumables-mode .company-stock-matrix tbody tr:last-child{border-bottom:0}
  #content.consumables-mode .company-stock-matrix tbody th:first-child{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 11px!important}
  #content.consumables-mode .company-stock-mobile-manage{display:inline-grid}
  #content.consumables-mode .company-stock-action-cell{display:none!important}
  #content.consumables-mode .company-stock-matrix tbody td{padding:6px 9px!important}
  #content.consumables-mode .company-stock-matrix tbody td:nth-last-child(2){border-bottom:0}

  /* Fibre stock alert: tighter sides and text, with breathing room below. */
  .fibre-detail .fibre-alerts{padding:7px 8px 14px}
  .fibre-detail .fibre-alerts .notice{margin:0;padding:7px 8px;font-size:10.5px;line-height:1.45}

  /* Lasers: four key figures become a compact two-by-two block. */
  #content.fleet-mode .stats[aria-label="Lasers summary"]{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.fleet-mode .stats[aria-label="Lasers summary"] .stat{padding:9px 10px}
  #content.fleet-mode .laser-toolbar{gap:7px}
  #content.fleet-mode .laser-toolbar .filter-select{min-width:0;width:calc(50% - 4px);flex:0 0 calc(50% - 4px)}
  #content.fleet-mode .laser-toolbar #laser-sort{width:100%;flex-basis:100%}

  /* Fibre register: paired actions and key figures, then cleaner records. */
  #content.fibres-mode .page-head .actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  #content.fibres-mode .page-head .actions>*:only-child{grid-column:1/-1}
  #content.fibres-mode .stats[aria-label="Fibre summary"]{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.fibres-mode .stats[aria-label="Fibre summary"] .stat{padding:9px 10px}
  #content.fibres-mode .fibre-row{padding:10px 11px;gap:6px 10px}
  #content.fibres-mode .fibre-register-selected .fibre-row-open{grid-column:1/-1}
  #content.fibres-mode .fibre-register-selected .fibre-row-size{display:none}
  #content.fibres-mode .fibre-register-selected .fibre-row-lot{grid-column:1/-1;grid-row:2}
  #content.fibres-mode .fibre-register-selected .fibre-row>span:nth-child(4){grid-column:1;grid-row:3}
  #content.fibres-mode .fibre-register-selected .fibre-row-uses{grid-column:2/4;grid-row:3}
  #content.fibres-mode .fibre-register-selected .fibre-row-actions{grid-column:1/-1;grid-row:4;padding-top:6px}

  /* Analytics: native controls use the same ink colour as the rest of the CRM. */
  #content.analytics-mode .analytics-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:13px}
  #content.analytics-mode .analytics-toolbar label:last-child{grid-column:1/-1}
  #content.analytics-mode .analytics-toolbar select,
  #content.analytics-mode .analytics-toolbar input{width:100%;min-width:0;color:var(--ink);-webkit-text-fill-color:var(--ink);font-size:16px}
  #content.analytics-mode .analytics-toolbar + .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}

  /* Invoicing: all four destinations remain visible as a two-by-two menu. */
  #content.billing-mode .billing-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;width:100%;max-width:none;overflow:visible;margin-bottom:13px}
  #content.billing-mode .billing-tabs button{min-width:0;min-height:39px;padding:7px 6px;justify-content:center;white-space:normal;font-size:11px;line-height:1.2}
  #content.billing-mode>.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}

  /* Files: paired actions and four compact figures. */
  #content.files-mode .page-head .actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  #content.files-mode .files-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.files-mode .files-stats .stat{padding:9px 10px}

  /* Vehicle forms: deliberate grid placement, without overlapping fields. */
  #content.vehicles-mode .vehicle-mileage-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:0 14px 15px}
  #content.vehicles-mode .vehicle-mileage-form .field{min-width:0;width:100%}
  #content.vehicles-mode #vehicle-mileage-form .field:nth-child(3){grid-column:1/-1}
  #content.vehicles-mode #vehicle-mileage-form button[type="submit"]{grid-column:1/-1;width:100%;min-height:40px}
  #content.vehicles-mode #vehicle-maintenance-form button[type="submit"]{grid-column:1/-1;width:100%;min-height:40px}
  #content.vehicles-mode .vehicle-mileage-form .form-error{grid-column:1/-1}
  #content.vehicles-mode .vehicle-maintenance .panel-head{padding:12px 14px}
  #content.vehicles-mode .vehicle-maintenance .panel-head h2{font-size:17px}
  #content.vehicles-mode .vehicle-maintenance .panel-sub{font-size:11px;line-height:1.4}
  #content.vehicles-mode .vehicle-mileage-history{padding:7px 14px 14px}
}

@media(max-width:360px){
  #content.vehicles-mode .vehicle-mileage-form{grid-template-columns:1fr}
  #content.vehicles-mode #vehicle-mileage-form .field:nth-child(3),
  #content.vehicles-mode #vehicle-mileage-form button[type="submit"],
  #content.vehicles-mode #vehicle-maintenance-form button[type="submit"]{grid-column:auto}
}

/* Final iPhone control pass: native inputs must occupy exactly the same box as
   their adjoining controls, and dense records should read top-to-bottom. */
@media(max-width:700px){
  #content.consumables-mode .consumables-overview{padding:14px}
  #content.consumables-mode .consumables-overview-head{margin-bottom:12px}
  #content.consumables-mode .consumables-overview-head h2{font-size:17px}
  #content.consumables-mode .consumables-overview .consumables-section-tabs>a{min-height:70px;padding:10px}
  #content.consumables-mode .page-head .actions{grid-template-columns:repeat(2,minmax(0,1fr))}

  #content.consumables-mode .team-stock-stepper{
    display:grid;grid-template-columns:28px 42px 28px;align-items:stretch;
    width:98px;height:36px;min-height:36px;margin:0;
  }
  #content.consumables-mode .team-stock-stepper button,
  #content.consumables-mode .team-stock-stepper input{
    display:block;box-sizing:border-box;width:100%!important;height:36px!important;
    min-width:0!important;min-height:36px!important;max-height:36px!important;
    margin:0!important;padding:0!important;border-radius:0;line-height:34px!important;
    text-align:center;-webkit-appearance:none;appearance:none;
  }
  #content.consumables-mode .team-stock-stepper button:first-child{border-radius:7px 0 0 7px}
  #content.consumables-mode .team-stock-stepper button:last-child{border-radius:0 7px 7px 0}
  #content.consumables-mode .company-stock-matrix tbody td{align-items:center;min-height:51px}

  #content.fibres-mode .fibre-row{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:"identity identity" "lot lot" "status uses" "actions actions"!important;
    gap:7px 10px!important;padding:11px 12px!important;
  }
  #content.fibres-mode .fibre-row-open{grid-area:identity!important;display:grid!important;gap:2px!important;padding:0!important}
  #content.fibres-mode .fibre-row-lot{grid-area:lot!important;font-size:10px!important}
  #content.fibres-mode .fibre-row-size{display:none!important}
  #content.fibres-mode .fibre-row>span:nth-child(4){grid-area:status!important;align-self:center}
  #content.fibres-mode .fibre-row-uses{grid-area:uses!important;display:grid!important;grid-template-columns:auto auto 72px!important;align-items:center!important}
  #content.fibres-mode .fibre-row-actions{grid-area:actions!important;justify-content:flex-start!important;padding-top:6px!important}
  #content.fibres-mode .fibre-register-group .empty{min-height:0;padding:20px 12px}

  #content.analytics-mode .analytics-toolbar>label{display:grid;min-width:0;max-width:100%;overflow:hidden}
  #content.analytics-mode .analytics-toolbar select,
  #content.analytics-mode .analytics-toolbar input,
  #content.analytics-mode #analytics-anchor{
    display:block;box-sizing:border-box;inline-size:100%!important;max-inline-size:100%!important;
    min-inline-size:0!important;height:44px!important;min-height:44px!important;margin:0!important;
  }

  #content.vehicles-mode .vehicle-mileage-form,
  #content.vehicles-mode #vehicle-mileage-form,
  #content.vehicles-mode #vehicle-maintenance-form{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;padding:0 14px 14px!important;
  }
  #content.vehicles-mode .vehicle-mileage-form>*{grid-column:1!important;min-width:0!important;width:100%!important;box-sizing:border-box}
  #content.vehicles-mode .vehicle-mileage-form .field{display:grid!important;gap:5px!important;margin:0!important}
  #content.vehicles-mode .vehicle-mileage-form input,
  #content.vehicles-mode .vehicle-mileage-form select{box-sizing:border-box;width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;margin:0!important}
  #content.vehicles-mode .vehicle-mileage-form button[type="submit"]{min-height:42px!important}
  #content.vehicles-mode .vehicle-maintenance{overflow:hidden}
  #content.vehicles-mode .vehicle-mileage-history{padding:5px 14px 12px!important}
  #content.vehicles-mode .vehicle-mileage-history p{margin:8px 0}

  #content.account-mode .account-panel{overflow:hidden}
  #content.account-mode .push-setup{margin-top:10px}
  #content.account-mode .push-devices{gap:9px;margin-top:10px}
  #content.account-mode .push-device{padding:12px;border-radius:10px}
  #content.account-mode .push-device-head{grid-template-columns:auto minmax(0,1fr) auto;gap:9px;margin-bottom:11px}
  #content.account-mode .push-device-icon{width:34px;height:34px;border-radius:9px}
  #content.account-mode .push-switch{grid-column:auto;font-size:12px}
  #content.account-mode .push-device>.field{gap:5px}
  #content.account-mode .push-device>.field input{height:42px;min-height:42px}
  #content.account-mode .push-device fieldset{margin-top:11px}
  #content.account-mode .push-device legend{margin-bottom:7px;font-size:13px}
  #content.account-mode .push-categories{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #content.account-mode .push-category{min-height:40px;padding:7px 8px;font-size:11px;line-height:1.3}
  #content.account-mode .push-quiet{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:11px}
  #content.account-mode .push-quiet .field{min-width:0;gap:4px;font-size:11px}
  #content.account-mode .push-quiet input{box-sizing:border-box;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;margin:0!important}
  #content.account-mode .push-device .form-hint{margin:8px 0 0;font-size:10px;line-height:1.4}
  #content.account-mode .push-device-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:11px}
  #content.account-mode .push-device-actions button{width:100%;min-height:38px;padding:7px 9px;font-size:11px}
  #content.account-mode .push-device-actions .danger{grid-column:1/-1}
  #content.account-mode .account-form{gap:13px;padding:0 14px 16px}
  #content.account-mode .account-contact-fields{gap:10px;padding-top:13px}
}

@media(max-width:380px){
  #content.account-mode .push-categories{grid-template-columns:1fr}
  #content.account-mode .push-device-head{grid-template-columns:auto minmax(0,1fr)}
  #content.account-mode .push-switch{grid-column:1/-1}
}

/* November phone usability pass: preserve compact grids and turn wide records
   into readable previews instead of forcing sideways scrolling. */
@media(max-width:700px){
  #content.overview-mode .stats,
  #content.bookings-mode .bookings-stats{grid-template-columns:repeat(2,minmax(0,1fr))}

  #content.exhibitions-mode .ex-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  #content.exhibitions-mode .ex-summary>div:last-child{grid-column:1/-1}
  #content.exhibitions-mode .ex-events:has(.ex-empty){min-height:0}
  #content.exhibitions-mode .ex-empty{margin:0;padding:8px 14px 13px;line-height:1.4}

  #content.eod-mode .eod-procedure-picker>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  #content.eod-mode .eod-procedure-picker label{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:5px;min-width:0;padding:8px;border:1px solid var(--line);border-radius:8px;background:#fff}
  #content.eod-mode .eod-procedure-picker label:has(input:checked){border-color:var(--procedure-colour,var(--teal));background:#f7fbfa}
  #content.eod-mode .eod-procedure-picker label span{min-width:0;padding:0;border:0;background:transparent;font-size:10px;line-height:1.2;overflow-wrap:anywhere}
  #content.eod-mode .eod-procedure-picker input{width:17px;height:17px;margin:0}
  #content.eod-mode .eod-resource-head h4{font-size:13px;line-height:1.25}
  #content.eod-mode .eod-resource-head p{font-size:9.5px;line-height:1.4}
  #content.eod-mode .eod-resource-head>span{width:22px;min-width:22px;height:22px;margin-top:7px;font-size:10px}
  #content.eod-mode .eod-fibre-options{gap:6px;max-height:250px}
  #content.eod-mode .eod-fibre-option{gap:8px;padding:8px 9px}
  #content.eod-mode .eod-fibre-option strong{font-size:11px;line-height:1.25}
  #content.eod-mode .eod-fibre-option small{font-size:9px;line-height:1.35}

  #content.eod-mode .eod-invoice-summary .panel-head{align-items:flex-start}
  #content.eod-mode .eod-invoice-summary .table-wrap{overflow:visible;padding:0 10px 10px}
  #content.eod-mode .eod-invoice-summary table,
  #content.eod-mode .eod-invoice-summary tbody{display:block;width:100%;min-width:0;white-space:normal}
  #content.eod-mode .eod-invoice-summary thead{display:none}
  #content.eod-mode .eod-invoice-summary tbody{display:grid;gap:9px}
  #content.eod-mode .eod-invoice-summary tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;padding:11px;border:1px solid var(--line);border-radius:10px;background:#fff}
  #content.eod-mode .eod-invoice-summary td{display:grid;align-content:start;gap:3px;min-width:0;padding:7px 5px;border:0;font-size:11px;white-space:normal;overflow-wrap:anywhere}
  #content.eod-mode .eod-invoice-summary td::before{content:attr(data-label);color:#80939e;font-size:8px;font-weight:700;letter-spacing:.45px;text-transform:uppercase}
  #content.eod-mode .eod-invoice-summary td:nth-child(1),
  #content.eod-mode .eod-invoice-summary td:nth-child(2){font-size:12px}
  #content.eod-mode .eod-invoice-summary .eod-invoice-open{grid-column:1/-1;padding-top:9px}
  #content.eod-mode .eod-invoice-summary .eod-invoice-open::before{display:none}
  #content.eod-mode .eod-invoice-summary .eod-invoice-open button{width:100%;min-height:36px;padding:7px 10px}
  #content.eod-mode .eod-invoice-item{margin-bottom:2px;line-height:1.3}

  #content.fleet-mode .page-head .actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  #content.fleet-mode .page-head .actions>*{grid-column:auto!important;min-height:42px;padding:7px 5px;font-size:10px;gap:4px;white-space:normal;overflow-wrap:normal}
  #content.fleet-mode .page-head .actions svg{width:14px;height:14px}
  #content.fleet-mode .equipment-category-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  #content.fleet-mode .equipment-category-tabs button{min-width:0;padding:10px 8px;text-align:left}
  #content.fleet-mode .equipment-category-tabs button:first-child{grid-column:auto}
  #content.fleet-mode .equipment-category-tabs span{font-size:10.5px;line-height:1.2;overflow-wrap:anywhere}
  #content.fleet-mode .equipment-category-tabs small{font-size:8.5px}
  #content.fleet-mode .equipment-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #content.fleet-mode .equipment-toolbar .search{grid-column:1/-1;min-width:0;width:100%}
  #content.fleet-mode .equipment-toolbar .filter-select{min-width:0;width:100%;font-size:12px}

  #content.fibres-mode .page-head .actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  #content.fibres-mode .page-head .actions:not(:has(>:nth-child(3))){grid-template-columns:repeat(2,minmax(0,1fr))}
  #content.fibres-mode .page-head .actions>*{grid-column:auto!important;min-width:0;min-height:42px;padding:7px 5px;font-size:10px;gap:4px;white-space:normal;overflow-wrap:normal}
  #content.fibres-mode .page-head .actions svg{width:14px;height:14px}
  #content.fibres-mode .fibre-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #content.fibres-mode .fibre-tabs a{min-width:0;padding:9px 7px;column-gap:5px}
  #content.fibres-mode .fibre-tabs a strong{font-size:10.5px;overflow-wrap:anywhere}
  #content.fibres-mode .fibre-tabs a span{font-size:8px;line-height:1.25}
  #content.fibres-mode .fibre-tabs a svg{width:14px;height:14px}

  #content.lots-mode .lot-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #content.lots-mode .lot-summary .stat{min-width:0;padding:9px 8px}
  #content.lots-mode .lot-summary .stat-top{align-items:flex-start;font-size:9px;line-height:1.2}
  #content.lots-mode .lot-summary .stat-top svg{width:13px;height:13px}
  #content.lots-mode .lot-summary .stat-number{font-size:20px}
  #content.lots-mode .lot-summary .stat-note{font-size:8.5px;line-height:1.25;overflow-wrap:anywhere}
}

/* Final mobile refinement: safe-area-aware app chrome, native iOS control sizing and
   a readable card presentation for the pricing register. */
@media(max-width:700px){
  /* Pin only the app bar, below the iPhone status area. The document and footer
     retain their normal flow so short pages never expose a navy viewport strip. */
  html:not(.calendar-only):not(.calendar-standalone){height:auto;overflow-x:hidden;background:var(--bg)}
  html:not(.calendar-only):not(.calendar-standalone) body{
    min-height:100%;padding-top:calc(64px + env(safe-area-inset-top))!important;
    overflow-x:hidden!important;background:var(--bg)!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .main-shell{
    height:auto!important;min-height:calc(100dvh - 64px - env(safe-area-inset-top))!important;padding-top:0!important;
    overflow:visible!important;background:var(--bg);
  }
  html:not(.calendar-only):not(.calendar-standalone) body::before{
    content:"";position:fixed;z-index:69;inset:0 0 auto;height:env(safe-area-inset-top);
    background:#18313d;pointer-events:none;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar{
    position:fixed!important;inset:env(safe-area-inset-top) 0 auto 0!important;width:100%!important;
    height:64px!important;min-height:64px!important;z-index:70!important;
    transform:none!important;-webkit-transform:none!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .topbar{
    position:fixed!important;top:env(safe-area-inset-top)!important;right:61px!important;z-index:72!important;
    width:max-content!important;margin:0!important;
    transform:none!important;-webkit-transform:none!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .workspace-footer{
    position:static!important;inset:auto!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .mobile-menu-toggle{
    position:absolute!important;top:12px!important;right:12px!important;z-index:73!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"]{
    position:fixed!important;inset:env(safe-area-inset-top) 0 0!important;width:100%!important;
    height:auto!important;min-height:0!important;
    display:flex!important;flex-flow:column nowrap!important;align-items:stretch!important;
    align-content:normal!important;justify-content:flex-start!important;gap:0!important;
    overflow:hidden!important;isolation:isolate;background:var(--navy)!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"]::before{
    content:"";position:fixed;inset:-100vh 0;background:var(--navy);z-index:-1;
  }
  html.mobile-menu-open,html.mobile-menu-open body{
    overflow:hidden!important;overscroll-behavior:none!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] .brand{
    flex:0 0 64px!important;height:64px!important;min-height:64px!important;align-self:flex-start!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation{
    display:flex!important;flex:1 1 auto!important;min-height:0!important;max-height:none!important;
    align-content:flex-start!important;justify-content:flex-start!important;gap:2px!important;
    margin:0!important;padding:6px 12px calc(12px + env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;overscroll-behavior:contain!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation>.nav-item,
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation>.nav-group>.nav-item{
    min-height:42px!important;padding:8px 12px!important;font-size:14px!important;
  }
  html:not(.calendar-only):not(.calendar-standalone) .sidebar[data-menu-open="true"] #navigation>.nav-group{
    flex:0 0 auto!important;margin:0!important;
  }

  #content.billing-mode .billing-pricing .table-wrap{overflow:visible}
  #content.billing-mode .billing-pricing table,
  #content.billing-mode .billing-pricing tbody{display:block;width:100%;min-width:0!important;white-space:normal}
  #content.billing-mode .billing-pricing colgroup,
  #content.billing-mode .billing-pricing thead{display:none}
  #content.billing-mode .billing-pricing tbody{display:grid;gap:8px;padding:10px}
  #content.billing-mode .billing-pricing tbody tr{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 9px;
    padding:11px;border:1px solid var(--line);border-radius:9px;background:#fff;
  }
  #content.billing-mode .billing-pricing tbody td{display:block;min-width:0;padding:0;border:0;white-space:normal}
  #content.billing-mode .billing-pricing tbody td:first-child{grid-column:1/-1;padding-bottom:7px;border-bottom:1px solid #edf2f4}
  #content.billing-mode .billing-pricing tbody td:nth-child(2){grid-column:1}
  #content.billing-mode .billing-pricing tbody td:nth-child(3){grid-column:2;text-align:right}
  #content.billing-mode .billing-pricing tbody td:nth-child(4){grid-column:1/-1}
  #content.billing-mode .billing-pricing tbody td:nth-child(5){grid-column:1}
  #content.billing-mode .billing-pricing tbody td:nth-child(6){grid-column:2;align-self:end}
  #content.billing-mode .billing-price-field{width:100%;max-width:none;height:38px}
  #content.billing-mode .billing-price-field input{height:36px;min-height:36px}
  #content.billing-mode .billing-save{height:38px;min-height:38px}

  #content.vehicles-mode .vehicle-mileage-form input[type="month"],
  #content.vehicles-mode .vehicle-mileage-form input[type="date"]{
    display:block!important;box-sizing:border-box!important;width:100%!important;
    height:44px!important;min-height:44px!important;max-height:44px!important;
    padding:8px 11px!important;line-height:1.2!important;text-align:left!important;
    -webkit-appearance:none!important;appearance:none!important;
  }
  #content.vehicles-mode .vehicle-mileage-form input[type="month"]::-webkit-date-and-time-value,
  #content.vehicles-mode .vehicle-mileage-form input[type="date"]::-webkit-date-and-time-value{
    min-height:0;margin:0;text-align:left;
  }
  #content.vehicles-mode .vehicle-maintenance{border-radius:10px}
  #content.vehicles-mode .vehicle-maintenance .panel-head{padding:11px 13px 9px}
  #content.vehicles-mode .vehicle-mileage-form{padding:0 13px 13px!important}
  #content.vehicles-mode .vehicle-mileage-history{padding:5px 13px 10px!important}
}

/* Live phone review overrides must remain last in the cascade. */
@media(max-width:700px){
  #content.overview-mode .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #content.overview-mode .dashboard-tile:not(.dashboard-key-figure){grid-column:1/-1}
  #content.overview-mode .dashboard-key-figure{grid-column:auto}

  #content.eod-mode .eod-procedure-picker>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.eod-mode .eod-procedure-picker label{display:flex;align-items:center;gap:8px;min-height:43px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#fff}
  #content.eod-mode .eod-procedure-picker input{position:relative;display:grid;place-items:center;flex:0 0 19px;width:19px!important;height:19px!important;min-width:19px!important;min-height:19px!important;margin:0!important;padding:0!important;border:1.5px solid #aab9c1;border-radius:5px;background:#fff;-webkit-appearance:none;appearance:none}
  #content.eod-mode .eod-procedure-picker input:checked{border-color:var(--teal);background:var(--teal)}
  #content.eod-mode .eod-procedure-picker input:checked::after{content:'✓';color:#fff;font-size:13px;font-weight:800;line-height:1}
  #content.eod-mode .eod-procedure-picker label:has(input:checked){border-color:#70bcae;background:#f3faf8}
  #content.eod-mode .eod-procedure-picker label span,
  #content.eod-mode .eod-procedure-picker input:checked+span{display:block;min-width:0;padding:0;background:transparent;border:0;color:var(--ink);font-size:11px;line-height:1.2;overflow-wrap:normal}

  #content.lots-mode .page-head .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #content.lots-mode .page-head .actions>*{grid-column:auto!important;width:100%;min-width:0;min-height:43px;padding:8px 7px;font-size:10.5px;white-space:normal;line-height:1.2}
}
