/* Chat input layout. Message bubbles and thread live in dialog.css. */

@media (max-width: 768px) {
  .chat-page .chat-wrap {
    min-height: calc(100dvh - 86px);
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .chat-page .chat-thread {
    max-height: calc(100dvh - 222px);
    overflow-y: auto;
  }

  .chat-page .chat-form {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 6000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.13);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .chat-page .chat-form textarea {
    min-width: 0;
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    padding: 10px 13px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 999px;
    outline: none;
    font-size: 16px;
    line-height: 22px;
  }

  .chat-page .chat-form textarea:focus {
    border-color: rgba(31, 140, 104, 0.45);
    box-shadow: 0 0 0 3px rgba(31, 140, 104, 0.12);
  }

  .chat-page .chat-form button {
    height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: #1f8c68;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(31, 140, 104, 0.22);
  }

  .chat-page .chat-form button:active {
    transform: translateY(1px);
  }

  .chat-page .aiw-launcher {
    right: 12px;
    bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 769px) {
  .chat-page .chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    align-items: start;
    gap: 10px;
    margin-top: 10px;
  }

  .chat-page .chat-form textarea {
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 180px;
    box-sizing: border-box;
    resize: vertical;
    overflow-y: auto;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 20px;
  }

  .chat-page .chat-form button {
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
  }
}
