:root {
    --bg: #0f172a;        /* slate-900 */
    --panel: #111827;     /* gray-900 */
    --panel-2: #0b1220;
    --text: #e5e7eb;      /* gray-200 */
    --muted: #94a3b8;     /* slate-400 */
    --accent: #22c55e;    /* green-500 */
    --accent-2: #60a5fa;  /* blue-400 */
    --danger: #ef4444;    /* red-500 */
    --bubble-user: #1f2937; /* gray-800 */
    --bubble-bot: #0b3b22;  /* dark green tint */
    --radius: 14px;
}
* { box-sizing: border-box; }
html, body {
    height: 100%;
    margin: 0;
    background: radial-gradient(1200px 800px at 10% 10%, #0b1220, #0f172a 60%);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
.app {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    gap: 12px;
}
header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.03);
}
header .title {
    display: flex; align-items: center; gap: 10px; font-weight: 600;
}
header .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
#transcript {
    overflow-y: auto;
    padding: 16px;
    background: rgba(17,24,39,0.5);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    scroll-behavior: smooth;
}
.msg {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    margin: 12px 0;
    align-items: flex-start;
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
}
.avatar.user { background: linear-gradient(135deg, #22c55e, #16a34a); }
.bubble {
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.45;
    border: 1px solid #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.user .bubble {
    background: var(--bubble-user);
}
.bot .bubble {
    background: var(--bubble-bot);
    border-color: #1d4930;
}
.meta {
    font-size: 12px; color: var(--muted); margin-top: 4px;
}
.typing {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    width: 1.2em;
    animation: pulse 1s infinite steps(1);
}
@keyframes pulse {
    0% { content: "•"; }
    33% { content: "••"; }
    66% { content: "•••"; }
}
.composer {
    display: grid; grid-template-columns: 1fr auto; gap: 10px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
textarea {
    resize: none; height: 56px;
    padding: 12px 14px; border-radius: 10px;
    border: 1px solid #243244; outline: none;
    background: #0a0f1a; color: var(--text);
    font: inherit;
}
textarea::placeholder { color: #64748b; }
.actions { display: flex; gap: 8px; align-items: center; }
button {
    height: 40px; padding: 0 14px; border-radius: 10px;
    border: 1px solid #1f2937; background: #0a0f1a; color: var(--text);
    font-weight: 600; cursor: pointer;
}
button.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #1b4d30; color: #041308;
    box-shadow: 0 8px 20px rgba(34,197,94,.25);
}
button[disabled] { opacity: 0.6; cursor: not-allowed; }
.hint {
    text-align: center; color: var(--muted); font-size: 12px;
}
.error {
    color: var(--danger); font-size: 13px; margin-left: 6px;
}
a.mini {
    font-size: 12px; color: var(--accent-2); text-decoration: none;
}
a.mini:hover { text-decoration: underline; }

.bubble p {
  margin: 0.2em 0;
}

.bubble li p {
  margin: 0;
}
