/* EarthRoute2Scanner V13.0 — Professional iPhone UI System
   Visual/layout overrides only. No scanner, OCR, routing, driver, navigation,
   storage or API behaviour is changed. */
:root{
  --v13-space-1:4px;--v13-space-2:8px;--v13-space-3:12px;--v13-space-4:16px;
  --v13-space-5:20px;--v13-space-6:24px;--v13-radius:22px;
  --v13-page-max:760px;
}

/* Critical safe-area repair: the sticky app bar already occupies layout space.
   Legacy releases also padded body for a fixed bar, creating the large blank top. */
html,body{margin:0!important;padding-top:0!important;width:100%!important;max-width:100%!important;}
body{padding-bottom:0!important;min-height:100dvh!important;}
main{
  margin:0!important;
  padding:12px 0 calc(124px + env(safe-area-inset-bottom))!important;
  min-height:0!important;
}
.v67-page{
  min-height:0!important;
  padding-top:0!important;
  padding-bottom:24px!important;
}

/* Compact commercial iPhone header */
.v66-appbar{
  position:sticky!important;
  top:0!important;left:0!important;right:0!important;
  min-height:0!important;height:auto!important;
  padding:max(10px,env(safe-area-inset-top)) 16px 12px!important;
  margin:0!important;
  background:rgba(15,23,42,.97)!important;
  border-bottom:1px solid rgba(148,163,184,.16)!important;
  box-shadow:0 8px 24px rgba(2,6,23,.16)!important;
  z-index:1700!important;
}
.v66-brand{gap:12px!important;}
.v66-logo{
  width:48px!important;height:48px!important;min-width:48px!important;flex:0 0 48px!important;
  padding:4px!important;border-radius:15px!important;background:#fff!important;
  box-shadow:0 6px 16px rgba(2,6,23,.22)!important;
}
.v66-brand-title{font-size:initial!important;}
.earthroute2-wordmark-top{font-size:15px!important;line-height:1.05!important;}
.earthroute2-wordmark-bottom{font-size:9px!important;line-height:1.1!important;margin-top:4px!important;}
.v66-brand-sub{font-size:10px!important;line-height:1.2!important;margin-top:5px!important;}
#v68ThemeButton{width:46px!important;height:46px!important;min-width:46px!important;flex:0 0 46px!important;border-radius:15px!important;}

/* Consistent page container */
.v91-home-shell,.v110-driver-screen,.v64-dashboard-page,.v62-settings-page{
  width:100%!important;max-width:var(--v13-page-max)!important;margin:0 auto!important;
  padding-left:14px!important;padding-right:14px!important;box-sizing:border-box!important;
}
.v91-home-shell{padding-top:0!important;}

/* Weather card: prevent date/place/refresh collision */
.v91-weather{
  display:grid!important;
  grid-template-columns:52px minmax(0,1fr) 46px!important;
  align-items:center!important;gap:12px!important;
  min-height:108px!important;padding:15px!important;margin:0 0 14px!important;
  overflow:hidden!important;
}
.v91-weather-icon{width:52px!important;height:52px!important;min-width:52px!important;}
.v91-weather-copy{min-width:0!important;width:100%!important;overflow:hidden!important;}
.v91-weather-top{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:3px!important;
  align-items:start!important;margin:0 0 7px!important;
}
.v91-weather-top strong,.v91-weather-top span{
  display:block!important;min-width:0!important;max-width:100%!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
.v91-weather-top strong{font-size:14px!important;}
.v91-weather-top span{font-size:11px!important;}
.v91-weather-line{display:flex!important;align-items:baseline!important;gap:8px!important;min-width:0!important;flex-wrap:wrap!important;}
.v91-weather-line strong{font-size:30px!important;line-height:1!important;}
.v91-weather-line span{min-width:0!important;font-size:13px!important;white-space:normal!important;}
#v91WeatherDetails{display:none!important;}
.v91-icon-button{position:static!important;margin:0!important;justify-self:end!important;}

/* Design-system rhythm */
.v91-welcome,.v91-card,.card,.v110-driver-shell,.v115-performance-card{border-radius:var(--v13-radius)!important;}
.v91-welcome{padding:22px!important;margin-bottom:14px!important;}
.v91-card,.card{padding:18px!important;margin-bottom:14px!important;}
.v91-card h2,.card h2{line-height:1.15!important;}

/* Keep floating action and navigation separated */
#v66ContinueRoute.show{
  bottom:calc(94px + env(safe-area-inset-bottom))!important;
  width:min(360px,calc(100% - 28px))!important;
  min-height:58px!important;border-radius:18px!important;
  box-shadow:0 14px 34px rgba(37,99,235,.30)!important;
}
.v6-bottom-nav{
  left:10px!important;right:10px!important;width:calc(100% - 20px)!important;
  bottom:calc(8px + env(safe-area-inset-bottom))!important;
  padding:6px!important;border-radius:23px!important;
}
.v6-bottom-nav button{min-height:58px!important;border-radius:16px!important;}

/* Avoid content being obscured when the continue control is visible */
body:has(#v66ContinueRoute.show) main{padding-bottom:calc(190px + env(safe-area-inset-bottom))!important;}

/* Universal overflow safety for dynamic delivery data */
.v91-home-shell *,.v110-driver-screen *{box-sizing:border-box;}
.v91-home-shell h1,.v91-home-shell h2,.v91-home-shell h3,
.v110-address,#currentNav,.v91-field-copy{overflow-wrap:anywhere!important;word-break:normal!important;}

@media(max-width:430px){
  .v66-appbar{padding-left:13px!important;padding-right:13px!important;}
  .v66-brand-sub{display:block!important;max-width:190px!important;}
  .v91-home-shell{padding-left:12px!important;padding-right:12px!important;}
  .v91-weather{grid-template-columns:48px minmax(0,1fr) 44px!important;gap:10px!important;min-height:100px!important;padding:13px!important;}
  .v91-weather-icon{width:48px!important;height:48px!important;min-width:48px!important;}
  .v91-weather-line strong{font-size:28px!important;}
}
@media(max-width:370px){
  .v66-brand-sub{display:none!important;}
  .earthroute2-wordmark-top{font-size:14px!important;}
  .v91-weather{grid-template-columns:44px minmax(0,1fr) 40px!important;gap:8px!important;}
}
