/* ==========================================================================
   common.css — shared design tokens + base layout
   Loaded on every page BEFORE the page-specific stylesheet, so page
   stylesheets only need to contain overrides and page-specific rules.
   ========================================================================== */

:root {
    /* Backgrounds */
    --bg-body: #0b1220;
    --bg-header: #111a2e;
    --bg-input: #0f172a;

    /* Borders */
    --border: #1f2a44;
    --border-input: #334155;

    /* Text */
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent (buttons, links, focus) */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-strong: #1e40af;
    --accent-soft: #93c5fd;

    /* Status colors */
    --success: #4ade80;
    --success-bg: #052e16;
    --success-border: #16a34a;

    --error: #f87171;
    --error-bg: #2d0e0e;
    --error-border: #7f1d1d;

    --warn: #fde68a;
    --warn-bg: #2d2500;
    --warn-border: #854d0e;

    /* Assistant bubble (light) palette, used where markdown renders on a
       light background */
    --bubble-bg: #f8fafc;
    --bubble-text: #1a1a2e;
    --bubble-heading: #1e3a8a;
    --bubble-code-bg: #e0e7ff;
    --bubble-pre-bg: #1e293b;
    --bubble-pre-text: #e2e8f0;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-pill: 20px;

    /* Fonts */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
}

/* ── Header ── */
header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
}

header h1 {
    margin: 0;
    font-size: 1.4rem;
}

header p {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.conn-status {
    font-size: .78rem;
    white-space: nowrap;
    color: var(--error);
}

.conn-status.connected {
    color: var(--success);
}

/* ── Input bar (footer with textarea + submit button) ── */
.input-bar {
    display: flex;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-header);
}

textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 12px;
    font-size: 0.95rem;
    min-height: 56px;
    outline: none;
    font-family: inherit;
}

textarea:focus {
    border-color: var(--accent);
}

button {
    border: none;
    background: var(--accent);
    color: white;
    padding: 0 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.95rem;
}

button:hover {
    background: var(--accent-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
