/* ── Theme Variables (from Color.kt) ── */
:root {
  --bg: #0F0F23;
  --surface: #1A1A2E;
  --surface-elevated: #1F1F38;
  --surface-variant: #16213E;
  --primary: #7C4DFF;
  --primary-variant: #B388FF;
  --secondary: #00E5FF;
  --on-surface: #E8E8F0;
  --on-surface-dim: #9090A0;
  --on-surface-very-dim: #606078;
  --error: #FF5252;
  --success: #4CAF50;
  --user-bubble: #2D2B55;
  --ai-bubble: #1E1E3A;
  --ai-bubble-border: #2A2A4A;
  --narrator-bubble: #1A2A1A;
  --action-text: #80CBC4;
  --genre-noir: #FFAB40;
  --genre-scifi: #00E5FF;
  --genre-fantasy: #B388FF;
  --genre-western: #FF8A65;
  --genre-slice: #F48FB1;
  --genre-horror: #EF5350;
  --genre-default: #90A4AE;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--on-surface);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-variant); border-radius: 3px; }

/* ── Typography ── */
.text-title-lg { font-size: 24px; font-weight: 600; }
.text-title-md { font-size: 18px; font-weight: 500; }
.text-body-lg { font-size: 17px; }
.text-body-md { font-size: 15px; }
.text-body-sm { font-size: 13px; }
.text-label-sm { font-size: 12px; }
.text-label-md { font-size: 13px; }
.text-dim { color: var(--on-surface-dim); }
.text-very-dim { color: var(--on-surface-very-dim); }
.text-primary { color: var(--primary); }
.text-error { color: var(--error); }
.text-secondary { color: var(--secondary); }

/* ── Layout ── */
.page { display: flex; flex-direction: column; height: 100%; }
.page-center { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; }
.top-bar {
  display: flex; align-items: center; padding: 8px 12px;
  background: var(--surface); min-height: 52px; gap: 8px; flex-shrink: 0;
}
.top-bar-title { font-size: 18px; font-weight: 500; flex: 1; }
.scroll-area { flex: 1; overflow-y: auto; padding: 8px 0; }
.content-pad { padding: 16px 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius);
  cursor: pointer; font-weight: 500; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--surface-elevated); color: var(--on-surface); border: 1px solid var(--surface-variant); }
.btn-error { background: var(--error); color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon {
  background: none; border: none; color: var(--on-surface-dim); cursor: pointer;
  padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.05); }
.btn-icon svg { width: 22px; height: 22px; }

/* ── Inputs ── */
.input, .textarea {
  width: 100%; padding: 10px 14px; background: var(--surface-elevated);
  border: 1px solid var(--surface-variant); border-radius: var(--radius);
  color: var(--on-surface); outline: none; transition: border-color 0.15s;
}
.input:focus, .textarea:focus { border-color: rgba(124,77,255,0.5); }
.input::placeholder, .textarea::placeholder { color: var(--on-surface-dim); }
.textarea { resize: vertical; min-height: 80px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--on-surface-dim); font-weight: 500; }

/* ── Cards ── */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin-bottom: 8px;
}

/* ── Avatar ── */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  background: rgba(124,77,255,0.15); color: var(--primary-variant);
  font-size: 18px; font-weight: 500;
}
.avatar-sm { width: 36px; height: 36px; font-size: 16px; }

/* ── Chat Bubbles ── */
.msg-row { padding: 4px 14px; display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.narrator { justify-content: center; }
.msg-row.assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 300px; padding: 10px 14px; position: relative;
  word-wrap: break-word; font-size: 15px;
}
.msg-bubble.user {
  background: var(--user-bubble);
  border-radius: var(--radius-lg) var(--radius-lg) 6px var(--radius-lg);
}
.msg-bubble.assistant {
  background: var(--ai-bubble);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 6px;
}
.msg-bubble.narrator {
  background: var(--narrator-bubble);
  border-radius: var(--radius); font-style: italic;
}
.msg-bubble.error { background: rgba(255,82,82,0.15); }
.msg-char-name { font-size: 13px; font-weight: 500; color: var(--primary-variant); margin-bottom: 3px; }
.msg-time { font-size: 12px; color: var(--on-surface-very-dim); margin-top: 4px; }
.msg-text em, .msg-text .action { color: var(--action-text); font-style: italic; }
.msg-image { max-width: 100%; max-height: 200px; border-radius: 10px; margin-top: 6px; cursor: pointer; }
.msg-context-menu {
  position: absolute; background: var(--surface-elevated); border: 1px solid var(--surface-variant);
  border-radius: var(--radius-sm); padding: 4px 0; z-index: 100; min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.msg-context-item {
  padding: 10px 16px; cursor: pointer; font-size: 14px; color: var(--on-surface);
}
.msg-context-item:hover { background: rgba(255,255,255,0.05); }

/* ── Chat Input ── */
.chat-input-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface); flex-shrink: 0;
}
.chat-input {
  flex: 1; padding: 10px 16px; background: var(--surface-elevated);
  border: 1px solid var(--surface-variant); border-radius: 24px;
  color: var(--on-surface); outline: none; max-height: 100px;
  resize: none; line-height: 1.4;
}
.chat-input:focus { border-color: rgba(124,77,255,0.5); }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--primary); color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Typing Indicator ── */
.typing-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ai-bubble); border-radius: 16px;
  padding: 10px 14px; margin: 6px 14px; font-size: 13px; color: var(--on-surface-dim);
}
.typing-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--secondary);
  animation: pulse 0.6s infinite alternate;
}
@keyframes pulse { from { opacity: 0.3; } to { opacity: 1; } }

/* ── Regenerate Button ── */
.regen-bar {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  margin: 2px 14px; cursor: pointer; border-radius: var(--radius-sm);
  color: var(--on-surface-dim); font-size: 13px;
}
.regen-bar:hover { background: rgba(255,255,255,0.03); color: var(--primary); }
.regen-bar svg { width: 16px; height: 16px; }

/* ── Message Action Buttons ── */
.msg-actions {
  display: flex; gap: 6px; padding: 4px 0; flex-wrap: wrap;
}
.msg-action-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 16px; border: none;
  background: var(--surface-elevated); color: var(--on-surface-dim);
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.msg-action-btn:hover { background: var(--surface-variant); color: var(--on-surface); }
.msg-action-btn svg { width: 13px; height: 13px; }
.msg-action-delete { color: var(--error); }
.msg-action-delete:hover { background: rgba(255,82,82,0.15); }
.msg-row.user .msg-actions { justify-content: flex-end; }

/* ── Trait Panel ── */
.trait-panel {
  background: var(--surface-elevated); padding: 10px 20px;
  max-height: 300px; overflow-y: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--surface-variant);
}
.trait-panel.hidden { display: none; }
.trait-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.trait-row { margin-bottom: 8px; }
.trait-label { font-size: 13px; color: var(--on-surface-dim); margin-bottom: 2px; display: flex; justify-content: space-between; }
.trait-slider {
  width: 100%; -webkit-appearance: none; appearance: none; height: 4px;
  border-radius: 2px; background: var(--surface-variant); outline: none;
}
.trait-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
}
.trait-extremes { display: flex; justify-content: space-between; font-size: 11px; color: var(--on-surface-very-dim); }

/* ── Error Bar ── */
.error-bar {
  padding: 8px 20px; background: rgba(255,82,82,0.08);
  color: var(--error); font-size: 13px; flex-shrink: 0;
}
.error-bar.hidden { display: none; }

/* ── Toast ── */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; z-index: 9999; transition: opacity 0.3s;
  max-width: 90%;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.error { background: var(--error); color: white; }
.toast.success { background: var(--success); color: white; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--surface-elevated); border-radius: var(--radius);
  padding: 24px; max-width: 400px; width: 100%;
}
.modal-title { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.modal-body { color: var(--on-surface-dim); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Image Viewer ── */
.image-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; cursor: pointer;
}
.image-viewer img { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: 8px; }

/* ── Character List (Home) ── */
.char-row {
  display: flex; align-items: center; padding: 14px 20px; gap: 14px;
  cursor: pointer; transition: background 0.1s;
}
.char-row:hover { background: rgba(255,255,255,0.02); }
.char-row.expanded { background: rgba(31,31,56,0.4); }
.char-info { flex: 1; min-width: 0; }
.char-name { font-size: 17px; font-weight: 500; }
.char-tagline { font-size: 13px; color: var(--on-surface-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-divider { height: 1px; background: rgba(22,33,62,0.5); margin-left: 72px; margin-right: 20px; }

.conv-list { padding: 2px 20px 8px 72px; background: rgba(31,31,56,0.4); }
.conv-row {
  display: flex; align-items: center; padding: 10px 4px; gap: 12px;
  cursor: pointer; border-radius: var(--radius-sm);
}
.conv-row:hover { background: rgba(255,255,255,0.03); }
.conv-icon { color: var(--on-surface-very-dim); flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 13px; color: var(--on-surface-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-date { font-size: 12px; color: var(--on-surface-very-dim); flex-shrink: 0; }
.new-conv-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  cursor: pointer; color: var(--primary); font-size: 15px; border-radius: var(--radius-sm);
}
.new-conv-btn:hover { background: rgba(255,255,255,0.03); }

/* ── Character Create/Edit ── */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; cursor: pointer; border-bottom: 1px solid var(--surface-variant);
}
.section-header h3 { font-size: 15px; font-weight: 500; }
.section-content { padding: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.section-content.collapsed { display: none; }

/* ── Settings ── */
.settings-section { margin-bottom: 24px; }
.settings-section h3 { font-size: 13px; color: var(--on-surface-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(22,33,62,0.3);
}
.settings-label { font-size: 15px; }
.settings-value { font-size: 14px; color: var(--on-surface-dim); }

/* Toggle switch */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  width: 100%; height: 100%; border-radius: 12px;
  background: var(--surface-variant); transition: background 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: white; transition: transform 0.2s;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Premium Badge ── */
.premium-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #7C4DFF, #B388FF);
  padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: white;
}

/* ── Usage Bar ── */
.usage-bar { height: 6px; border-radius: 3px; background: var(--surface-variant); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width 0.3s; }

/* ── Friends ── */
.friend-code {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; background: var(--surface); border-radius: var(--radius);
  font-size: 24px; font-weight: 600; letter-spacing: 4px; color: var(--primary-variant);
  cursor: pointer;
}
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(22,33,62,0.3);
}
.online-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.online-dot.on { background: var(--success); }
.online-dot.off { background: var(--on-surface-very-dim); }

/* ── Social Chat ── */
.mode-chips { display: flex; gap: 8px; padding: 8px 14px; flex-shrink: 0; }
.mode-chip {
  padding: 6px 16px; border-radius: 20px; cursor: pointer;
  background: var(--surface-elevated); color: var(--on-surface-dim);
  border: 1px solid var(--surface-variant); font-size: 13px; font-weight: 500;
}
.mode-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Story ── */
.story-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  border-left: 4px solid var(--genre-default); margin-bottom: 12px; cursor: pointer;
}
.story-card:hover { background: var(--surface-elevated); }
.story-genre { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.story-title { font-size: 18px; font-weight: 500; margin-bottom: 8px; }

/* ── Group Setup ── */
.char-select-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 4px;
}
.char-select-row:hover { background: rgba(255,255,255,0.03); }
.char-select-row.selected { background: rgba(124,77,255,0.1); border: 1px solid var(--primary); }
.char-checkbox { width: 20px; height: 20px; border-radius: 4px; border: 2px solid var(--on-surface-dim); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.char-checkbox.checked { background: var(--primary); border-color: var(--primary); }

/* ── Section Labels ── */
.section-label { font-size: 13px; color: var(--on-surface-dim); font-weight: 500; }

/* ── Tabs ── */
.tab-btn {
  background: none; border: none; color: var(--on-surface-dim); padding: 12px 16px;
  cursor: pointer; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--on-surface); }

/* ── Chips ── */
.chip {
  padding: 8px 16px; border-radius: 20px; cursor: pointer;
  background: var(--surface-elevated); color: var(--on-surface-dim);
  border: 1px solid var(--surface-variant); font-size: 14px;
}
.chip:hover { border-color: var(--primary); }
.chip-selected { background: rgba(124,77,255,0.15); color: var(--primary); border-color: var(--primary); }

/* ── Invite Cards ── */
.invite-card {
  background: var(--surface-elevated); border-radius: var(--radius); padding: 16px;
  margin-bottom: 8px;
}

/* ── Friend Code Card ── */
.friend-code-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--surface-elevated); border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s;
}
.friend-code-card:hover { background: var(--surface-variant); }
.friend-code-card svg { width: 20px; height: 20px; }
.friend-code-text { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: 3px; }
.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 16px; font-weight: 500;
}

/* ── Social Chat Bubbles ── */
.msg { display: flex; padding: 4px 14px; }
.msg-user { justify-content: flex-end; }
.msg-char { justify-content: flex-start; }
.bubble { max-width: 300px; padding: 10px 14px; word-wrap: break-word; font-size: 15px; }
.bubble-user { background: var(--user-bubble); border-radius: 20px 20px 6px 20px; }
.bubble-char { background: var(--ai-bubble); border-radius: 20px 20px 20px 6px; }
.msg-speaker { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.msg-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.input-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface); flex-shrink: 0;
}
.msg-input {
  flex: 1; padding: 10px 16px; background: var(--surface-elevated);
  border: 1px solid var(--surface-variant); border-radius: 24px;
  color: var(--on-surface); outline: none; max-height: 120px;
  resize: none; line-height: 1.4;
}
.msg-input:focus { border-color: rgba(124,77,255,0.5); }

/* ── Mode Chip Active State ── */
.mode-chip.mode-active { background: rgba(124,77,255,0.15); color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ── Story Page ── */
.story-hero {
  padding: 20px; border-radius: var(--radius); margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(144,164,174,0.12) 0%, transparent 100%);
}
.story-hero.genre-noir { background: linear-gradient(180deg, rgba(255,171,64,0.12) 0%, transparent 100%); }
.story-hero.genre-scifi { background: linear-gradient(180deg, rgba(0,229,255,0.12) 0%, transparent 100%); }
.story-hero.genre-horror { background: linear-gradient(180deg, rgba(239,83,80,0.12) 0%, transparent 100%); }
.story-hero.genre-western { background: linear-gradient(180deg, rgba(255,138,101,0.12) 0%, transparent 100%); }
.story-hero.genre-slice { background: linear-gradient(180deg, rgba(244,143,177,0.12) 0%, transparent 100%); }
.story-genre { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--genre-default); }
.genre-noir .story-genre { color: var(--genre-noir); }
.genre-scifi .story-genre { color: var(--genre-scifi); }
.genre-horror .story-genre { color: var(--genre-horror); }
.genre-western .story-genre { color: var(--genre-western); }
.genre-slice .story-genre { color: var(--genre-slice); }
.story-title { font-size: 22px; font-weight: 600; margin-top: 6px; }
.story-hook {
  display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 12px;
  background: rgba(144,164,174,0.1); color: var(--genre-default);
}
.genre-noir .story-hook, .story-hook.genre-noir { background: rgba(255,171,64,0.1); color: var(--genre-noir); }
.genre-scifi .story-hook, .story-hook.genre-scifi { background: rgba(0,229,255,0.1); color: var(--genre-scifi); }
.genre-horror .story-hook, .story-hook.genre-horror { background: rgba(239,83,80,0.1); color: var(--genre-horror); }
.genre-western .story-hook, .story-hook.genre-western { background: rgba(255,138,101,0.1); color: var(--genre-western); }
.genre-slice .story-hook, .story-hook.genre-slice { background: rgba(244,143,177,0.1); color: var(--genre-slice); }

/* ── Companion Card (Story) ── */
.companion-card {
  position: relative; width: 120px; flex-shrink: 0; padding: 12px;
  border-radius: var(--radius); border: 2px solid var(--surface-variant);
  background: var(--surface-elevated); cursor: pointer; text-align: center;
  transition: border-color 0.15s;
}
.companion-card:hover { border-color: var(--on-surface-dim); }
.companion-selected { border-color: var(--primary); background: rgba(124,77,255,0.1); }

/* ── Group Setup ── */
.group-char-row {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--surface-variant);
  background: var(--surface-elevated); cursor: pointer; transition: all 0.15s;
}
.group-char-row:hover { background: rgba(255,255,255,0.03); }
.group-char-selected { border-color: var(--primary); background: rgba(124,77,255,0.08); }
.group-check {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-variant); display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: white;
}
.group-check-on { background: var(--primary); }

/* ── Character Editor Trait Sliders ── */
.trait-slider-row { margin-bottom: 12px; }
.trait-labels { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 4px; }
.trait-label-low { color: var(--on-surface-very-dim); }
.trait-label-name { font-size: 13px; color: var(--on-surface-dim); font-weight: 500; }
.trait-label-high { color: var(--on-surface-very-dim); }
.trait-value { color: var(--primary); margin-left: 4px; }

/* ── Utility ── */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

/* ── Responsive ── */
@media (min-width: 600px) {
  .msg-bubble { max-width: 400px; }
}
@media (min-width: 900px) {
  #app { max-width: 100%; }
  .msg-bubble { max-width: 600px; }
}
