* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #1f2937; background: #f8fafc; }
body { min-height: 100vh; }
.app { max-width: 780px; margin: 0 auto; padding: 0 16px 32px; }
.header { display: flex; justify-content: space-between; align-items: center; padding: 28px 0 20px; border-bottom: 1px solid #e5e7eb; margin-bottom: 24px; }
.brand-mark { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #111827; }
.brand-sub { font-size: 14px; color: #6b7280; margin-top: 2px; }
.badge { display: inline-block; background: #dbeafe; color: #1e40af; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; }
.main { display: flex; flex-direction: column; gap: 18px; }
.control-panel { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; }
.control-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.control-label { font-size: 13px; color: #6b7280; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.control-label select { font-size: 14px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: white; color: #1f2937; cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preset-label { font-size: 13px; color: #6b7280; margin-right: 4px; }
.preset-btn { font-size: 13px; padding: 6px 12px; border: 1px solid #d1d5db; background: white; border-radius: 8px; cursor: pointer; color: #374151; transition: all 0.15s; }
.preset-btn:hover { border-color: #2563eb; background: #eff6ff; color: #1e40af; }
.conversation { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; min-height: 240px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 60vh; }
.empty-state { color: #9ca3af; text-align: center; padding: 40px 16px; font-size: 14px; }
.empty-state-sub { color: #d1d5db; font-size: 13px; margin-top: 8px; }
.message { display: flex; flex-direction: column; max-width: 85%; }
.message.lead { align-self: flex-start; }
.message.aidan { align-self: flex-end; }
.message-meta { font-size: 11px; color: #9ca3af; margin-bottom: 4px; padding: 0 4px; }
.message.aidan .message-meta { text-align: right; }
.message-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.message.lead .message-bubble { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 4px; }
.message.aidan .message-bubble { background: #dbeafe; color: #1e3a8a; border-bottom-right-radius: 4px; }
.composer { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; }
.composer-label { font-size: 13px; color: #374151; font-weight: 600; display: block; margin-bottom: 8px; }
.composer-channel { font-weight: 400; color: #6b7280; }
.composer textarea, .draft-panel textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; min-height: 60px; }
.composer textarea:focus, .draft-panel textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.composer-buttons { margin-top: 10px; display: flex; gap: 8px; }
.draft-panel { background: #f0f9ff; border: 1px solid #93c5fd; border-radius: 12px; padding: 16px; }
.draft-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.draft-label { font-size: 13px; color: #1e40af; font-weight: 600; }
.draft-meta { font-size: 11px; color: #64748b; }
.draft-buttons { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.primary-btn { padding: 8px 16px; background: #2563eb; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.primary-btn:hover:not(:disabled) { background: #1d4ed8; }
.primary-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.secondary-btn { padding: 8px 16px; background: white; color: #2563eb; border: 1px solid #93c5fd; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.secondary-btn:hover:not(:disabled) { background: #eff6ff; }
.ghost-btn { padding: 8px 14px; background: transparent; color: #6b7280; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ghost-btn:hover:not(:disabled) { background: #f9fafb; color: #374151; }
.footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e7eb; font-size: 12px; color: #9ca3af; text-align: center; }
.error-message { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid #d1d5db; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
