/* FleetDV v101 — shared vehicle-profile, account, booking and metric interactions. */
.workspace-header>.page-heading{order:1;min-width:0}
.workspace-header>.experience-command-trigger{order:2;margin-left:auto}
.workspace-header>.header-actions{order:3;margin-left:0}
.workspace-header>.experience-profile-control{order:4;margin-left:2px;flex:0 0 auto}

#experienceProfileButton{
  width:52px!important;height:48px!important;min-width:52px;padding:0 7px!important;display:flex!important;align-items:center;justify-content:center;gap:5px;
  border:1px solid var(--border-default)!important;border-radius:15px!important;background:var(--card-elevated-bg)!important;color:var(--text-primary)!important;
  box-shadow:0 5px 16px color-mix(in srgb,#000 12%,transparent)!important;cursor:pointer!important;
}
#experienceProfileButton:hover{border-color:var(--accent)!important;background:var(--metric-bg)!important;transform:translateY(-1px)}
#experienceProfileButton:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 48%,transparent)!important;outline-offset:2px}
#experienceProfileInitials{width:34px!important;height:34px!important;flex:0 0 34px;border-radius:11px!important;background-color:var(--metric-bg)!important;background-size:cover!important;background-position:center!important}
.experience-profile-chevron{display:block!important;color:var(--text-muted)!important;font-size:.78rem!important;pointer-events:none}
.experience-profile-menu{background:var(--card-elevated-bg)!important;color:var(--text-primary)!important;border-color:var(--border-default)!important;opacity:1!important;pointer-events:auto!important}

.fleet-pulse-title{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px}
.fleet-pulse-title>div{min-width:0}
.vehicle-card-footer{align-items:center!important}
.vehicle-card-footer>div{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:max-content}
.vehicle-profile-link{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:max-content;min-height:36px;padding:6px 8px;border:0;border-radius:8px;
  background:transparent;color:var(--accent);font:800 .76rem "DM Sans",sans-serif;line-height:1;white-space:nowrap;cursor:pointer;text-decoration:none;
}
.vehicle-profile-link:hover{background:var(--metric-bg);color:var(--text-primary)}
.vehicle-profile-link:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 48%,transparent);outline-offset:1px}
.vehicle-profile-lifecycle{display:flex!important;align-items:center;gap:9px;flex-wrap:wrap;margin-top:12px!important}
.vehicle-profile-lifecycle b{padding:5px 9px;border-radius:999px;background:color-mix(in srgb,var(--negative) 18%,var(--card-elevated-bg));color:var(--text-primary)}
.vehicle-profile-lifecycle span{color:inherit}

.upcoming-booking-row{position:relative!important;display:grid!important;grid-template-columns:120px minmax(180px,1fr) auto!important;align-items:center!important;gap:16px!important;min-width:0!important;overflow:visible!important;padding-block:12px!important}
.upcoming-booking-row>.upcoming-vehicle-image{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:1!important;width:88px!important;min-width:88px!important;max-width:88px!important;height:66px!important;margin:0!important;transform:none!important;align-self:center;overflow:hidden}
.upcoming-booking-row>.upcoming-vehicle-image{width:112px!important;min-width:112px!important;max-width:112px!important;height:76px!important;border-radius:10px!important;background:var(--metric-bg)!important}
.upcoming-booking-row>.upcoming-vehicle-image img{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center!important}
.upcoming-booking-copy{grid-column:2!important;grid-row:1!important;min-width:0!important;padding:0!important;margin:0!important;transform:none!important}
.upcoming-booking-copy strong{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.upcoming-booking-copy span,.upcoming-booking-copy small{max-width:100%;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
.upcoming-booking-result{grid-column:3!important;grid-row:1!important;min-width:96px!important;margin:0!important;transform:none!important}

:is(.fleet-pulse-metrics>div,.vehicle-card-facts>div,.break-stats>div){background:var(--metric-bg)!important;color:var(--text-primary)!important;border:1px solid var(--border-subtle)!important}
:is(.fleet-pulse-metrics,.vehicle-card-facts,.break-stats) :is(span,strong,b){color:var(--text-primary)}
:is(.fleet-pulse-metrics,.vehicle-card-facts,.break-stats) span{color:var(--text-secondary)!important}

@media(max-width:780px){
  .workspace-header{display:grid!important;grid-template-columns:44px minmax(0,1fr) 42px 48px!important;grid-template-rows:auto auto;align-items:center;gap:8px!important}
  .workspace-header>.menu-button{grid-column:1;grid-row:1;width:44px;height:44px}
  .workspace-header>.page-heading{grid-column:2;grid-row:1}
  .workspace-header>.experience-command-trigger{grid-column:3;grid-row:1;width:42px!important;height:42px!important;margin:0!important;padding:0!important;display:grid!important;place-items:center}
  .experience-command-trigger :is(strong,kbd){display:none!important}
  .workspace-header>.experience-profile-control{grid-column:4;grid-row:1;margin:0;justify-self:end}
  #experienceProfileButton{width:44px!important;height:44px!important;min-width:44px;padding:0!important;border-radius:12px!important}
  #experienceProfileInitials{width:34px!important;height:34px!important;flex-basis:34px}
  .experience-profile-chevron{display:none!important}
  .workspace-header>.header-actions{grid-column:1/-1;grid-row:2;width:100%;margin:0!important}
  .upcoming-booking-row{grid-template-columns:76px minmax(0,1fr) auto!important;gap:11px!important;align-items:start!important}
  .upcoming-booking-row>.upcoming-vehicle-image{width:72px!important;min-width:72px!important;max-width:72px!important;height:56px!important}
  .upcoming-booking-result{grid-column:3!important;grid-row:1!important;min-width:68px!important}
  .vehicle-profile-link{min-height:40px}
}

@media(max-width:430px){
  .workspace-header{grid-template-columns:42px minmax(0,1fr) 40px 44px!important;gap:6px!important}
  .upcoming-booking-row{grid-template-columns:68px minmax(0,1fr)!important}
  .upcoming-booking-row>.upcoming-vehicle-image{width:64px!important;min-width:64px!important;max-width:64px!important;height:50px!important}
  .upcoming-booking-copy{grid-column:2!important}
  .upcoming-booking-result{grid-column:2!important;grid-row:2!important;display:flex!important;align-items:center;justify-content:space-between;min-width:0!important;width:100%}
  .fleet-pulse-title{grid-template-columns:minmax(0,1fr) auto!important}
}

/* Version 105: one collision-safe booking identity layout for phone cards and Overview rows. */
.upcoming-period-note{margin:4px 0 0;color:var(--text-muted);font-size:.75rem;line-height:1.35}

@media(max-width:780px){
  :root{--mobile-nav-height:72px}
  .workspace{padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 48px)!important}
  .booking-identity-layout{display:grid!important;grid-template-columns:72px minmax(0,1fr)!important;column-gap:11px!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}
  .booking-identity-layout>.booking-card-thumbnail{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:1 / span 2!important;width:72px!important;min-width:72px!important;max-width:72px!important;height:54px!important;aspect-ratio:auto!important;margin:0!important;transform:none!important;align-self:start!important;overflow:hidden!important;border-radius:10px!important;background:var(--metric-bg)!important}
  .booking-identity-layout>.booking-card-thumbnail img{width:100%!important;height:100%!important;padding:3px!important;object-fit:contain!important;object-position:center!important}
  .booking-mobile-identity,.upcoming-booking-copy{grid-column:2!important;grid-row:1!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;padding:0!important;margin:0!important}
  .booking-mobile-guest,.booking-mobile-identity strong,.booking-mobile-identity small,.upcoming-booking-copy strong,.upcoming-booking-copy span,.upcoming-booking-copy small{display:block!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;word-break:normal!important;overflow-wrap:anywhere!important}
  .booking-mobile-guest,.upcoming-booking-copy strong{color:var(--text-primary)!important;white-space:nowrap!important}
  .booking-mobile-identity strong,.upcoming-booking-copy span{color:var(--text-secondary)!important;white-space:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;line-clamp:2!important}
  .booking-mobile-identity small,.upcoming-booking-copy small{color:var(--text-muted)!important;white-space:nowrap!important}
  .booking-mobile-head>.status-pill{grid-column:2!important;grid-row:2!important;justify-self:start!important;margin-top:7px!important;max-width:100%!important}
  .upcoming-booking-result{grid-column:2!important;grid-row:2!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;min-width:0!important;width:100%!important;margin-top:8px!important}
  .upcoming-booking-result>strong{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:var(--text-primary)!important}
  .booking-mobile-result{margin:10px 0 8px!important;padding:9px 0!important;background:transparent!important;border-block:1px solid var(--border)!important}
  .booking-mobile-card details summary{padding:3px 0!important}
}

@media(max-width:430px){
  .booking-identity-layout{grid-template-columns:64px minmax(0,1fr)!important;column-gap:10px!important}
  .booking-identity-layout>.booking-card-thumbnail{width:64px!important;min-width:64px!important;max-width:64px!important;height:48px!important}
}

/* Version 106: one mobile viewport contract for every page and experience. */
*,*::before,*::after{box-sizing:border-box}

@media(max-width:780px){
  :root{
    --mobile-page-gutter:16px;
    --mobile-nav-edge:10px;
    --mobile-nav-height:72px;
  }

  html,body{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  /* Clipping is defensive only. The width and minimum-track rules below remove
     the sources of overflow before anything reaches this boundary. */
  .app-shell{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:100dvh;
    overflow-x:clip;
  }

  body:is(.experience-modern,.experience-premium) .workspace,
  .workspace{
    position:relative!important;
    left:auto!important;
    transform:none!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding-inline:var(--mobile-page-gutter)!important;
    padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 24px)!important;
    overflow:visible;
  }

  .workspace>*,.view,.view>*,.dashboard-grid,.lower-grid,.metric-grid,
  .section-toolbar,.panel,.fleet-panel,.fleet-pulse,.vehicle-grid,
  .bookings-data-surface,.expense-financial-workspace,.annual-dashboard-grid,
  .modern-overview-extension,.modern-side-stack,.modern-side-stack-wide,
  .calendar-board,.setup-launchpad,.setup-steps,.setup-step{
    min-width:0!important;
    max-width:100%!important;
  }

  .workspace-header{
    grid-template-columns:42px minmax(0,1fr) 40px 44px!important;
    column-gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-inline:0!important;
  }
  .workspace-header>.page-heading,
  .workspace-header>.header-actions,
  .workspace-header>.experience-profile-control{min-width:0!important;max-width:100%!important}
  .workspace-header>.experience-command-trigger{min-width:40px!important;max-width:40px!important}
  #experienceProfileButton{min-width:44px!important;max-width:44px!important}
  .page-heading :is(h1,p,span){max-width:100%}

  .workspace-header>.header-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
  }
  .mobile-period-button{
    width:fit-content!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .global-period-selectors,
  body.experience-modern .global-period-selectors,
  body.experience-premium .global-period-selectors{
    left:var(--mobile-page-gutter)!important;
    right:var(--mobile-page-gutter)!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
  }

  .setup-launchpad{width:100%!important;overflow:hidden!important}
  .setup-launchpad>summary{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:12px!important;
    width:100%!important;
    min-width:0!important;
  }
  .setup-intro,.setup-intro :is(h2,p),.setup-steps,.setup-step>div{min-width:0!important;max-width:100%!important}
  .setup-intro :is(h2,p),.setup-step :is(strong,small){overflow-wrap:anywhere}
  .setup-toggle{justify-self:end;max-width:100%;white-space:nowrap}
  .setup-launchpad .setup-steps{width:100%!important;grid-template-columns:minmax(0,1fr)!important}
  .setup-launchpad .setup-step{
    width:100%!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    margin-inline:0!important;
  }
  .setup-launchpad .setup-step :is(.setup-state,.secondary-button){max-width:100%!important}

  :is(.panel-head,.section-toolbar,.toolbar-actions,.experience-section-head)>*{min-width:0;max-width:100%}
  :is(.panel-head,.section-toolbar,.toolbar-actions,.experience-section-head) :is(h2,h3,p,strong,small){overflow-wrap:anywhere}
  :is(input,select,textarea,button){max-width:100%}
  :is(.fleet-table-wrap,.annual-table-wrap,.table-wrap){max-width:100%;overscroll-behavior-inline:contain}

  .experience-mobile-nav{
    position:fixed!important;
    left:var(--mobile-nav-edge)!important;
    right:var(--mobile-nav-edge)!important;
    bottom:calc(env(safe-area-inset-bottom) + 8px)!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    transform:none!important;
    margin:0!important;
  }
  .experience-mobile-nav button{width:100%;min-width:0!important;max-width:100%;overflow:hidden}
  .experience-mobile-nav small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

@media(max-width:360px){
  :root{--mobile-page-gutter:12px;--mobile-nav-edge:8px}
  .workspace-header{grid-template-columns:40px minmax(0,1fr) 38px 42px!important;column-gap:5px!important}
  .workspace-header>.experience-command-trigger{min-width:38px!important;max-width:38px!important}
  #experienceProfileButton{min-width:42px!important;max-width:42px!important}
  .setup-launchpad>summary{grid-template-columns:minmax(0,1fr)!important}
  .setup-toggle{justify-self:start}
}

/* Unpublished iOS touch-containment candidate.
   The standards-mode document scrolls at HTML, outside the app-shell boundary.
   Restrict page panning without canceling events, vertical scroll, or pinch zoom.
   Nested scroll containers terminate the touch-action ancestor check for panning;
   they explicitly retain both axes below. */
@media(max-width:780px){
  html:has(#appShell:not([hidden])){
    touch-action:pan-y pinch-zoom;
    overscroll-behavior-x:none;
    overflow-x:clip;
  }
  #appShell:not([hidden]){
    touch-action:pan-y pinch-zoom;
  }
  #appShell :is(.fleet-table-wrap,.table-wrap,.annual-table-wrap,
    .annual-trend-chart,.modern-vehicle-grid,.metric-grid){
    touch-action:pan-x pan-y pinch-zoom;
    overscroll-behavior-x:none;
  }
}
