:root {
    --ai-bg: #050507;
    --ai-surface: rgba(255, 255, 255, 0.05);
    --ai-accent: #667eea;
    --ai-accent-glow: rgba(102, 126, 234, 0.4);
    --ai-text: #ffffff;
    --ai-text-dim: rgba(255, 255, 255, 0.6);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bot: env(safe-area-inset-bottom, 0px);
}

.sora-body * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.sora-body {
    background: var(--ai-bg);
    color: var(--ai-text);
    font-family: 'Inter', -apple-system, sans-serif;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image: radial-gradient(circle at 50% -20%, #1a1c3a, transparent);
}

.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star { position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 50%; opacity: 0.3; }

/* Navbar */
.ai-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(15px + var(--safe-top)) 20px 15px;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.back-btn { text-decoration: none; color: white; font-size: 24px; padding: 5px; opacity: 0.8; }
.ai-branding { display: flex; align-items: center; gap: 12px; }
.ai-branding img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 15px var(--ai-accent-glow); }
.ai-title h1 { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }

.status-pill {
    font-size: 10px;
    font-weight: 700;
    color: #44b88a;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pulse { width: 6px; height: 6px; background: #44b88a; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.5); } 100% { opacity: 1; transform: scale(1); } }

/* Chat Area */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.welcome-screen {
    text-align: center;
    margin: auto;
    max-width: 320px;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease;
}
.welcome-icon { font-size: 64px; margin-bottom: 20px; }
.welcome-screen h2 { font-size: 28px; font-weight: 900; margin-bottom: 12px; }
.welcome-screen p { font-size: 15px; color: var(--ai-text-dim); line-height: 1.6; }

.suggested-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 25px;
}
.suggested-chips button {
    background: var(--ai-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.suggested-chips button:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

/* Messages */
.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    animation: msgIn 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.user-msg {
    align-self: flex-end;
    background: var(--ai-accent);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--ai-accent-glow);
}

.bot-msg {
    align-self: flex-start;
    background: var(--ai-surface);
    color: white;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Input Area */
.input-area {
    padding: 15px 20px calc(15px + var(--safe-bot));
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    transition: 0.3s;
}
.input-wrapper:focus-within { border-color: var(--ai-accent); background: rgba(255, 255, 255, 0.08); }

textarea {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 16px;
    padding: 10px 0;
    outline: none;
    resize: none;
    max-height: 120px;
}

.send-btn {
    width: 44px;
    height: 44px;
    background: var(--ai-accent);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.send-btn:active { transform: scale(0.9); opacity: 0.8; }

/* Typing */
.typing-indicator {
    padding: 15px 20px;
    background: var(--ai-surface);
    border-radius: 20px;
    align-self: flex-start;
    display: none;
    gap: 5px;
}
.typing-indicator span { width: 6px; height: 6px; background: white; border-radius: 50%; animation: typing 1s infinite; opacity: 0.4; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 768px) {
    .ai-branding h1 { font-size: 16px; }
    .message { max-width: 90%; }
}
