/*
 * Layout stability fix
 *
 * The packaged dashboard is rendered from a flex column. On narrow
 * viewports, the navigation's old `height: 100%` rule can resolve against
 * the flex row's content height and leave only a short green strip visible.
 * Keep the app shell and navigation tied to the viewport instead.
 */
html,
body,
#root {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

#root > div {
  min-height: 100vh;
}

#root header.sticky {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04),
    0 12px 30px rgba(15, 23, 42, 0.04);
}

#root header.sticky > div {
  max-width: 1440px;
}

#root header.sticky > div > div:first-child > div:first-child {
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.18);
}

#hero {
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 18%, rgba(153, 246, 228, 0.36), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(167, 243, 208, 0.32), transparent 24%),
    linear-gradient(180deg, #f0fdfa 0%, #f8fffd 42%, #ffffff 100%);
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

#hero::before {
  width: 220px;
  height: 220px;
  left: -110px;
  top: 170px;
  border: 1px solid rgba(13, 148, 136, 0.12);
  box-shadow: 0 0 0 24px rgba(13, 148, 136, 0.035),
    0 0 0 48px rgba(13, 148, 136, 0.02);
}

#hero::after {
  width: 180px;
  height: 180px;
  right: -90px;
  bottom: 92px;
  background: rgba(167, 243, 208, 0.2);
}

#hero > div > div > div:first-child {
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.1);
}

#hero h1 {
  text-wrap: balance;
  letter-spacing: -0.045em;
}

#hero h1 span {
  white-space: nowrap;
}

#hero p {
  color: #475569;
}

#hero button {
  min-height: 50px;
}

#pricing {
  scroll-margin-top: 84px;
}

#pricing > div:first-child h2 {
  letter-spacing: -0.035em;
}

#pricing > div.grid > div {
  min-height: 470px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

#pricing > div.grid > div:nth-child(2) {
  box-shadow: 0 20px 48px rgba(13, 148, 136, 0.16);
}

#root aside {
  height: auto !important;
  min-height: 100vh !important;
  align-self: stretch;
}

#root main,
#root [class*="flex-1"] {
  min-width: 0;
}

@media (max-width: 767px) {
  /* Public landing-page header: keep the logo and actions inside the phone. */
  #root header.sticky > div {
    height: auto;
    min-height: 72px;
    padding: 10px 12px;
    gap: 8px;
  }

  #root header.sticky > div > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }

  #root header.sticky > div > div:first-child > div:first-child {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  #root header.sticky > div > div:first-child > div:nth-child(2) {
    min-width: 0;
  }

  #root header.sticky > div > div:first-child > div:nth-child(2) > div {
    min-width: 0;
  }

  #root header.sticky > div > div:first-child span:first-child {
    font-size: 17px;
  }

  #root header.sticky > div > div:first-child p {
    max-width: 130px;
    overflow: hidden;
    line-height: 1.2;
    white-space: normal;
  }

  #root header.sticky > div > div:last-child {
    flex: 0 0 auto;
    gap: 6px;
  }

  #root header.sticky > div > div:last-child button {
    white-space: nowrap;
    padding: 9px 10px;
    font-size: 11px;
  }

  /*
   * Keep navigation usable without forcing the 178px desktop rail onto a
   * phone-sized viewport. The existing collapse button remains available,
   * while labels and the user card are removed to preserve room for content.
   */
  #root aside {
    width: 58px !important;
    min-width: 58px;
    overflow: hidden;
  }

  #root aside > div:first-child {
    height: 60px;
    justify-content: center;
    padding: 0;
  }

  #root aside > div:first-child > div:nth-child(2),
  #root aside > div:nth-child(3) > div:first-child,
  #root aside > div:last-child > div:first-child {
    display: none;
  }

  #root aside > div:nth-child(2) {
    padding: 12px 8px 0;
  }

  #root aside > div:nth-child(2) button {
    justify-content: center;
    padding: 0;
  }

  #root aside > div:nth-child(2) button span,
  #root aside nav button span {
    display: none;
  }

  #root aside > div:nth-child(3) {
    padding: 24px 8px 0;
  }

  #root aside nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  #root aside nav button {
    width: 42px;
    margin: 0 auto;
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  #root aside > div:last-child > div:last-child {
    padding: 0 8px 12px;
  }

  #root aside > div:last-child > div:last-child button {
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  #root main {
    overflow-x: hidden;
    padding: 12px;
  }

  #root header {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 390px) {
  /* At very narrow widths the hero already provides the primary CTA. */
  #root header.sticky > div > div:last-child button:first-child {
    display: none;
  }

  #root header.sticky > div > div:last-child button:last-child {
    padding-left: 9px;
    padding-right: 9px;
  }
}