:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e8edf5;
  --text-muted: #9aa8bc;
  --accent: #36e2c8;
  --accent-2: #2bc4ad;
  --user-bubble: #1e3a5f;
  --border: #2a3548;
  --radius: 14px;
  --font: system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); }

#app { min-height: 100%; display: flex; flex-direction: column; }
.layout-widget { max-width: var(--widget-w, 420px); max-height: var(--widget-h, 560px); margin: auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.layout-standalone { max-width: 720px; margin: 0 auto; padding: 1rem; }

/* Persona */
.persona-playful .composer button { transition: transform .15s ease, box-shadow .15s ease; }
.persona-playful .composer button:hover { transform: translateY(-1px); }
.persona-playful .msg { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.persona-corporate .brand-header { letter-spacing: -.02em; }
.persona-corporate .composer button { text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }

.persona-minimal .brand-header { border-bottom-color: var(--border); }
.persona-minimal .msg { border-radius: calc(var(--radius) / 2); font-size: .9rem; }

/* Header anchors */
.header-centered .brand-header { flex-direction: column; text-align: center; align-items: center; }
.header-split .brand-header { justify-content: space-between; }
.header-split .brand-text { text-align: right; flex: 1; }
.header-minimal .brand-header { border-bottom: none; padding-bottom: .25rem; }
.header-minimal .brand-mark { width: 32px; height: 32px; }

/* CTA styles */
.cta-glow .composer button { box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent); }
.cta-outline .composer button { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.cta-solid .composer button { background: var(--accent); color: #0a0f14; }

/* Docking */
body.dock-bottom-right-preview { display: flex; align-items: flex-end; justify-content: flex-end; padding: 1rem; }
.dock-bottom-right.layout-widget { margin: 0 0 0 auto; }
.dock-sidebar.layout-widget { max-width: var(--widget-w, 360px); min-height: 100vh; max-height: none; margin: 0 0 0 auto; border-radius: 0; }
.dock-embedded.layout-standalone { max-width: 100%; }

.brand-header { display: flex; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex-shrink: 0; }
.brand-mark.circuit { background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(54,226,200,.25); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brand-text h1 { margin: 0; font-size: 1.25rem; }
.brand-text p { margin: .25rem 0 0; font-size: .85rem; }
.muted { color: var(--text-muted); }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 420px; padding: 1rem 0; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; padding: .5rem 0; }
.msg { max-width: 85%; padding: .75rem 1rem; border-radius: var(--radius); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.msg.user { align-self: flex-end; background: var(--user-bubble); }
.msg.thinking { opacity: .7; font-style: italic; }

.composer { display: flex; gap: .5rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius); padding: .65rem .85rem; font: inherit; min-height: 44px; max-height: 120px; }
.composer button { border: none; background: var(--accent); color: #0a0f14; font-weight: 600; border-radius: var(--radius); padding: 0 1.1rem; cursor: pointer; }
.composer button:disabled { opacity: .5; cursor: not-allowed; }

.footer { text-align: center; font-size: .75rem; padding: .75rem 0; }

@media (max-width: 480px) {
  .layout-standalone { padding: .5rem; }
  .msg { max-width: 92%; }
}
