/* Homepage and menu continuity contract. Loaded last so older responsive patches cannot drift these surfaces. */

:root {
  --dv-home-surface: #e5f3ef;
  --dv-home-surface-border: rgba(5, 71, 85, 0.22);
  --dv-home-panel-shadow: 0 14px 30px rgba(16, 42, 46, 0.12);
  --dv-menu-top: 76px;
}

html body[data-step="debate"],
html body[data-step="debate"] .app-shell,
html body[data-step="debate"] #app.goat-console,
html body[data-step="debate"] #app.goat-console [data-stage="debate"].stage.is-active {
  max-width: 100vw !important;
  overflow-x: clip !important;
}

html body[data-step="debate"] #app.goat-console [data-stage="debate"].stage.is-active > .stage-copy.stage-copy {
  overflow: visible !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-copy.hero-copy {
  box-sizing: border-box !important;
  width: min(620px, calc(100vw - 112px)) !important;
  max-width: min(620px, calc(100vw - 112px)) !important;
  margin-left: clamp(34px, 6vw, 88px) !important;
  margin-right: auto !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search.hero-search {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 62px !important;
  align-items: center !important;
  gap: 0 !important;
  width: min(560px, 100%) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  margin: clamp(14px, 1.8vw, 22px) 0 0 !important;
  padding: 5px !important;
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  border-radius: 9px !important;
  background: #fffaf2 !important;
  box-shadow: 0 12px 26px rgba(16, 42, 46, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  opacity: 1 !important;
  overflow: hidden !important;
  transform: none !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search input {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 clamp(14px, 1.6vw, 22px) !important;
  border: 0 !important;
  border-radius: 7px 0 0 7px !important;
  background: transparent !important;
  color: #20383d !important;
  font-size: clamp(0.94rem, 1vw, 1.02rem) !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search input::placeholder {
  color: rgba(32, 56, 61, 0.6) !important;
  opacity: 1 !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search button[type="submit"] {
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, #c91d42 0%, #ad172e 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 7px 16px rgba(128, 18, 35, 0.2) !important;
  overflow: hidden !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search button[type="submit"] svg {
  width: 25px !important;
  height: 25px !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell {
  box-sizing: border-box !important;
  width: min(1120px, calc(100vw - 28px)) !important;
  max-width: min(1120px, calc(100vw - 28px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border: 1px solid var(--dv-home-surface-border) !important;
  border-radius: 12px !important;
  background: var(--dv-home-surface) !important;
  background-color: var(--dv-home-surface) !important;
  background-image: none !important;
  box-shadow: var(--dv-home-panel-shadow) !important;
  opacity: 1 !important;
  overflow: hidden !important;
  transform: none !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell::before,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell::after {
  display: none !important;
  content: none !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: clamp(14px, 1.4vw, 18px) !important;
  opacity: 1 !important;
  transform: none !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile:nth-child(-n + 4),
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile:nth-child(n + 5),
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile[data-family] {
  background: #ffffff !important;
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
  transition-property: background-color, border-color, box-shadow !important;
  transition-duration: 120ms !important;
}

html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-photo.hero-photo,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-copy.hero-copy,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-search.hero-search,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell,
html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-grid {
  animation: none !important;
  transition-property: background-color, border-color, box-shadow, opacity !important;
  transition-duration: 120ms !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header {
  position: relative !important;
  z-index: 30000 !important;
  overflow: visible !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu {
  box-sizing: border-box !important;
  position: fixed !important;
  top: var(--dv-menu-top) !important;
  left: max(12px, env(safe-area-inset-left)) !important;
  z-index: 30020 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  width: min(440px, calc(100vw - 24px)) !important;
  max-width: min(440px, calc(100vw - 24px)) !important;
  max-height: calc(100dvh - 88px) !important;
  padding: 14px !important;
  border: 1px solid rgba(16, 42, 46, 0.12) !important;
  border-radius: 8px !important;
  background: #fffdf8 !important;
  background-image: none !important;
  box-shadow: 0 28px 70px rgba(16, 42, 46, 0.18) !important;
  opacity: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  pointer-events: none !important;
  transform: translate3d(calc(-100% - 18px), 0, 0) !important;
  transform-origin: top left !important;
  visibility: hidden !important;
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 170ms ease,
    visibility 0s linear 260ms !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header.is-menu-open #portalMenu.portal-menu {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
  visibility: visible !important;
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 170ms ease,
    visibility 0s linear 0s !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu a,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu button {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 50px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 66px !important;
  height: auto !important;
  padding: 8px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: var(--dv-ink, #102a2e) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  text-align: left !important;
  text-decoration: none !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-section {
  margin: 5px 2px 1px !important;
  color: rgba(126, 29, 39, 0.78) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.02em !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-image-mark {
  width: 50px !important;
  min-width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 8px !important;
  background: #eef8f4 !important;
  box-shadow: none !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-image {
  width: 50px !important;
  height: 50px !important;
  object-fit: contain !important;
  filter: none !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-copy {
  min-width: 0 !important;
  gap: 2px !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-copy strong,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-copy em {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-copy strong {
  font-size: 0.96rem !important;
  line-height: 1.08 !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-copy em {
  font-size: 0.74rem !important;
  line-height: 1.22 !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu a:hover,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu button:hover,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu a:focus-visible,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu button:focus-visible,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu a.is-active,
html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu button.is-active {
  border-color: rgba(5, 71, 85, 0.18) !important;
  color: var(--dv-teal, #07545d) !important;
  background: #f1faf6 !important;
  box-shadow: inset 4px 0 0 rgba(5, 71, 85, 0.72) !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #menuToggle.menu-toggle,
html body[data-step] .app-shell.app-shell .app-header.app-header #menuToggle.menu-toggle:focus,
html body[data-step] .app-shell.app-shell .app-header.app-header #menuToggle.menu-toggle[aria-expanded="true"] {
  outline: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body[data-step] .app-shell.app-shell .app-header.app-header #menuToggle.menu-toggle:focus-visible {
  border-color: rgba(5, 71, 85, 0.22) !important;
  background: rgba(229, 243, 239, 0.76) !important;
  box-shadow: 0 0 0 3px rgba(5, 71, 85, 0.12) !important;
}

@media (max-width: 980px) {
  :root {
    --dv-menu-top: 72px;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-copy.hero-copy {
    width: min(640px, calc(100vw - 64px)) !important;
    max-width: min(640px, calc(100vw - 64px)) !important;
    margin-left: clamp(24px, 4vw, 44px) !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search.hero-search {
    width: min(560px, 100%) !important;
    max-width: 100% !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  :root {
    --dv-menu-top: 70px;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-copy.hero-copy {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search.hero-search {
    grid-template-columns: minmax(0, 1fr) 54px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 4px !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search input {
    height: 50px !important;
    min-height: 50px !important;
    padding-inline: 14px !important;
    font-size: 0.93rem !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console [data-stage="debate"].stage.is-active .hero-search button[type="submit"] {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    padding: 12px !important;
  }

  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu {
    left: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 12px !important;
  }
}

@media (max-width: 380px) {
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    padding: 10px !important;
  }

  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu a,
  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu button {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    min-height: 60px !important;
    padding: 7px 8px !important;
  }

  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-image-mark,
  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu .portal-menu-image {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body[data-step] .app-shell.app-shell .app-header.app-header #portalMenu.portal-menu,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-photo.hero-photo,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-copy.hero-copy,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console .hero-search.hero-search,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-shell,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile-grid,
  html body[data-step="debate"] .app-shell.app-shell #app.goat-console.goat-console #categoryCards .launch-tile {
    transition: none !important;
  }
}
