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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.hidden { display: none !important; }
.error { color: #ff6b6b; margin-top: 8px; font-size: 14px; }

/* Auth */
#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.auth-box {
    background: #16213e;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
}

.auth-box h1 { text-align: center; margin-bottom: 24px; font-size: 24px; }

.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0f3460;
    color: #fff;
    font-size: 16px;
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

#login-btn { background: #e94560; color: white; }
#register-btn { background: #533483; color: white; }

/* Chat layout */
.chat-layout {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 260px;
    background: #16213e;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 { font-size: 16px; }
.sidebar-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #533483;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

#conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item:hover { background: #0f3460; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #333;
}

#logout-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 8px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
}

/* Chat main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: #533483;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: #0f3460;
    border-bottom-left-radius: 4px;
}

/* Controls */
.chat-controls {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #333;
}

#talk-btn {
    width: 200px;
    height: 56px;
    border: none;
    border-radius: 28px;
    background: #e94560;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#talk-btn:active { background: #c73e54; transform: scale(0.96); }
#talk-btn:disabled { background: #666; cursor: not-allowed; }

#status {
    margin-top: 8px;
    font-size: 14px;
    color: #888;
    min-height: 20px;
}

/* Mobile */
@media (max-width: 640px) {
    #sidebar { display: none; }
    .message { max-width: 85%; }
}
