/* One restrained app header for DealerOS and MarketSync Digital. */
body > header.ms-chrome-glass {
  min-height: 64px;
  padding: 8px 18px !important;
  gap: 18px !important;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 2px 16px rgba(15, 23, 42, .055);
  backdrop-filter: blur(16px);
}
html.dark body > header.ms-chrome-glass {
  background: rgba(15, 23, 42, .96) !important;
  border-bottom-color: rgba(148, 163, 184, .14);
  box-shadow: 0 2px 16px rgba(0, 0, 0, .18);
}
body > header.ms-chrome-glass > div:first-child,
body > header.ms-chrome-glass > div:last-child { gap: 8px !important; }
body > header.ms-chrome-glass > div:first-child { flex: 1 1 auto; min-width: 0; }
body > header.ms-chrome-glass > div:last-child { flex: 0 0 auto; min-width: 0; }

/* The PNG has generous transparent canvas. Keep the visible wordmark crisp and
   leave the account actions enough space at tablet widths. */
body > header.ms-chrome-glass #dashboard-brand { width: 13rem; height: 3.5rem; flex: 0 0 auto; }
body > header.ms-chrome-glass #dashboard-brand img[alt="MarketSync DealerOS"] {
  width: 15rem !important; height: auto !important; left: -1.2rem; top: -3.88rem;
}

body > header.ms-chrome-glass #header-shift-clock-chip,
body > header.ms-chrome-glass #header-weather-chip {
  height: 40px !important; min-height: 40px !important;
  padding: 0 11px !important; border-radius: 12px !important;
  background: #f6f8fc !important; border: 1px solid #e2e8f0 !important;
  box-shadow: none !important; color: #17243a !important;
  font-size: 12px !important; font-weight: 750 !important;
}
html.dark body > header.ms-chrome-glass #header-shift-clock-chip,
html.dark body > header.ms-chrome-glass #header-weather-chip {
  color: #e2e8f0 !important; background: #1e293b !important;
  border-color: #334155 !important;
}
body > header.ms-chrome-glass #header-shift-clock-chip:hover,
body > header.ms-chrome-glass #header-weather-chip:hover {
  border-color: #93c5fd !important; background: #eff6ff !important;
}
html.dark body > header.ms-chrome-glass #header-shift-clock-chip:hover,
html.dark body > header.ms-chrome-glass #header-weather-chip:hover { background: #26364f !important; }

body > header.ms-chrome-glass #header-profile-btn,
body > header.ms-chrome-glass #header-settings-btn,
body > header.ms-chrome-glass #notif-bell,
body > header.ms-chrome-glass #logout-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 40px !important; min-width: 40px !important; max-width: 40px !important;
  height: 40px !important; min-height: 40px !important;
  padding: 0 !important; border-radius: 12px !important;
  border: 1px solid transparent !important; box-shadow: none !important;
  background: transparent !important; color: #334155 !important;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
html.dark body > header.ms-chrome-glass #header-profile-btn,
html.dark body > header.ms-chrome-glass #header-settings-btn,
html.dark body > header.ms-chrome-glass #notif-bell,
html.dark body > header.ms-chrome-glass #logout-btn { color: #cbd5e1 !important; }
body > header.ms-chrome-glass #header-profile-btn:hover,
body > header.ms-chrome-glass #header-settings-btn:hover,
body > header.ms-chrome-glass #notif-bell:hover,
body > header.ms-chrome-glass #logout-btn:hover,
body > header.ms-chrome-glass #header-profile-btn:focus-visible,
body > header.ms-chrome-glass #header-settings-btn:focus-visible,
body > header.ms-chrome-glass #notif-bell:focus-visible,
body > header.ms-chrome-glass #logout-btn:focus-visible {
  color: #1d4ed8 !important; background: #eff6ff !important;
  border-color: #bfdbfe !important; outline: none;
}
html.dark body > header.ms-chrome-glass #header-profile-btn:hover,
html.dark body > header.ms-chrome-glass #header-settings-btn:hover,
html.dark body > header.ms-chrome-glass #notif-bell:hover,
html.dark body > header.ms-chrome-glass #logout-btn:hover { background: #1e3a5f !important; border-color: #334e73 !important; color: #93c5fd !important; }
body > header.ms-chrome-glass #logout-btn:hover { color: #be123c !important; background: #fff1f2 !important; border-color: #fecdd3 !important; }
body > header.ms-chrome-glass #header-profile-btn svg,
body > header.ms-chrome-glass #header-settings-btn svg,
body > header.ms-chrome-glass #notif-bell svg,
body > header.ms-chrome-glass #logout-btn svg { width: 20px !important; height: 20px !important; }
body > header.ms-chrome-glass .ms-header-identity { max-width: 160px; margin-right: 5px !important; }

@media (min-width: 640px) and (max-width: 1199px) {
  body > header.ms-chrome-glass { padding: 7px 12px !important; gap: 10px !important; }
  body > header.ms-chrome-glass #dashboard-brand { width: 11.5rem; height: 3.25rem; }
  body > header.ms-chrome-glass #dashboard-brand img[alt="MarketSync DealerOS"] { width: 13.4rem !important; left: -1.05rem; top: -3.38rem; }
  body > header.ms-chrome-glass #header-shift-timer-display,
  body > header.ms-chrome-glass #header-shift-clock-chip > .h-3\.5 { display: none !important; }
  body > header.ms-chrome-glass #header-shift-clock-chip > div { display: none !important; }
  body > header.ms-chrome-glass #header-clock-display { min-width: 0 !important; }
}
@media (max-width: 767px) {
  body > header.ms-chrome-glass #header-weather-chip { display: none !important; }
  body > header.ms-chrome-glass { min-height: 58px; padding: 6px 10px !important; gap: 5px !important; }
  body > header.ms-chrome-glass > div:first-child,
  body > header.ms-chrome-glass > div:last-child { gap: 3px !important; }
  body > header.ms-chrome-glass #header-profile-btn,
  body > header.ms-chrome-glass #header-settings-btn,
  body > header.ms-chrome-glass #notif-bell,
  body > header.ms-chrome-glass #logout-btn { width: 38px !important; min-width: 38px !important; max-width: 38px !important; height: 40px !important; }
}
@media (max-width: 479px) {
  body > header.ms-chrome-glass #dashboard-brand { width: 8.7rem; height: 3rem; }
  body > header.ms-chrome-glass #dashboard-brand img[alt="MarketSync DealerOS"] { width: 10.1rem !important; left: -.7rem; top: -1.9rem; }
  body > header.ms-chrome-glass #header-shift-clock-chip { padding: 0 6px !important; height: 38px !important; min-height: 38px !important; }
}


/* 2026 compact SVG wordmark. Never apply the obsolete PNG crop rules. This
   file loads AFTER dashboard.html's inline rules and must agree with them. */
body > header.ms-chrome-glass #dashboard-brand {
  display: flex !important; align-items: center !important;
  justify-content: flex-start !important; overflow: visible !important;
  width: clamp(9.75rem, 16vw, 13.25rem) !important;
  height: 2.7rem !important; flex: 0 0 auto !important;
}
body > header.ms-chrome-glass #dashboard-brand img[alt="MarketSync"] {
  position: static !important; inset: auto !important;
  width: 100% !important; max-width: 100% !important;
  height: auto !important; max-height: 2.7rem !important;
  margin: 0 !important; transform: none !important;
  object-fit: contain !important; object-position: left center !important;
}
@media (min-width: 640px) and (max-width: 1439px) {
  body > header.ms-chrome-glass { gap: 8px !important; }
  body > header.ms-chrome-glass #dashboard-brand { width: clamp(9.5rem, 15vw, 12rem) !important; }
  body > header.ms-chrome-glass #header-social-icons,
  body > header.ms-chrome-glass .ms-header-identity,
  body > header.ms-chrome-glass #ui-role-pill { display: none !important; }
  body > header.ms-chrome-glass #ext-header-btn .ms-ext-label-full,
  body > header.ms-chrome-glass #ext-header-btn .ms-ext-label-short,
  body > header.ms-chrome-glass #header-clock-date { display: none !important; }
}

@media (max-width: 767px) {
  body > header.ms-chrome-glass #dashboard-brand { width: 9.25rem !important; height: 2.4rem !important; }
}
@media (max-width: 479px) {
  body > header.ms-chrome-glass #dashboard-brand { width: 7.75rem !important; height: 2.1rem !important; }
  body > header.ms-chrome-glass #dashboard-brand img[alt="MarketSync"] { max-height: 2.1rem !important; }
}

/* Mobile dashboards use the official square MarketSync mark. Keep the complete
   wordmark on tablet/desktop; never crop unreadable text on a narrow phone. */
body > header.ms-chrome-glass #dashboard-brand .ms-header-mobile-logo-mark{
  display:none!important;
}
@media(max-width:639px){
  body > header.ms-chrome-glass{
    padding:8px 10px!important;min-height:58px!important;
    gap:5px!important;flex-wrap:nowrap!important;align-items:center!important
  }
  body > header.ms-chrome-glass > div:first-child{
    min-width:0!important;flex:0 0 auto!important;gap:4px!important
  }
  body > header.ms-chrome-glass > div:last-child{
    margin-left:auto!important;flex:0 0 auto!important;
    min-width:0!important;gap:2px!important
  }
  body > header.ms-chrome-glass #dashboard-brand{
    width:34px!important;min-width:34px!important;max-width:34px!important;
    height:34px!important;min-height:34px!important;max-height:34px!important;
    flex:0 0 34px!important;overflow:hidden!important;align-items:center!important
  }
  body > header.ms-chrome-glass #dashboard-brand > img[alt="MarketSync"]{
    display:none!important
  }
  body > header.ms-chrome-glass #dashboard-brand .ms-header-mobile-logo-mark{
    display:block!important;width:34px!important;height:34px!important;
    min-width:34px!important;max-width:34px!important;max-height:34px!important;
    object-fit:contain!important;transform:none!important;position:static!important
  }
  body > header.ms-chrome-glass #header-shift-clock-wrapper,
  body > header.ms-chrome-glass #header-social-icons,
  body > header.ms-chrome-glass #ext-header-btn,
  body > header.ms-chrome-glass #ui-role-pill,
  body > header.ms-chrome-glass .ms-header-identity{display:none!important}
  body > header.ms-chrome-glass #header-profile-btn,
  body > header.ms-chrome-glass #header-settings-btn,
  body > header.ms-chrome-glass #notif-bell,
  body > header.ms-chrome-glass #logout-btn{
    width:35px!important;min-width:35px!important;
    height:38px!important;padding:7px!important
  }
}

/* Phones: every header control has to fit on the one row. With the Demo badge
   beside the logo the row was 47px too wide at 390px and pushed Log out off the
   screen (and without it, Log out and the bell at 320-360px). The generic 40px
   header touch-target rule was holding each EN/FR/ES button at 40px.
   `html` outranks the phone rules header-weather.js injects after this sheet. */
@media (max-width: 430px) {
  html body > header.ms-chrome-glass { padding-left: 8px !important; padding-right: 8px !important; gap: 4px !important; }
  html body > header.ms-chrome-glass > div:last-child { gap: 0 !important; }
  html body > header.ms-chrome-glass #ms-ui-lang button { min-width: 26px !important; padding: 0 3px !important; }
  html body > header.ms-chrome-glass #ms-dealeros-v2-search { width: 34px !important; min-width: 34px !important; }
  html body > header.ms-chrome-glass #header-profile-btn,
  html body > header.ms-chrome-glass #header-settings-btn,
  html body > header.ms-chrome-glass #notif-bell,
  html body > header.ms-chrome-glass #logout-btn { width: 32px !important; min-width: 32px !important; max-width: 32px !important; padding: 6px !important; }
  html body > header.ms-chrome-glass #demo-mode-badge { padding: 4px 8px !important; }
}

/* A 320px phone with the Demo badge is still 37px short. There the language
   switch shows only the current language, and tapping it moves on to the next
   (js/ui-i18n.js); every other control keeps its place. */
@media (max-width: 359px) {
  html body > header.ms-chrome-glass:has(#demo-mode-badge) #ms-ui-lang button[aria-pressed="false"] { display: none !important; }
}
