.tai-wrapper {
  width: 100%;
  max-width: none;   /* remove cap */
  margin: 0;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.tai-header { text-align: left; margin-bottom: 12px; }

.tai-mode-toggle {
  margin-top: 10px;
  display: inline-flex;
  padding: 2px;
  border-radius: 9999px;
  background: #f3f4f6;
  gap: 2px;
}

.tai-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 13px;
  cursor: pointer;
  color: #4b5563;
}

.tai-mode-btn.is-active {
  background: #111827;
  color: #fff;
}

.tai-depth-control {
    margin: 8px 0 12px;
    font-size: 13px;
    color: #444;
}

.tai-depth-control label {
    display: block;
    margin-bottom: 4px;
}

.tai-depth-control select {
    width: 100%;
    max-width: 260px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    font-size: 13px;
}


.tai-title { font-size: 22px; font-weight: 700; }
.tai-subtitle { color: #6b7280; margin-top: 4px; }

.tai-chat { height: 360px; overflow-y: auto; border: 1px solid #eee; border-radius: 12px; padding: 14px; background: #fafafa; }
.tai-msg { display: flex; margin-bottom: 10px; }
.tai-msg.user { justify-content: flex-end; }
.tai-msg.assistant { justify-content: flex-start; }
.tai-bubble { max-width: 78%; padding: 10px 12px; border-radius: 14px; line-height: 1.4; white-space: pre-wrap; }
.tai-msg.user .tai-bubble { background: #e9f0ff; }
.tai-msg.assistant .tai-bubble { background: #f0f7f4; }
.tai-typing { font-style: italic; opacity: .7; }

.tai-input { display: flex; gap: 8px; margin-top: 12px; }
#tai-message { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 12px; }
#tai-send { padding: 12px 16px; border: 0; border-radius: 12px; cursor: pointer; background: #111827; color: #fff; font-weight: 600; }
.tai-footnote { text-align: center; margin-top: 8px; color: #9ca3af; font-size: 12px; }

.tai-email {
  margin-top: 16px;
  font-size: 13px;
  color: #4b5563;
}

.tai-email-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

#tai-email-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

#tai-email-send {
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

#tai-email-send:disabled {
  opacity: .6;
  cursor: default;
}

#tai-email-status {
  margin-top: 4px;
  font-size: 12px;
}

