.ai-consent-panel,
.ai-draft-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-solid, #0b1222);
  color: var(--text);
}

.ai-panel-title {
  margin: 0;
  font-size: 16px;
}

.ai-consent-purpose,
.ai-consent-count,
.ai-consent-provider,
.ai-consent-notice,
.ai-consent-no-send,
.ai-panel-status {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.ai-consent-preview {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.ai-draft-output {
  min-height: 96px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: 16px/1.45 inherit;
  padding: 10px;
}

.ai-draft-variants { display: grid; gap: 12px; }
.ai-draft-variant { display: grid; gap: 8px; }
.ai-draft-variant button { min-height: 44px; justify-self: start; }
.ai-draft-label { display: grid; gap: 6px; }

.ai-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-panel-actions button {
  min-height: 44px;
}

.ai-panel-status-error {
  color: var(--danger);
}

@media (max-width: 430px) {
  .ai-panel-actions {
    flex-direction: column;
  }

  .ai-panel-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-consent-panel,
  .ai-draft-panel,
  .ai-panel-actions button {
    transition: none;
  }
}

/* The open draft preview owns a full composer row. Keep the editor and send
   controls out of its hit area; a long preview scrolls inside its own host. */
body.chats-real-v1 .composer > #draftImproveHost:not([hidden]) {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  max-height: min(400px, 50dvh);
  overflow-y: auto;
}
body.chats-real-v1 .composer:has(> #draftImproveHost:not([hidden])) > :is(.composer-input-wrap, .composer-tool, .send-button, #quietSendToggleWrap) {
  grid-row: 2;
}
