/* Shared advisor on the storefront, native modal chrome and standalone pages. */
.hab-consultant-standalone {
  position: fixed;
  z-index: 180;
  inset-inline-start: 12px;
  inset-block-end: calc(14px + env(safe-area-inset-bottom, 0px));
  max-inline-size: calc(100vw - 24px);
}

.hab-consultant-inline {
  position: relative;
  z-index: 2;
  inset: auto;
  flex: none;
  margin: 0;
}

body :is(.mobile-command, .hab-consultant-standalone) > .hab-consultant-trigger[data-consultant-open] {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 6px 11px;
  border: 1px solid #e7d9df;
  border-radius: 11px;
  color: #79293c;
  background: #fbf5f7;
  box-shadow: none;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.3;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

body .hab-consultant-trigger[data-consultant-open] > .hab-consultant-trigger-icon {
  display: block;
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  object-fit: contain;
}

body .hab-consultant-trigger[data-consultant-open] > [data-consultant-label] {
  min-inline-size: 0;
  color: inherit;
  font-size: .8125rem;
  font-weight: 750;
  line-height: 1.26;
  text-align: center;
  white-space: normal;
}

body .hab-consultant-trigger[data-consultant-open] > i,
body .hab-consultant-trigger[data-consultant-open] > svg:not(.hab-consultant-trigger-icon) {
  display: none;
}

body :is(.mobile-command, .hab-consultant-standalone) > .hab-consultant-trigger[data-consultant-open]:is([aria-expanded="true"], :hover) {
  background: #f4e5eb;
  border-color: #cda7b1;
  color: #642133;
}

body .hab-consultant-trigger[data-consultant-open]:focus-visible {
  outline: 2px solid #8e2946;
  outline-offset: 2px;
}

body .hab-consultant-inline .hab-consultant-trigger[data-consultant-open] {
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border-color: #ffffff42;
  background: #ffffffdc;
}

body .hab-consultant-inline .hab-consultant-trigger[data-consultant-open] > [data-consultant-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body .hab-consultant-inline .hab-consultant-trigger[data-consultant-open] > svg {
  display: block;
  color: #79293c;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] {
  position: absolute;
  inset: auto;
  inset-inline-start: 0;
  inset-block-end: calc(100% + 10px);
  box-sizing: border-box;
  inline-size: min(372px, calc(100vw - 24px));
  max-inline-size: calc(100vw - 24px);
  max-block-size: max(118px, calc(var(--hab-shell-viewport-height, 100dvh) - var(--hab-shell-top, 0px) - var(--hab-shell-bottom, 66px) - 24px));
  padding: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #e8e1e4;
  border-radius: 17px;
  color: #1b181c;
  background: #fff;
  box-shadow: 0 18px 48px #23161f35, 0 4px 14px #23161f14;
  line-height: 1.4;
  text-align: start;
}

body .mobile-command > .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] {
  inset-inline-start: 10px;
  max-inline-size: calc(100% - 20px);
}

body .hab-consultant-inline > .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] {
  position: fixed;
  inset-inline-start: 12px;
  inset-block-start: 66px;
  inset-block-end: auto;
  max-block-size: calc(100dvh - 82px);
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][hidden] {
  display: none !important;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 3px 9px;
  margin: 0 0 7px;
  padding: 12px;
  border: 0;
  border-block-start: 3px solid #a83c58;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(133deg, #2c222a, #151418 84%);
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > header > h2 {
  grid-column: 1;
  align-self: end;
  margin: 0;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.28;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > header > .hab-consultant-intro {
  grid-column: 1;
  align-self: start;
  margin: 0;
  color: #eadce4;
  font-size: .8125rem;
  line-height: 1.4;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > header > [data-consultant-close] {
  position: static;
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  min-inline-size: 44px;
  min-block-size: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #ffffff3a;
  border-radius: 10px;
  color: #fff;
  background: #ffffff13;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > header > [data-consultant-close]:hover {
  background: #ffffff24;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option {
  position: static;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  box-sizing: border-box;
  gap: 10px;
  inline-size: 100%;
  min-block-size: 60px;
  margin: 0;
  padding: 8px;
  border: 1px solid #e4ebe7;
  border-radius: 11px;
  color: #242029;
  background: #f7faf8;
  font-family: inherit;
  line-height: 1.35;
  text-align: start;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option + a.hab-consultant-option {
  margin-block-start: 6px;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option:hover {
  border-color: #aac9b8;
  background: #eff7f2;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option.hab-consultant-help {
  border-color: #802843;
  color: #fff;
  background: #802843;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option.hab-consultant-help:hover {
  border-color: #6d2038;
  background: #6d2038;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option > .hab-consultant-symbol {
  display: grid;
  place-items: center;
  inline-size: 39px;
  block-size: 39px;
  border-radius: 10px;
  color: #1a6241;
  background: #e1f0e7;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-help > .hab-consultant-symbol {
  color: #78273e;
  background: #fff0f3;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-symbol :is(svg, img) {
  inline-size: 24px;
  block-size: 24px;
  margin: 0;
  color: inherit;
  object-fit: contain;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-arrow {
  display: none;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-option-copy {
  display: grid;
  gap: 3px;
  min-inline-size: 0;
  color: inherit;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-option-copy :is([data-consultant-name], [data-consultant-help-label]) {
  display: block;
  color: inherit;
  font-size: .875rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-option-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  color: #355b47;
  font-size: .75rem;
  font-weight: 550;
  line-height: 1.3;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-option-meta :is(.hab-consultant-channel, bdi) {
  color: inherit;
  font: inherit;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-help .hab-consultant-option-meta {
  color: #fbe5eb;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] .hab-consultant-option-meta bdi {
  flex: none;
  inline-size: auto;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  text-align: start;
  unicode-bidi: isolate;
  white-space: nowrap;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] :is(a,button):focus-visible {
  outline: 2px solid #7f2a47;
  outline-offset: 2px;
}

body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] :is([data-consultant-help], [data-consultant-close]):focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

@media (max-width: 420px) {
  body .mobile-command .hab-consultant-trigger[data-consultant-open] {
    gap: 4px;
    padding-inline: 4px;
  }

  body .mobile-command .hab-consultant-trigger[data-consultant-open] > .hab-consultant-trigger-icon {
    inline-size: 20px;
    block-size: 20px;
  }

  body .mobile-command .hab-consultant-trigger[data-consultant-open] > [data-consultant-label] {
    font-size: .75rem;
  }
}

@media (max-width: 359px) {
  body .mobile-command .hab-consultant-trigger[data-consultant-open] {
    flex-direction: column;
    gap: 2px;
    height: auto;
    padding-block: 4px;
  }
}

/* Consultant card motion follows the popup state without moving its trigger. */
body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="closing"] {
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] {
    --consultant-lift: 8px;
  }

  body .hab-consultant-inline > .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] {
    --consultant-lift: -6px;
  }

  body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="open"]:not([hidden]) {
    animation: hab-consultant-card-open 210ms cubic-bezier(.2, .75, .25, 1) both;
  }

  body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="closing"]:not([hidden]) {
    animation: hab-consultant-card-close 150ms ease-in both;
  }

  @supports (transition-behavior: allow-discrete) {
    body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="open"]:not([hidden]),
    body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="closing"]:not([hidden]) {
      animation: none;
      transition: opacity var(--consultant-motion-duration, 210ms) var(--consultant-motion-easing, cubic-bezier(.2, .75, .25, 1)),
        transform var(--consultant-motion-duration, 210ms) var(--consultant-motion-easing, cubic-bezier(.2, .75, .25, 1));
    }

    body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="open"]:not([hidden]) {
      opacity: 1;
      transform: none;
    }

    body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="closing"]:not([hidden]) {
      --consultant-motion-duration: 150ms;
      --consultant-motion-easing: ease-in;
      opacity: 0;
      transform: translateY(var(--consultant-lift));
    }

    @starting-style {
      body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup][data-consultant-motion="open"]:not([hidden]) {
        opacity: 0;
        transform: translateY(var(--consultant-lift));
      }
    }
  }
}

@keyframes hab-consultant-card-open {
  from { opacity: 0; transform: translateY(var(--consultant-lift)); }
  to { opacity: 1; transform: none; }
}

@keyframes hab-consultant-card-close {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(var(--consultant-lift)); }
}

@media (prefers-reduced-motion: reduce) {
  body .hab-consultant-trigger[data-consultant-open],
  body .hab-consultant-popup.hab-consultant-polished[data-consultant-popup] > a.hab-consultant-option {
    transition: none;
  }
}
