/* Keep introduction-only content out of an active conversation. */
#chat-welcome[hidden] ~ .studio-launcher { display: none; }

/* The input and controls have separate rows, including long mobile drafts. */
#chat-form { display: flex; flex-direction: column; }
#chat-input {
  flex: 0 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(210px, 28dvh);
  overscroll-behavior-y: contain;
}
#chat-form .composer-toolbar { flex: 0 0 auto; margin-top: 6px; }
#chat-form .send-button { flex: 0 0 auto; align-self: flex-end; }
#chat-form .composer-helper { flex: 0 0 auto; }

/* WU-02 / Mobile Chat Entry R1 — CSS-only, no auth/storage/action changes.
 * Keep the composer and protected API boundaries untouched.
 * Compact the welcome area so the first message is easier to reach.
 */
@media (max-width: 780px) {
  #chat-panel .chat-flow {
    padding: 10px 14px 14px;
  }
  #chat-panel .welcome {
    margin: clamp(8px, 2dvh, 18px) auto 12px;
  }
  #chat-panel .welcome-mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 9px;
  }
  #chat-panel .welcome-mark img {
    width: 74px;
    height: 74px;
  }
  #chat-panel .welcome .overline {
    font-size: 9px;
    letter-spacing: .13em;
    margin: 0 0 9px;
  }
  #chat-panel .welcome h1 {
    font-size: clamp(25px, 6.8vw, 31px);
    line-height: 1.26;
    margin-bottom: 8px;
  }
  #chat-panel .welcome > p:not(.overline) {
    font-size: 12px;
    line-height: 1.55;
  }
  /* Horizontal example rail; do not make the whole page horizontally scroll. */
  #chat-panel .suggestion-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 74%);
    grid-template-columns: none;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 16px auto 8px;
    padding: 0 0 9px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #796248 transparent;
    -webkit-overflow-scrolling: touch;
  }
  #chat-panel .suggestion-grid button {
    min-width: 0;
    min-height: 54px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    scroll-snap-align: start;
  }
  #chat-panel .suggestion-grid button:focus-visible {
    outline: 2px solid #dfc29d;
    outline-offset: -2px;
  }
}
@media (max-width: 360px) {
  #chat-panel .chat-flow { padding-inline: 12px; }
  #chat-panel .suggestion-grid { grid-auto-columns: minmax(184px, 78%); }
  #chat-panel .welcome h1 { font-size: 25px; }
}
@media (max-height: 640px) and (max-width: 780px) {
  #chat-panel .welcome-mark { width: 62px; height: 62px; margin-bottom: 5px; }
  #chat-panel .welcome-mark img { width: 60px; height: 60px; }
  #chat-panel .suggestion-grid { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #chat-panel .suggestion-grid { scroll-behavior: auto; }
}
