html,
    body {
      max-width: 100%;
      overflow-x: hidden;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    .hidden {
      display: none !important;
    }

    input,
    textarea,
    select {
      pointer-events: auto;
      user-select: text;
      -webkit-user-select: text;
      touch-action: manipulation;
    }

    body.chat-open {
      height: 100dvh;
      overflow: hidden;
    }

    #saveChatModal {
      z-index: 2000;
    }

    body.chat-open > .max-w-4xl {
      height: 100dvh;
      min-height: 0;
    }

    body.chat-open #chatScreen {
      height: calc(100dvh - 88px);
      min-height: 0;
    }

    #chat {
      position: relative;
      z-index: 1;
      overflow-x: hidden;
      scroll-behavior: smooth;
      overscroll-behavior: contain;
      -ms-overflow-style: none;
      scrollbar-width: none;
    }

    #chat::-webkit-scrollbar,
    .doctor-carousel::-webkit-scrollbar,
    .option-scroll::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
      background: transparent;
    }

    #chatInputBar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1000;
      box-sizing: border-box;
      padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
      overflow-x: hidden;
    }

    #chatInputBar textarea {
      min-height: 2.5rem;
      max-height: 9rem;
      line-height: 1.5;
      resize: none;
      overflow-y: auto;
      pointer-events: auto;
      user-select: text;
      -webkit-user-select: text;
      touch-action: manipulation;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    #chatInputBar textarea::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    #sendMessageButton {
      min-width: 2.5rem;
      min-height: 2.5rem;
      padding: 0;
    }

    #chatActions {
      width: 100%;
      max-width: 100%;
    }

    #chatActions .chat-action-button {
      flex: 1 1 10rem;
      min-width: 0;
      max-width: 13rem;
      min-height: 2.5rem;
      padding: 0.55rem 0.9rem;
      white-space: normal;
      line-height: 1.2;
      text-align: center;
    }

    #chatActions .chat-action-button span:last-child {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .doctor-results-section {
      max-width: 100%;
      overflow: hidden;
    }

    .doctor-carousel {
      max-width: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      -ms-overflow-style: none;
      scrollbar-width: none;
      padding-bottom: 0;
    }

    .option-scroll {
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      -ms-overflow-style: none;
      scrollbar-width: none;
      justify-content: flex-start;
      flex-wrap: nowrap;
      padding: 0.35rem 0.25rem 0.65rem;
      scroll-padding-left: 0.25rem;
      scroll-padding-right: 0.25rem;
      scroll-snap-type: none !important;
      overscroll-behavior-x: contain;
    }

    .option-scroll.centered {
      justify-content: center;
    }

    .option-card {
      width: auto;
      min-width: max-content;
      max-width: none;
      scroll-snap-align: none !important;
      text-align: left;
      white-space: nowrap;
      touch-action: pan-x pan-y;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      cursor: pointer;
    }

    .option-card:disabled {
      opacity: 0.65;
      pointer-events: none;
    }

    .option-card:active {
      transform: scale(0.98);
    }


.option-card {
  backface-visibility: hidden;
  transform: translateZ(0);
}

@media (hover: hover) and (pointer: fine) {
  .option-card:hover {
    border-color: rgb(13 148 136);
  }
}


    .option-card > div {
      white-space: nowrap;
    }

    #heroTitle {
      font-size: clamp(1.65rem, 7vw, 2.5rem) !important;
      line-height: 1.15;
    }

    #heroText {
      font-size: clamp(0.9rem, 3.2vw, 1rem);
      line-height: 1.45;
    }

    @media (max-width: 640px) {
      body {
        font-size: 14px;
      }

      .max-w-4xl {
        padding-left: 1rem;
        padding-right: 1rem;
      }

      header {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
      }

      #startScreen {
        justify-content: flex-start !important;
        padding-top: 1.5rem;
        padding-bottom: 1rem !important;
      }

      #heroTitle {
        font-size: 1.7rem !important;
        line-height: 1.18 !important;
        max-width: 22rem;
      }

      #heroText {
        margin-top: 0.75rem !important;
        font-size: 0.9rem;
        line-height: 1.45;
        max-width: 20rem;
      }

      #stepContent {
        margin-top: 1.75rem !important;
      }

      #stepContent h2 {
        font-size: 1.1rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem !important;
      }

      #stepContent p,
      #stepCounter,
      #chat,
      #text,
      #customAnswer {
        font-size: 0.88rem;
      }

      #stepContent p {
        line-height: 1.4;
        margin-bottom: 1rem !important;
      }

      #stepContent button {
        font-size: 0.82rem !important;
        padding: 0.65rem 0.9rem !important;
        border-radius: 0.9rem !important;
      }

      .option-scroll {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        scroll-padding-left: 1rem;
        scroll-padding-right: 1rem;
      }

      .option-card {
        width: auto !important;
        min-width: max-content !important;
        max-width: none !important;
        white-space: nowrap !important;
      }

      #customAnswer,
      #text {
        font-size: 0.9rem !important;
      }

      #chat {
        font-size: 0.88rem;
        padding-top: 0.25rem !important;
      }

      #chat .text-sm {
        font-size: 0.88rem !important;
        line-height: 1.45;
      }

      #chat .px-4.py-3 {
        padding: 0.65rem 0.85rem !important;
      }

      #chatInputBar {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 0.6rem !important;
      }

      #chatInputBar .px-4.py-3 {
        padding: 0.65rem 0.85rem !important;
      }

      #sendMessageButton {
        min-width: 44px;
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
      }

      #chatActions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
      }

      #chatActions .chat-action-button {
        width: 100%;
        max-width: none;
        min-height: 2.75rem;
        padding: 0.55rem 0.65rem !important;
        border-radius: 0.9rem !important;
      }

      .doctor-carousel {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
      }

      .doctor-carousel button {
        width: calc(100vw - 48px) !important;
        max-width: 300px !important;
      }

      .doctor-carousel h3 {
        font-size: 0.9rem !important;
        line-height: 1.25;
      }

      .doctor-carousel .text-xs,
      .doctor-carousel .text-\[11px\] {
        font-size: 0.72rem !important;
      }

      #stepCounter {
        font-size: 0.72rem !important;
      }
    }
