*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cyan:    #00e5ff;
    --violet:  #a855f7;
    --accent:  #ff2d78;
    --bg:      #000a14;
    --surface: rgba(0,20,40,0.7);
    --border:  rgba(0,229,255,0.12);
    --text:    rgba(0,229,255,0.9);
    --dim:     rgba(0,229,255,0.4);
    --font-display: 'Orbitron', monospace;
    --font-mono:    'Share Tech Mono', monospace;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    overflow: hidden;
}

/* ── Background ── */
.bg-deep-space {
    position: fixed; inset: 0; z-index: 0;
    background: radial-gradient(ellipse at 50% 40%, #001a2e 0%, #000810 60%, #000308 100%);
}
.bg-grid {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background-image:
        linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
#bg-particles {
    position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.4;
}

/* ── Header ── */
.dc-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    background: rgba(0,8,20,0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.dc-brand { display: flex; align-items: center; gap: 12px; }
.dc-logo {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,229,255,0.3);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 18px; font-weight: 900;
    color: var(--cyan);
    text-shadow: 0 0 12px var(--cyan);
}
.dc-brand-name {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 900;
    letter-spacing: 0.3em;
    color: var(--cyan);
}
.dc-brand-sub {
    font-size: 9px; letter-spacing: 0.25em;
    color: var(--dim); text-transform: uppercase;
}
.dc-header-status { display: flex; align-items: center; gap: 8px; }
.dc-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #444; transition: background 0.4s;
}
.dc-status-dot.online  { background: #00ff88; box-shadow: 0 0 8px #00ff88; }
.dc-status-dot.thinking { background: var(--violet); box-shadow: 0 0 8px var(--violet); animation: pulse-dot 0.8s ease-in-out infinite; }
.dc-status-dot.error   { background: var(--accent); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.3} }
.dc-status-label { font-size: 11px; letter-spacing: 0.15em; color: var(--dim); text-transform: uppercase; }

/* ── Main layout ── */
.dc-main {
    position: fixed; inset: 56px 0 0 0;
    display: flex; z-index: 10;
}

/* ── ORB column ── */
.dc-orb-column {
    width: 380px; flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border-right: 1px solid var(--border);
    padding: 24px;
    position: relative;
}
.dc-orb-container {
    width: 320px; height: 320px;
    position: relative; border-radius: 50%;
    overflow: hidden;
}
.dc-orb-state {
    margin-top: 20px;
    font-family: var(--font-display);
    font-size: 11px; letter-spacing: 0.4em;
    color: var(--dim); text-transform: uppercase;
    transition: color 0.4s;
}
.dc-orb-state.speaking { color: var(--violet); }
.dc-orb-state.thinking { color: var(--cyan); }
.dc-orb-state.listening { color: var(--accent); }

/* ── Chat column ── */
.dc-chat-column {
    flex: 1; display: flex; flex-direction: column;
    min-width: 0; overflow: hidden;
}

/* ── Messages ── */
.dc-messages {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 24px 32px;
    display: flex; flex-direction: column; gap: 20px;
    scroll-behavior: smooth;
}
.dc-messages::-webkit-scrollbar { width: 4px; }
.dc-messages::-webkit-scrollbar-track { background: transparent; }
.dc-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.dc-welcome {
    color: var(--dim); font-size: 13px; line-height: 1.8;
    border-left: 2px solid var(--border); padding-left: 16px;
    margin-top: auto; margin-bottom: 8px;
}

.dc-msg {
    display: flex; flex-direction: column; gap: 4px;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.dc-msg-user .dc-bubble {
    align-self: flex-end; max-width: 72%;
    background: rgba(0,229,255,0.06);
    border: 1px solid rgba(0,229,255,0.18);
    border-radius: 12px 12px 2px 12px;
    padding: 10px 16px;
    color: rgba(0,229,255,0.85);
    font-size: 13px; line-height: 1.6;
}

.dc-msg-draven .dc-bubble {
    align-self: flex-start; max-width: 88%;
    background: rgba(168,85,247,0.04);
    border: 1px solid rgba(168,85,247,0.15);
    border-radius: 2px 12px 12px 12px;
    padding: 12px 18px;
    color: rgba(210,210,230,0.92);
    font-size: 14px; line-height: 1.75;
}
.dc-msg-draven .dc-speaker {
    font-family: var(--font-display);
    font-size: 9px; letter-spacing: 0.35em;
    color: var(--violet); text-transform: uppercase;
    margin-bottom: 4px;
}

/* streaming cursor */
.dc-cursor::after {
    content: '▋';
    color: var(--violet);
    animation: blink 0.7s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Input bar ── */
.dc-input-bar {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(0,8,20,0.7);
    backdrop-filter: blur(8px);
}

.dc-input {
    flex: 1;
    background: rgba(0,229,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 14px;
    resize: none; outline: none;
    max-height: 120px; overflow-y: auto;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.dc-input:focus { border-color: rgba(0,229,255,0.35); }
.dc-input::placeholder { color: var(--dim); }

.dc-mic-btn, .dc-send-btn {
    width: 40px; height: 40px;
    border-radius: 8px; border: 1px solid var(--border);
    background: rgba(0,229,255,0.04);
    color: var(--dim); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.dc-mic-btn svg, .dc-send-btn svg { width: 18px; height: 18px; }
.dc-send-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,229,255,0.08); }
.dc-mic-btn:hover  { border-color: var(--accent); color: var(--accent); background: rgba(255,45,120,0.08); }
.dc-mic-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(255,45,120,0.12);
                     box-shadow: 0 0 16px rgba(255,45,120,0.25); animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100%{box-shadow:0 0 16px rgba(255,45,120,0.25)} 50%{box-shadow:0 0 28px rgba(255,45,120,0.5)} }

.dc-voice-hint {
    min-height: 20px; padding: 0 24px 8px;
    font-size: 11px; color: var(--accent);
    letter-spacing: 0.1em; text-align: center;
}

/* ── Responsive: narrow screens collapse orb ── */
@media (max-width: 768px) {
    .dc-orb-column { display: none; }
    .dc-messages { padding: 16px; }
    .dc-input-bar { padding: 12px 16px; }
}
