@media (max-width: 760px), (max-height: 760px) {
  html,
  body {
    height: 100%;
    height: 100dvh;
  }

  body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .topbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 3%;
  }

  .navlinks {
    flex-wrap: nowrap;
    margin: 0 0 0 auto;
  }

  .hero {
    flex: 0 0 auto;
    padding: 16px 4% 34px;
  }

  .hero .container {
    width: 100%;
    margin: 0;
  }

  .hero h1 {
    margin-bottom: 4px;
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .hero p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.4;
  }

  .chat-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    width: min(820px, 96%);
    margin: -18px auto 0;
    padding: 10px;
    border-radius: 12px 12px 0 0;
  }

  .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 10px;
    overscroll-behavior: contain;
  }

  .chat-form {
    flex: 0 0 auto;
    margin-top: 8px;
  }

  #chat-note {
    flex: 0 0 auto;
    margin: 7px 2px 0;
    font-size: .76rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .chat-messages {
    min-height: 0;
    height: auto;
  }
}

@media (max-width: 380px), (max-height: 620px) {
  .topbar {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .brand small,
  #hero-subtitle,
  #chat-note {
    display: none;
  }

  .hero {
    padding-top: 10px;
    padding-bottom: 27px;
  }
}
