body {
  font-family: system-ui, -apple-system, sans-serif;
  background:#f3f4f6;
}

#app {
  max-width:720px;
  margin:40px auto;
  background:#fff;
  border-radius:10px;
  padding:20px;
}
.msg { margin:12px 0; line-height:1.4; clear:both;}
.user { font-weight:600; }
.msg.You{background:#f3f3f3;border-radius:5px;float:right;padding:12px 20px 2px;text-align:right;}
.Assistant { color:#333; }
#textarea {
  width:100%;
  padding:14px;
  margin-top:15px;
  border-radius:8px;
  border:1px solid #ccc;
}
#chat {
  max-height: 70vh;   /* or whatever fits your layout */
  overflow-y: auto;
  padding:20px 20px 0px 10px;
}

#input {
  width: 100%;
  resize: none;
  overflow-y: hidden;
  line-height: 1.4;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
  max-height: 200px; /* prevents runaway growth */
  transition: height 0.15s ease;
}


.input-row {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.input-row ::before, .input-row ::after{box-sizing:content-box;}

#sendBtn {
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #2563eb;
  color: white;
  cursor: pointer;
}

#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 767px) {

  /* Chat container */
  #chat {
    max-height: 65dvh; /* slightly more room for keyboard */
    padding: 6px;
    padding-right: 20px;
  }

  /* Messages */
  .msg {
    font-size: .95rem;
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .sender-name {
    display: block;
    margin-bottom: 2px;
  }

  /* Input row */
  .input-row {
    gap: 6px;
  }

  /* Textarea */
  #input {
    font-size: 16px;        /* prevents iOS zoom */
    min-height: 44px;       /* touch-friendly */
    padding: 12px;
    max-height: 160px;      /* keeps it from taking over */
  }

  /* Send / Stop button */
  #sendBtn {
    min-height: 44px;
    padding: 0 16px;
    font-size: 1rem;
  }
}
