:root {
  --bg: #0a0a0f;
  --bg-surface: #12121a;
  --bg-surface-2: #1a1a26;
  --bg-input: #16161f;
  --border: #2a2a3a;
  --border-focus: #5a4fcf;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --text-muted: #55556a;
  --accent: #7c6cf0;
  --accent-glow: rgba(124,108,240,0.15);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.15);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.15);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251,191,36,0.15);
  --blue: #60a5fa;
  --blue-dim: rgba(96,165,250,0.15);
  --orange: #fb923c;
  --user-bubble: #2d2b55;
  --claude-bubble: #1a1a26;
  --thinking-text: #a78bfa;
  --tool-bg: #1e1e2e;
  --tool-border: #3a3a50;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --header-h: 56px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ── HEADER ── */
#header {
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: var(--safe-top);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
#header .logo { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
#header .logo .logo-img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
#conn-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}
#conn-dot.connected { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,0.5); }
#conn-dot.connecting { background: var(--yellow); animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#turn-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; display: none;
}
#turn-badge.active { display: inline-block; background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
#turn-badge.waiting { display: inline-block; background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }

/* ── SCREENS ── */
.screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.screen.active { display: flex; }

/* ── PAIRING SCREEN ── */
#pairing-screen { justify-content: center; align-items: center; padding: 24px; gap: 20px; }
#pairing-screen .pairing-icon { font-size: 64px; margin-bottom: 8px; }
#pairing-screen h1 { font-size: 24px; font-weight: 700; text-align: center; }
#pairing-screen p.subtitle { color: var(--text-dim); text-align: center; font-size: 14px; max-width: 320px; line-height: 1.6; }
.input-group { width: 100%; max-width: 340px; }
.input-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 8px; }
.input-group input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 16px; font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.input-group input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group input::placeholder { color: var(--text-muted); }
.input-hint { font-size: 11px; opacity: 0.65; margin: 6px 0 0; line-height: 1.3; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  -webkit-appearance: none; touch-action: manipulation; user-select: none;
  width: 100%; max-width: 340px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 12px rgba(124,108,240,0.3); }
.btn-primary:hover { background: #6a5ce0; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--bg-surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-warning { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
#pairing-status {
  font-size: 13px; text-align: center; min-height: 20px;
  padding: 8px 16px; border-radius: var(--radius-xs); max-width: 340px; width: 100%;
}
#pairing-status.ok { color: var(--green); background: var(--green-dim); }
#pairing-status.err { color: var(--red); background: var(--red-dim); }
#pairing-status.info { color: var(--blue); background: var(--blue-dim); }

/* ── QR SCANNER OVERLAY ── */
#qr-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px;
}
#qr-overlay.active { display: flex; }
#qr-overlay video { width: 100%; max-width: 320px; border-radius: var(--radius); border: 2px solid var(--border); }
#qr-overlay canvas { display: none; }
#qr-overlay .scan-hint { color: var(--text-dim); font-size: 13px; text-align: center; }
#qr-overlay .close-scan {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text); font-size: 28px;
  cursor: pointer; padding: 8px; width: auto; max-width: none;
}

/* ── CHAT SCREEN ── */
#chat-container {
  flex: 1; overflow-y: auto; padding: 12px 12px 4px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
}
.msg { display: flex; gap: 8px; max-width: 92%; animation: msg-in 0.25s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.claude { align-self: stretch; max-width: 100%; }
.msg.system { align-self: center; max-width: 100%; }
.avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-top: 2px; }
.msg.user .avatar { background: var(--user-bubble); }
.msg.claude .avatar { background: var(--bg-surface-2); }
.msg.system .avatar { display: none; }
.bubble { padding: 10px 14px; border-radius: var(--radius); font-size: 15px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.msg.user .bubble { background: var(--user-bubble); color: #d4d0f0; border-bottom-right-radius: 4px; }
.msg.claude .bubble { background: var(--claude-bubble); border: 1px solid var(--border); border-bottom-left-radius: 4px; flex: 1; min-width: 0; }
.msg.system .bubble { background: transparent; color: var(--text-muted); font-size: 12px; text-align: center; padding: 4px 8px; font-style: italic; }
.bubble.thinking { color: var(--thinking-text); font-style: italic; border-color: rgba(167,139,250,0.2); }
.thinking-group { align-self: stretch; max-width: 100%; }
.thinking-group-header {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.2); border-radius: var(--radius-xs);
  font-size: 13px; color: var(--thinking-text); cursor: pointer; user-select: none; -webkit-user-select: none;
}
.thinking-group-header:active { background: rgba(167,139,250,0.15); }
.thinking-label { flex: 1; }
.thinking-toggle { font-size: 10px; color: var(--text-muted); }
.thinking-group-body { display: none; margin-top: 4px; }
.thinking-group-body.open { display: block; }
.thinking-bubble {
  padding: 10px 14px; border-radius: var(--radius-xs);
  background: rgba(167,139,250,0.06); border: 1px solid rgba(167,139,250,0.15);
  font-size: 13px; color: var(--thinking-text); font-style: italic;
  white-space: pre-wrap; word-break: break-word; line-height: 1.5;
  max-height: 300px; overflow-y: auto;
}
.tool-group { align-self: stretch; max-width: 100%; }
.tool-group-header {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--tool-bg); border: 1px solid var(--tool-border); border-radius: var(--radius-xs);
  font-size: 13px; font-family: 'SF Mono', 'Fira Code', monospace; color: var(--orange);
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.tool-group-header:active { background: var(--bg-surface-2); }
.tool-label { color: var(--orange); }
.tool-toggle { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.tool-group-body { display: none; flex-direction: column; gap: 4px; margin-top: 4px; }
.tool-group-body.open { display: flex; }
.tool-item { padding: 6px 12px; background: var(--tool-bg); border: 1px solid var(--tool-border); border-radius: var(--radius-xs); font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.tool-item .tool-name { color: var(--yellow); font-weight: 600; font-size: 12px; }
.tool-item .tool-params { color: var(--text-dim); font-size: 11px; margin-top: 3px; white-space: pre-wrap; word-break: break-all; }
.cursor { display: inline-block; width: 2px; height: 16px; background: var(--accent); animation: blink 0.8s step-end infinite; vertical-align: text-bottom; margin-left: 1px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── ACTION BAR ── */
#action-bar { display: none; padding: 10px 12px; background: var(--yellow-dim); border-top: 1px solid rgba(251,191,36,0.2); gap: 8px; }
#action-bar.active { display: flex; }
#action-bar .action-info { flex: 1; font-size: 13px; color: var(--yellow); display: flex; align-items: center; gap: 6px; }
#action-bar .action-btns { display: flex; gap: 8px; }
#action-bar button { padding: 8px 16px; border: none; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; cursor: pointer; -webkit-appearance: none; width: auto; max-width: none; }
#action-bar .btn-deny { background: var(--red-dim); color: var(--red); }

/* ── INPUT AREA ── */
#input-area { padding: 8px 12px; padding-bottom: calc(8px + var(--safe-bottom)); background: var(--bg-surface); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }
#input-area textarea {
  flex: 1; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 24px; color: var(--text); font-size: 16px; outline: none;
  transition: border-color 0.2s; -webkit-appearance: none; min-height: 48px; max-height: 160px;
  line-height: 1.4; resize: none; overflow-y: hidden; font-family: inherit;
}
#input-area textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
#input-area textarea::placeholder { color: var(--text-muted); }
#send-btn {
  width: 48px; height: 48px; min-width: 48px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  -webkit-appearance: none; padding: 0; max-width: 48px;
}
#send-btn:active { transform: scale(0.92); }

/* ── TOOLBAR ── */
#toolbar { display: flex; padding: 6px 12px; gap: 6px; background: var(--bg-surface); border-top: 1px solid var(--border); }
#toolbar button {
  padding: 6px 12px; background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-dim); font-size: 12px; font-weight: 600;
  cursor: pointer; -webkit-appearance: none; width: auto; max-width: none;
  display: flex; align-items: center; gap: 4px;
}
#toolbar button:active { background: var(--border); }

/* ── MODALS ── */
#settings-modal, #new-session-modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 50; align-items: center; justify-content: center; padding: 24px;
}
#settings-modal.active, #new-session-modal.active { display: flex; }
#new-session-modal { z-index: 60; }
.modal-content {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px;
}
.modal-content h2 { font-size: 18px; font-weight: 700; }
.modal-content .modal-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.modal-content .modal-row .label { color: var(--text-dim); }
.modal-content .modal-row .value { font-family: 'SF Mono', monospace; font-size: 13px; color: var(--text); word-break: break-all; text-align: right; max-width: 60%; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }
#new-session-modal .modal-content { gap: 14px; }
#new-session-modal select {
  width: 100%; padding: 12px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 15px; outline: none;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238888a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
#new-session-modal select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
#new-session-modal select option { background: var(--bg-surface); }
#new-session-modal .field-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 6px; display: block; }
#new-session-modal .field { display: flex; flex-direction: column; }
#new-session-modal #ns-model {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 15px; outline: none; -webkit-appearance: none;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
#new-session-modal #ns-model:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.ns-options-row { flex-direction: row !important; gap: 8px; }
.ns-options-row .field { flex: 1; }
.ns-options-row select {
  width: 100%; padding: 8px 10px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text); font-size: 12px; outline: none; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238888a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; cursor: pointer;
}
.ns-options-row select:focus { border-color: var(--border-focus); }
.ns-options-row select option { background: var(--bg-surface); }
.ns-options-row .field-label { font-size: 10px; }

/* Settings modal — botones en columna para que no se salgan en pantallas pequeñas */
#settings-modal .modal-actions { flex-direction: column; gap: 8px; }
#settings-modal .modal-actions .btn { max-width: 100%; }

/* ── SESSIONS DRAWER ── */
#sessions-drawer {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 50; align-items: flex-end; justify-content: center;
}
#sessions-drawer.active { display: flex; }
.drawer-sheet {
  background: var(--bg-surface); border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  width: 100%; max-width: 600px; display: flex; flex-direction: column; gap: 12px; max-height: 70dvh;
}
.drawer-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 4px; }
.drawer-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.session-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none; width: 100%; text-align: left;
}
.session-item:active { background: var(--border); }
.session-item.active-tab { border-color: var(--border-focus); background: var(--accent-glow); }
.session-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.session-dot.processing { background: var(--yellow); animation: pulse-dot 1s ease-in-out infinite; }
.session-dot.active-tab { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.session-info { flex: 1; min-width: 0; }
.session-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-project { font-size: 11px; color: var(--text-muted); font-family: 'SF Mono', monospace; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-loading { text-align: center; color: var(--text-muted); font-size: 13px; padding: 16px; }

/* ── LIVE PANEL ── */
#live-panel {
  display: none; flex-direction: column; gap: 4px;
  padding: 6px 10px; background: var(--bg-surface);
  border-top: 1px solid var(--border); max-height: 160px; overflow-y: auto;
}
#live-panel.active { display: flex; }
.lp-section { display: flex; flex-direction: column; gap: 3px; }
.lp-header {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: var(--radius-xs); font-size: 12px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
#lp-thinking .lp-header {
  background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.2); color: var(--thinking-text);
}
#lp-thinking .lp-header:active { background: rgba(167,139,250,0.15); }
.lp-tools-header {
  background: var(--tool-bg); border: 1px solid var(--tool-border);
  font-family: 'SF Mono', 'Fira Code', monospace; color: var(--orange);
}
.lp-tools-header:active { background: var(--bg-surface-2); }
.lp-label { flex: 1; }
.lp-tool-label { color: var(--orange); flex: 1; }
.lp-toggle { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.lp-body { display: none; }
.lp-body.open { display: block; }
.lp-thinking-text {
  padding: 6px 10px; border-radius: var(--radius-xs);
  background: rgba(167,139,250,0.06); border: 1px solid rgba(167,139,250,0.12);
  font-size: 12px; color: var(--thinking-text); font-style: italic;
  white-space: pre-wrap; word-break: break-word; line-height: 1.45; max-height: 80px; overflow-y: auto;
}
.lp-tools-body { display: flex; flex-direction: column; gap: 3px; }
.lp-tool-item { padding: 5px 10px; background: var(--tool-bg); border: 1px solid var(--tool-border); border-radius: var(--radius-xs); font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; }
.lp-thinking-archive { flex-direction: column; gap: 4px; }
.lp-body.open.lp-thinking-archive { display: flex; }
.lp-archive-item { padding: 5px 8px; border-radius: var(--radius-xs); background: rgba(167,139,250,0.06); border: 1px solid rgba(167,139,250,0.12); font-size: 11px; color: var(--thinking-text); font-style: italic; white-space: pre-wrap; word-break: break-word; max-height: 60px; overflow-y: auto; }
.lp-tool-item-hdr { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; -webkit-user-select: none; }
.lp-tool-item-hdr:active { opacity: 0.7; }
.lp-tool-item-toggle { font-size: 9px; color: var(--text-muted); padding-left: 6px; flex-shrink: 0; }
.lp-tool-item-body { display: none; margin-top: 4px; color: var(--text-dim); font-size: 10px; white-space: pre-wrap; word-break: break-all; }
.lp-tool-item-body.open { display: block; }
.lp-tool-name { color: var(--yellow); font-weight: 600; }
.lp-tool-params { color: var(--text-dim); font-size: 10px; margin-top: 2px; white-space: pre-wrap; word-break: break-all; }

/* ── MARKDOWN ── */
.bubble.md-rendered { white-space: normal; }
.bubble.md-rendered > *:first-child { margin-top: 0; }
.bubble.md-rendered > *:last-child { margin-bottom: 0; }
.bubble.md-rendered p { margin: 0 0 0.55em; }
.bubble.md-rendered h1, .bubble.md-rendered h2, .bubble.md-rendered h3,
.bubble.md-rendered h4, .bubble.md-rendered h5, .bubble.md-rendered h6 {
  font-weight: 700; line-height: 1.3; margin: 0.8em 0 0.3em;
}
.bubble.md-rendered h1 { font-size: 1.15em; }
.bubble.md-rendered h2 { font-size: 1.05em; }
.bubble.md-rendered h3, .bubble.md-rendered h4,
.bubble.md-rendered h5, .bubble.md-rendered h6 { font-size: 1em; }
.bubble.md-rendered ul, .bubble.md-rendered ol { padding-left: 1.4em; margin: 0.3em 0; }
.bubble.md-rendered li { margin: 0.1em 0; }
.bubble.md-rendered li > p { margin: 0; }
.bubble.md-rendered code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.84em; background: rgba(255,255,255,0.07);
  padding: 0.15em 0.45em; border-radius: 4px; color: var(--blue);
}
.bubble.md-rendered pre {
  background: #0d0d14; border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 11px 13px;
  overflow-x: auto; margin: 0.55em 0; white-space: pre;
  -webkit-overflow-scrolling: touch; max-width: 100%;
}
.bubble.md-rendered pre code {
  background: none; padding: 0; font-size: 0.82em;
  color: var(--text-dim); border-radius: 0;
}
.bubble.md-rendered blockquote {
  border-left: 3px solid var(--border-focus); padding-left: 12px;
  margin: 0.5em 0; color: var(--text-dim); font-style: italic;
}
.bubble.md-rendered strong { font-weight: 700; }
.bubble.md-rendered em { font-style: italic; color: var(--text-dim); }
.bubble.md-rendered a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.bubble.md-rendered hr { border: none; border-top: 1px solid var(--border); margin: 0.7em 0; }
.bubble.md-rendered table { border-collapse: collapse; width: 100%; font-size: 0.88em; margin: 0.55em 0; display: block; overflow-x: auto; }
.bubble.md-rendered th, .bubble.md-rendered td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; white-space: nowrap; }
.bubble.md-rendered th { background: var(--bg-surface-2); font-weight: 600; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── RESPONSIVE ── */
@media (min-width: 601px) { #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); } }
@media (max-width: 380px) { .bubble { font-size: 14px; } #header .logo { font-size: 16px; } }
