:root {
  --pilot-nav-height: 80px;
  --pilot-nav-compact-height: 56px;
}

.pilot-sitebar {
  --nav-ink: #152e49;
  --nav-paper: #f4f2ec;
  --nav-accent: #c44d1b;
  --ask-edge: max(16px, env(safe-area-inset-right, 0px));
  container-type: inline-size;
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  box-sizing: border-box;
  background: var(--nav-paper);
  border: 0;
  color: var(--nav-ink);
  font-family: var(--sans, system-ui, sans-serif);
}
.pilot-sitebar * { box-sizing: border-box; }
.pilot-sitebar .site-header__inner {
  display: flex;
  position: relative;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1320px;
  height: var(--pilot-nav-height);
  margin: 0 auto;
  padding: 0 28px;
  gap: 12px;
}
.pilot-sitebar .brand, .pilot-sitebar .brand span {
  color: inherit;
  margin: 0;
  text-decoration: none;
}
.pilot-sitebar .brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.pilot-sitebar .pilot-location { position: relative; flex: 0 1 auto; min-width: 0; }
.pilot-sitebar .pilot-location select { width: min(160px, 100%); min-width: 42px; font: inherit; }
.pilot-sitebar .pilot-location [hidden] { display: none; }
.pilot-sitebar .pilot-location-button {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px;
  max-width: 150px; min-height: 40px; margin: 0; padding: 0 7px;
  background: transparent; color: inherit; border: 0; border-radius: 6px;
  font: 600 14px/1.2 var(--sans, system-ui, sans-serif); cursor: pointer;
}
.pilot-sitebar .pilot-location-button:hover { background: #8498aa26; }
.pilot-location-button svg { flex: none; width: 16px; height: 16px; }
.pilot-location-button [data-pilot-location-label] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilot-location-button [data-pilot-location-code] { display: none; }
.pilot-sitebar .pilot-location-menu {
  position: absolute; z-index: 2; top: calc(100% + 5px); left: 0;
  display: flex; flex-direction: column; gap: 8px;
  width: min(308px, calc(100vw - 16px)); max-height: calc(100dvh - 100px);
  padding: 12px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #c6d2da; border-radius: 6px; background: white; color: #152e49;
  box-shadow: 0 8px 26px #152e492a; text-align: left;
  font: 400 15px/1.4 var(--sans, system-ui, sans-serif);
}
.pilot-location-menu label { font-size: 14px; font-weight: 650; }
.pilot-location-menu input {
  box-sizing: border-box; width: 100%; min-height: 42px; flex: none;
  margin: 0; padding: 6px 10px; color: #152e49; background: white;
  border: 1px solid #aebdc9; border-radius: 6px; font: inherit; font-size: 16px;
}
.pilot-location-menu [role=listbox] { position: relative; min-height: 0; max-height: min(290px, 45dvh); overflow-y: auto; overscroll-behavior: contain; }
.pilot-location-menu [role=option] {
  display: block; width: 100%; min-height: 40px; padding: 7px 10px;
  border: 0; border-radius: 4px; color: inherit; background: transparent;
  font: inherit; text-align: left; cursor: pointer;
}
.pilot-location-menu [role=option]:hover, .pilot-location-menu .is-active { background: #e9eff4; }
.pilot-location-menu [aria-selected=true] { font-weight: 700; }
.pilot-location-menu [role=status] { margin: 0; font: inherit; }
.pilot-location-menu [role=status]:empty { display: none; }
.pilot-location :is(button, input):focus-visible { outline: 2px solid #5186b2; outline-offset: -2px; }
.pilot-sitebar #primary-nav.pilot-nav-links {
  display: flex;
  align-items: center;
  flex-flow: row nowrap;
  gap: clamp(8px, 1.6vw, 28px);
  margin: 0 0 0 auto;
  padding: 0;
}
.pilot-sitebar #primary-nav.pilot-nav-links > .pilot-nav-item,
.pilot-sitebar .pilot-ai--mobile,
.pilot-sitebar .site-nav-toggle,
.pilot-sitebar #primary-nav .home-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 40px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 600 14px/1 var(--sans, system-ui, sans-serif);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.pilot-sitebar .pilot-nav-item svg {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
}
.pilot-sitebar #primary-nav .pilot-nav-item:hover,
.pilot-sitebar .pilot-ai--mobile:hover { background: #e6ebef; }
.pilot-sitebar #primary-nav .pilot-nav-item[aria-current] { color: var(--nav-accent); }
.pilot-sitebar #primary-nav .home-nav__cta {
  min-height: 48px;
  padding-inline: 22px;
  background: var(--nav-accent);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.pilot-sitebar #primary-nav .home-nav__cta:hover { background: #a93e12; color: white; }
.pilot-sitebar .pilot-ai--mobile, .pilot-sitebar .site-nav-toggle { display: none; }
.pilot-sitebar .site-nav-toggle { background: white; border: 1px solid #d5d8db; padding-inline: 12px; }

/* Keep the entire menu together against the available header's right edge,
   including when the open chat narrows the page. */
@media (min-width: 1151px) {
  .pilot-sitebar #primary-nav.pilot-nav-links {
    position: relative;
    left: calc(max(0px, 50cqw - 660px) + 28px - var(--ask-edge));
  }
}

/* The home search sets its own docking threshold and interpolates row height. */
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) {
  background: #152e49;
  color: white;
}
.pilot-sitebar[data-compact] .site-header__inner { height: var(--pilot-nav-compact-height); }
.pilot-sitebar[data-compact] ~ main { --hdr-h: var(--pilot-nav-compact-height); }
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) .brand { color: white; }
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav.pilot-nav-links { gap: 4px; }
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav .pilot-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: white;
}
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav .pilot-nav-item:hover { background: #31516f; }
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) .pilot-nav-label { display: none; }
:is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav .home-nav__cta {
  min-height: 38px;
  padding-inline: 14px;
}

@media (max-width: 1150px) {
  .pilot-sitebar .site-header__inner { padding-right: var(--ask-edge); }
  .pilot-sitebar .pilot-ai--mobile { display: inline-flex; }
  .pilot-sitebar .site-nav-toggle { display: inline-flex; margin-left: auto; }
  .pilot-sitebar #primary-nav.pilot-nav-links {
    display: none;
    position: absolute;
    inset: calc(100% - 3px) var(--ask-edge) auto auto;
    width: min(300px, calc(100% - 24px));
    max-height: calc(100dvh - var(--pilot-nav-height));
    overflow: auto;
    padding: 10px;
    background: white;
    color: #152e49;
    border: 1px solid #dae0e6;
    border-radius: 12px;
    box-shadow: 0 12px 30px #152e4930;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }
  .pilot-sitebar #primary-nav.pilot-nav-links.is-open { display: flex; }
  .pilot-sitebar #primary-nav.pilot-nav-links > .pilot-nav-item { justify-content: flex-start; padding-inline: 12px; }
  .pilot-sitebar #primary-nav.pilot-nav-links > .pilot-ai--desktop { display: none; }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) :is(.site-nav-toggle, .pilot-ai--mobile) { display: none; }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav.pilot-nav-links {
    display: flex;
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    color: white;
    border: 0;
    box-shadow: none;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
  }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav.pilot-nav-links > .pilot-nav-item {
    display: inline-flex;
    justify-content: center;
    padding: 0;
  }
}
@media (max-width: 880px) {
  :root { --pilot-nav-height: 72px; }
  .pilot-sitebar { --ask-edge: max(12px, env(safe-area-inset-right, 0px)); }
  .pilot-sitebar .site-header__inner { padding-inline: 18px var(--ask-edge); }
}
@media (max-width: 640px) {
  :root { --pilot-nav-height: 62px; --pilot-nav-compact-height: 52px; }
  .pilot-sitebar { --ask-edge: max(8px, env(safe-area-inset-right, 0px)); }
  .pilot-sitebar .site-header__inner { padding-inline: 12px var(--ask-edge); gap: 6px; }
  .pilot-sitebar .brand { font-size: 14px; }
}
@media (max-width: 540px) {
  .pilot-sitebar .site-header__inner { justify-content: flex-start; }
  .pilot-sitebar .pilot-location-button { max-width: 108px; padding-inline: 3px; }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) .brand { display: none; }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav.pilot-nav-links {
    flex: 1;
    justify-content: space-between;
    gap: 1px;
  }
}
@media (max-width: 420px) {
  .pilot-location-button [data-pilot-location-label] { display: none; }
  .pilot-location-button [data-pilot-location-code] { display: inline; }
}
@media (max-width: 379px) {
  .pilot-sitebar { --ask-edge: max(6px, env(safe-area-inset-right, 0px)); }
  .pilot-sitebar .site-header__inner { gap: 3px; padding-inline: 6px var(--ask-edge); }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav.pilot-nav-links > .pilot-nav-item { width: 34px; }
  :is(.is-docked .pilot-sitebar, .pilot-sitebar[data-compact]) #primary-nav .home-nav__cta { padding-inline: 8px; }
}

@media (min-width: 901px) {
  .pilot-chat-open .pilot-sitebar { right: var(--pilot-chat-width); }
  .pilot-chat-open .wide-break {
    width: calc(100vw - var(--pilot-chat-width));
    margin-inline: calc(50% - (100vw - var(--pilot-chat-width)) / 2);
  }
  .pilot-chat-open .claim-page,
  .pilot-chat-open .claim-page:has(#claim-form-view:not([hidden])) { width: 100% !important; }
  .pilot-chat-open .compare-shortcut { right: calc(var(--pilot-chat-width) + 20px); }
  .pilot-chat-open .local-webchat__launcher, .pilot-chat-open .listing-profile__contact-card .local-webchat,
  .pilot-chat-open .local-webchat { right: calc(var(--pilot-chat-width) + 20px); }
  .pilot-chat-open #app .stage, .pilot-chat-open #app .pin-spacer { max-width: calc(100vw - var(--pilot-chat-width)) !important; }
  .pilot-chat-open #app .panel { max-width: 94%; }
}
/* At this width the docked categories fit beneath the nav, in the search row. */
@media (min-width: 1151px) and (max-width: 1570px) {
  body.pilot-chat-open.is-docked .site-header__tabs { display: none; }
  body.pilot-chat-open.is-docked .home-search .pilot-tabs { display: flex; margin-bottom: 4px; }
}
