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

:root {
    --bg-primary: #0a0c14;
    --bg-secondary: #111320;
    --bg-tertiary: #1a1d2e;
    --bg-hover: #242840;
    --bg-card: #161930;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd6;
    --accent-light: rgba(108, 92, 231, 0.15);
    --green: #00b894;
    --green-light: rgba(0, 184, 148, 0.15);
    --orange: #fdcb6e;
    --orange-light: rgba(253, 203, 110, 0.15);
    --red: #e17055;
    --red-light: rgba(225, 112, 85, 0.15);
    --blue: #74b9ff;
    --blue-light: rgba(116, 185, 255, 0.15);
    --border: #2d2f42;
    --sidebar-width: 280px;

    /* Neon / Holographic */
    --neon-cyan: #00f0ff;
    --neon-purple: #b24dff;
    --neon-pink: #ff2d95;
    --neon-green: #00ff88;
    --neon-cyan-glow: rgba(0, 240, 255, 0.3);
    --neon-purple-glow: rgba(178, 77, 255, 0.3);
    --holo-size: 200px;
    --holo-size-sm: 140px;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

.app {
    height: 100vh;
    height: 100dvh;
    position: relative;
}

/* ==================== SIDEBAR (overlay mode) ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    padding: 20px 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.store-logo {
    width: 40px;
    height: 40px;
    color: var(--neon-cyan);
    margin: 0 auto 4px;
    filter: drop-shadow(0 0 6px var(--neon-cyan-glow));
}
.store-logo svg {
    width: 100%;
    height: 100%;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.new-chat-btn:hover {
    background: var(--accent-hover);
}

.sidebar-nav {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--border);
}

.nav-btn {
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--neon-cyan);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.nav-btn:hover svg,
.nav-btn.active svg {
    opacity: 1;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.sidebar-conversations {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.conv-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conv-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.conv-item.active { background: var(--bg-tertiary); color: var(--text-primary); }

.conv-item .delete-conv {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.conv-item:hover .delete-conv { display: block; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.date-display { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.voice-status {
    font-size: 11px;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.voice-status svg {
    width: 14px;
    height: 14px;
}

/* ==================== MAIN ==================== */
.main {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0,240,255,0.08);
    gap: 12px;
    background: rgba(17,19,32,0.9);
    backdrop-filter: blur(10px);
    z-index: 10;
    flex-shrink: 0;
}

.header h1 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0,240,255,0.2);
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--neon-cyan);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.voice-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-toggle svg {
    width: 20px;
    height: 20px;
}
.voice-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0,240,255,0.1);
}

.voice-toggle.muted { opacity: 0.4; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225, 112, 85, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(225, 112, 85, 0); }
}

/* ==================== TABS ==================== */
.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* ==================== HOLOGRAPHIC BACKGROUND ==================== */
.holo-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.grid-floor {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 60%;
    background:
        linear-gradient(transparent 0%, rgba(0, 240, 255, 0.015) 100%),
        repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(0, 240, 255, 0.025) 59px, rgba(0, 240, 255, 0.025) 60px),
        repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(0, 240, 255, 0.025) 59px, rgba(0, 240, 255, 0.025) 60px);
    transform: perspective(500px) rotateX(60deg);
    transform-origin: center bottom;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-20px) scale(1); }
}

/* ==================== HOLOGRAPHIC CENTER ==================== */
.holo-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* ==================== HOLOGRAPHIC FACE ==================== */
.holo-face-container {
    position: relative;
    width: var(--holo-size);
    height: var(--holo-size);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.holo-face-container.active {
    width: var(--holo-size-sm);
    height: var(--holo-size-sm);
}

/* Outer ring - cyan neon */
.holo-ring-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    box-shadow:
        0 0 15px var(--neon-cyan-glow),
        0 0 40px rgba(0, 240, 255, 0.08),
        inset 0 0 15px var(--neon-cyan-glow);
    animation: holoRingPulse 4s ease-in-out infinite;
}

@keyframes holoRingPulse {
    0%, 100% {
        box-shadow: 0 0 15px var(--neon-cyan-glow), 0 0 40px rgba(0,240,255,0.08), inset 0 0 15px var(--neon-cyan-glow);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px var(--neon-cyan-glow), 0 0 60px rgba(0,240,255,0.12), inset 0 0 25px var(--neon-cyan-glow);
        transform: scale(1.02);
    }
}

/* Inner ring - purple dashed, rotating */
.holo-ring-inner {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1.5px dashed var(--neon-purple);
    opacity: 0.4;
    box-shadow: 0 0 10px var(--neon-purple-glow), inset 0 0 10px var(--neon-purple-glow);
    animation: holoRingSpin 20s linear infinite;
}

@keyframes holoRingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scan line */
.holo-scan-line {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}

.holo-scan-line::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.25), transparent);
    animation: holoScan 3s linear infinite;
}

@keyframes holoScan {
    0% { top: -2px; }
    100% { top: 100%; }
}

/* Face inner content */
.holo-face {
    position: absolute;
    inset: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Eyes */
.holo-eyes {
    display: flex;
    gap: 24px;
}

.holo-eye {
    width: 28px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 25px var(--neon-cyan-glow);
    position: relative;
    overflow: hidden;
    animation: holoBlink 4s infinite;
    transition: all 0.3s ease;
}

.holo-pupil {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px white;
    transition: all 0.3s;
}

@keyframes holoBlink {
    0%, 93%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
    97% { transform: scaleY(1); }
}

/* Mouth */
.holo-mouth {
    width: 40px;
    height: 4px;
    position: relative;
}

.holo-mouth-line {
    width: 100%;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--neon-cyan);
    transition: all 0.3s ease;
}

/* Sound waves */
.holo-sound-waves {
    position: absolute;
    inset: -20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sound-wave {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    opacity: 0;
}

@keyframes soundWaveExpand {
    0% { transform: scale(1); opacity: 0.4; border-color: var(--neon-cyan); }
    100% { transform: scale(1.8); opacity: 0; border-color: var(--neon-purple); }
}

/* Thinking ring */
.holo-thinking-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-purple);
    border-right-color: var(--neon-cyan);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@keyframes thinkingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Float particles around face */
.holo-float-particles {
    position: absolute;
    inset: -30px;
    pointer-events: none;
}

.holo-float-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--neon-cyan);
    animation: floatParticle 6s ease-in-out infinite;
}

.holo-float-particles span:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.holo-float-particles span:nth-child(2) { top: 85%; left: 10%; animation-delay: 1s; animation-duration: 7s; }
.holo-float-particles span:nth-child(3) { top: 15%; right: 5%; animation-delay: 2s; animation-duration: 5s; }
.holo-float-particles span:nth-child(4) { bottom: 10%; right: 10%; animation-delay: 0.5s; }
.holo-float-particles span:nth-child(5) { top: 50%; left: -5%; animation-delay: 3s; animation-duration: 8s; }
.holo-float-particles span:nth-child(6) { top: 45%; right: -5%; animation-delay: 1.5s; animation-duration: 5.5s; }

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
    25% { transform: translateY(-10px) translateX(5px); opacity: 0.8; }
    50% { transform: translateY(-5px) translateX(-3px); opacity: 0.4; }
    75% { transform: translateY(-15px) translateX(2px); opacity: 0.9; }
}

/* ==================== FACE STATES ==================== */

/* STATE: Listening - green eyes, wider */
.holo-face-container.state-listening .holo-eye {
    height: 18px;
    background: var(--neon-green);
    box-shadow: 0 0 12px var(--neon-green), 0 0 30px rgba(0, 255, 136, 0.3);
    animation: none;
}

.holo-face-container.state-listening .holo-ring-outer {
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3), 0 0 50px rgba(0, 255, 136, 0.1), inset 0 0 20px rgba(0, 255, 136, 0.15);
}

/* STATE: Thinking - spinner, eyes move */
.holo-face-container.state-thinking .holo-thinking-ring {
    opacity: 1;
    animation: thinkingSpin 1s linear infinite;
}

.holo-face-container.state-thinking .holo-pupil {
    animation: thinkEyes 1.5s ease-in-out infinite;
}

@keyframes thinkEyes {
    0%, 100% { transform: translate(-50%, -50%) translateX(-4px); }
    50% { transform: translate(-50%, -50%) translateX(4px); }
}

/* STATE: Speaking - mouth oscillates, sound waves, narrow eyes */
.holo-face-container.state-speaking .holo-eye {
    height: 10px;
    animation: none;
}

.holo-face-container.state-speaking .holo-mouth-line {
    animation: mouthOscillate 0.15s ease-in-out infinite alternate;
}

@keyframes mouthOscillate {
    0% { height: 3px; border-radius: 2px; }
    100% { height: 14px; border-radius: 50%; box-shadow: 0 0 12px var(--neon-cyan); }
}

.holo-face-container.state-speaking .holo-sound-waves {
    opacity: 1;
}

.holo-face-container.state-speaking .sound-wave {
    animation: soundWaveExpand 2s ease-out infinite;
}

.holo-face-container.state-speaking .sound-wave:nth-child(2) { animation-delay: 0.6s; }
.holo-face-container.state-speaking .sound-wave:nth-child(3) { animation-delay: 1.2s; }

.holo-face-container.state-speaking .holo-ring-outer {
    box-shadow: 0 0 20px var(--neon-cyan-glow), 0 0 60px rgba(0,240,255,0.15), inset 0 0 20px var(--neon-cyan-glow);
}

/* ==================== WELCOME CONTENT ==================== */
.welcome-content {
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.welcome-title {
    font-size: 24px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
}

.suggestion {
    padding: 14px;
    background: rgba(26, 29, 46, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 6px;
}
.suggestion svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 4px var(--neon-cyan-glow));
}

.suggestion:hover {
    background: rgba(0, 240, 255, 0.05);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
}

/* ==================== RESPONSE BUBBLE ==================== */
.response-bubble {
    max-width: 520px;
    width: 92%;
    background: rgba(22, 25, 48, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    padding: 18px 22px;
    position: relative;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.04), 0 8px 30px rgba(0, 0, 0, 0.25);
    animation: bubbleFadeIn 0.4s ease-out;
}

.response-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: rgba(22, 25, 48, 0.85);
    border-left: 1px solid rgba(0, 240, 255, 0.15);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
}

@keyframes bubbleFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.response-bubble-content {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.response-bubble-content p { margin-bottom: 10px; }
.response-bubble-content p:last-child { margin-bottom: 0; }
.response-bubble-content strong { color: #fff; }
.response-bubble-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Fira Code', monospace;
}
.response-bubble-content pre {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--border);
}
.response-bubble-content pre code { background: none; padding: 0; }
.response-bubble-content ul, .response-bubble-content ol { padding-left: 24px; margin: 8px 0; }
.response-bubble-content li { margin: 4px 0; }

/* ==================== USER ECHO ==================== */
.user-echo {
    padding: 8px 16px;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 400px;
    text-align: center;
    animation: bubbleFadeIn 0.3s ease-out;
}

.user-echo-text {
    color: var(--text-primary);
}

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 4px 0;
    justify-content: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    animation: typingDot 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* ==================== BIG MIC BUTTON ==================== */
.mic-main-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 4px;
    z-index: 2;
    flex-shrink: 0;
}

.mic-main-btn {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.15),
        0 0 50px rgba(0, 240, 255, 0.05),
        inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.mic-main-btn .mic-icon {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 2;
}

.mic-main-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: #fff;
    box-shadow:
        0 0 30px rgba(0, 240, 255, 0.3),
        0 0 60px rgba(0, 240, 255, 0.1),
        inset 0 0 20px rgba(0, 240, 255, 0.1);
    transform: scale(1.05);
}

.mic-main-btn:active {
    transform: scale(0.95);
}

/* Pulse rings behind mic button */
.mic-pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.15);
    opacity: 0;
    pointer-events: none;
}

/* When listening - VERY OBVIOUS red recording state */
.mic-main-btn.listening {
    background: rgba(255, 45, 45, 0.25);
    border-color: #ff2d2d;
    box-shadow:
        0 0 30px rgba(255, 45, 45, 0.5),
        0 0 80px rgba(255, 45, 45, 0.2),
        inset 0 0 25px rgba(255, 45, 45, 0.15);
    animation: micBreathe 1s ease-in-out infinite;
}

.mic-main-btn.listening .mic-icon {
    color: #ff2d2d;
    filter: drop-shadow(0 0 8px #ff2d2d);
}

.mic-main-btn.listening .mic-pulse-ring {
    border-color: rgba(255, 45, 45, 0.3);
    animation: micPulseExpand 1.5s ease-out infinite;
}

.mic-main-btn.listening .mic-pulse-ring-2 {
    animation-delay: 0.75s;
}

@keyframes micBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes micPulseExpand {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Voice mode active indicator (green ring) */
.mic-main-btn.voice-active {
    border-color: var(--neon-green);
    box-shadow:
        0 0 20px rgba(0, 255, 136, 0.2),
        0 0 50px rgba(0, 255, 136, 0.06),
        inset 0 0 15px rgba(0, 255, 136, 0.06);
}

.mic-main-btn.voice-active .mic-icon {
    color: var(--neon-green);
}

/* Listening overrides voice-active */
.mic-main-btn.voice-active.listening {
    border-color: var(--neon-cyan);
}

.mic-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    transition: all 0.3s;
    font-weight: 500;
}

.mic-main-btn.listening ~ .mic-label {
    color: #ff2d2d;
    font-weight: 700;
    animation: labelPulse 1s ease-in-out infinite;
}

.mic-main-btn.voice-active ~ .mic-label {
    color: var(--neon-green);
}

.dot-green {
    color: var(--neon-green);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
    margin-right: 4px;
}
.dot-red {
    color: #ff2d2d;
    text-shadow: 0 0 6px rgba(255, 45, 45, 0.6);
    margin-right: 4px;
}

@keyframes labelPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==================== INPUT AREA ==================== */
.input-area {
    padding: 4px 20px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    z-index: 2;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    background: rgba(26, 29, 46, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.input-wrapper:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
}

#userInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px; /* min 16px to prevent iOS auto-zoom */
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 200px;
    padding: 4px 8px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}

#userInput::placeholder { color: var(--text-secondary); }

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--neon-cyan);
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:disabled { opacity: 0.2; cursor: not-allowed; }
.send-btn:not(:disabled):hover {
    background: white;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.listening-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    color: #ff2d2d;
    font-size: 14px;
    font-weight: 600;
}

.pulse-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff2d2d;
    animation: pulse 1s infinite;
}

/* ==================== RECORDING BANNER (top of screen) ==================== */
.recording-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(255, 45, 45, 0.9), rgba(255, 80, 80, 0.9));
    color: white;
    text-align: center;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(255, 45, 45, 0.4);
    animation: bannerPulse 1.5s ease-in-out infinite;
}

.recording-banner.active {
    display: flex;
}

.recording-banner .rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    animation: recDotBlink 0.8s ease-in-out infinite;
}

@keyframes bannerPulse {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 1; }
}

@keyframes recDotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Push content down when banner is active */
body.is-recording .header {
    margin-top: 32px;
}

body.is-recording .identify-screen {
    padding-top: 52px;
}

/* ==================== PANELS (orders, reservations, catalog) ==================== */
.panel {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.panel h2 {
    font-size: 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-icon {
    width: 24px;
    height: 24px;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 4px var(--neon-cyan-glow));
    flex-shrink: 0;
}

.items-list { display: flex; flex-direction: column; gap: 12px; }

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
    font-size: 15px;
}

.item-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s;
}

.item-card:hover { border-color: var(--accent); }

.item-card .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-card .item-title { font-weight: 600; font-size: 15px; }

.item-card .item-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.status-pending { background: var(--orange-light); color: var(--orange); }
.status-confirmed { background: var(--green-light); color: var(--green); }
.status-cancelled { background: var(--red-light); color: var(--red); }

.item-card .item-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.catalog-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.catalog-card:hover { border-color: var(--neon-cyan); transform: translateY(-3px); box-shadow: 0 0 15px rgba(0,240,255,0.06); }

.catalog-card .product-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 6px var(--neon-cyan-glow));
}
.catalog-card .product-icon svg {
    width: 100%;
    height: 100%;
}
.catalog-card .product-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.catalog-card .product-price { color: var(--neon-cyan); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.catalog-card .product-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.catalog-card .order-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.catalog-card .order-btn:hover { background: var(--accent-hover); }

/* ==================== FICHES PRODUIT (dans bulle réponse) ==================== */
/* ==================== PRODUCT MODAL ==================== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.product-modal.active {
    opacity: 1;
}
.product-modal-content {
    background: linear-gradient(160deg, rgba(15, 20, 40, 0.98) 0%, rgba(10, 15, 30, 0.98) 100%);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}
.product-modal.active .product-modal-content {
    transform: scale(1) translateY(0);
}
.product-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    flex-shrink: 0;
}
.product-modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}
.product-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.product-modal-close:hover {
    background: rgba(255, 60, 60, 0.2);
    border-color: rgba(255, 60, 60, 0.4);
    color: #ff4444;
}
.product-modal-body {
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
}

/* Product Card in Modal */
.pm-card {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05) 0%, rgba(108, 92, 231, 0.07) 100%);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    animation: pmCardAppear 0.4s ease-out both;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.pm-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
}
.pm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: pmScanLine 3s linear infinite;
}
@keyframes pmCardAppear {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pmScanLine {
    from { left: -100%; }
    to { left: 100%; }
}

.pm-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.pm-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3));
}
.pm-icon svg {
    width: 100%;
    height: 100%;
}
.pm-info {
    flex: 1;
    min-width: 0;
}
.pm-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.pm-cat {
    font-size: 11px;
    color: var(--neon-purple);
    background: rgba(178, 77, 255, 0.12);
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
}
.pm-price {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    flex-shrink: 0;
    text-align: right;
}
.pm-price small {
    font-size: 12px;
    opacity: 0.7;
}
.pm-promo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(0, 255, 136, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.15);
}
.pm-old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 14px;
}
.pm-new-price {
    color: var(--neon-green);
    font-weight: 700;
    font-size: 18px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}
.pm-promo-badge {
    background: var(--neon-green);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: auto;
}
.pm-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}
.pm-loc {
    font-size: 12px;
    color: var(--neon-green);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pm-loc::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ff88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}
.pm-order-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent), var(--neon-purple));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    text-transform: uppercase;
}
.pm-order-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
}
.pm-order-btn:active {
    transform: scale(0.98);
}

/* Responsive product modal */
@media (max-width: 480px) {
    .product-modal { padding: 8px; }
    .product-modal-content { max-height: 90vh; border-radius: 16px; }
    .product-modal-body { padding: 12px; gap: 10px; }
    .pm-card { padding: 12px; }
    .pm-icon { width: 36px; height: 36px; }
    .pm-name { font-size: 14px; }
    .pm-price { font-size: 18px; }
    .pm-desc { font-size: 12px; }
    .pm-order-btn { padding: 10px 16px; font-size: 13px; }
}

/* ==================== EMAIL INPUT MODAL ==================== */
.email-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 20px;
}

.email-modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    width: 400px;
    max-width: 100%;
    text-align: center;
    animation: identifySlide 0.3s ease;
    margin: auto;
    flex-shrink: 0;
}

.email-modal-icon {
    width: 48px;
    height: 48px;
    color: var(--neon-cyan);
    margin: 0 auto 10px;
    filter: drop-shadow(0 0 8px var(--neon-cyan-glow));
}
.email-modal-icon svg {
    width: 100%;
    height: 100%;
}
.email-modal-card h2 { font-size: 20px; margin-bottom: 4px; color: var(--neon-cyan); }
.email-modal-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

.email-confirm-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 4px;
}

.email-confirm-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.email-confirm-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--neon-cyan);
    word-break: break-all;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.email-btn-confirm {
    background: var(--green) !important;
}

.email-btn-confirm:hover {
    background: #00a884 !important;
}

.modal-btn-secondary {
    padding: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--neon-cyan);
}

@media (max-width: 480px) {
    .email-modal-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .email-modal-card h2 { font-size: 18px; }
    .email-confirm-value { font-size: 17px; }
    .email-modal-card .modal-form input { font-size: 16px; }
}

/* ==================== CLIENT AUTH ==================== */
.client-auth-section { margin-bottom: 10px; }
.client-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--green-light);
    border: 1px solid rgba(0,184,148,0.3);
    border-radius: 8px;
}
.client-name-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 4px;
}
.icon-user {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.client-logout-btn {
    padding: 4px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.client-logout-btn:hover { background: var(--red); color: white; border-color: var(--red); }

/* ==================== IDENTIFICATION SCREEN ==================== */
.identify-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.identify-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    width: 380px;
    max-width: 100%;
    text-align: center;
    animation: identifySlide 0.3s ease;
    margin: auto;
    flex-shrink: 0;
}

@keyframes identifySlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.identify-icon {
    width: 60px;
    height: 60px;
    color: var(--neon-cyan);
    margin: 0 auto 12px;
    filter: drop-shadow(0 0 10px var(--neon-cyan-glow));
}
.identify-icon svg {
    width: 100%;
    height: 100%;
}
.identify-card h2 { font-size: 22px; margin-bottom: 6px; }
.identify-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.identify-new-msg { color: var(--green); font-size: 14px; margin-bottom: 16px; font-weight: 500; }
.identify-skip { margin-top: 18px; font-size: 13px; }
.identify-skip a { color: var(--text-secondary); text-decoration: none; }
.identify-skip a:hover { color: var(--text-primary); text-decoration: underline; }

.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-form input {
    padding: 13px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px; /* min 16px to prevent iOS auto-zoom */
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}
.modal-form input:focus { border-color: var(--accent); }
.modal-form input::placeholder { color: var(--text-secondary); opacity: 0.7; }

.modal-btn-primary {
    padding: 13px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}
.modal-btn-primary:hover { background: var(--accent-hover); }
.modal-btn-primary:disabled { opacity: 0.5; cursor: wait; }
.modal-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* ==================== RESPONSIVE ==================== */

/* Tablet & small desktop */
@media (max-width: 768px) {
    :root {
        --holo-size: 130px;
        --holo-size-sm: 80px;
    }

    .holo-eyes { gap: 18px; }
    .holo-eye { width: 22px; height: 11px; }
    .holo-pupil { width: 6px; height: 6px; }
    .holo-mouth { width: 30px; }

    .mic-main-btn {
        width: 64px;
        height: 64px;
    }
    .mic-main-btn .mic-icon {
        width: 28px;
        height: 28px;
    }
    .mic-label { font-size: 12px; }

    .suggestions { grid-template-columns: 1fr; gap: 8px; }
    .suggestion { padding: 10px 12px; font-size: 13px; }
    .response-bubble { max-width: 95%; padding: 14px 16px; }
    .welcome-title { font-size: 20px; }
    .welcome-subtitle { font-size: 13px; margin-bottom: 16px; }
    .catalog-grid { grid-template-columns: 1fr 1fr; }
    .holo-center { padding: 10px; gap: 10px; }
    .input-area { padding: 4px 12px 8px; }
    .mic-main-area { padding: 4px 12px 2px; gap: 4px; }
    .header { padding: 8px 12px; }
    .header h1 { font-size: 15px; }
}

/* Mobile phones */
@media (max-width: 480px) {
    :root {
        --holo-size: 110px;
        --holo-size-sm: 65px;
    }

    .holo-eyes { gap: 14px; }
    .holo-eye { width: 18px; height: 9px; }
    .holo-pupil { width: 5px; height: 5px; }
    .holo-mouth { width: 26px; }
    .holo-face { gap: 10px; }

    .holo-float-particles { display: none; }
    .holo-sound-waves { inset: -10px; }
    .holo-thinking-ring { inset: -6px; }

    .mic-main-btn {
        width: 56px;
        height: 56px;
    }
    .mic-main-btn .mic-icon {
        width: 24px;
        height: 24px;
    }
    .mic-label { font-size: 11px; }
    .mic-main-area { padding: 2px 12px 0; gap: 2px; }

    .holo-center {
        padding: 8px;
        gap: 8px;
        justify-content: flex-start;
        padding-top: 12px;
    }

    .welcome-content { padding: 0 4px; }
    .welcome-title { font-size: 17px; margin-bottom: 4px; }
    .welcome-subtitle { font-size: 12px; margin-bottom: 12px; }
    .suggestions { gap: 6px; max-width: 100%; }
    .suggestion { padding: 10px; font-size: 12px; }

    .response-bubble {
        max-width: 98%;
        padding: 12px 14px;
        border-radius: 12px;
    }
    .response-bubble-content { font-size: 14px; line-height: 1.6; }

    .input-area { padding: 2px 8px 6px; }
    .input-wrapper { padding: 6px 10px; border-radius: 12px; }
    #userInput { font-size: 16px; padding: 2px 6px; }
    .send-btn { width: 34px; height: 34px; }

    .header { padding: 6px 10px; gap: 8px; }
    .header h1 { font-size: 14px; }
    .voice-toggle { width: 34px; height: 34px; font-size: 14px; }
    .menu-toggle { font-size: 18px; padding: 2px 6px; }

    .catalog-grid { grid-template-columns: 1fr; }

    .listening-indicator { padding: 6px; font-size: 12px; gap: 6px; }
    .pulse-ring { width: 10px; height: 10px; }

    /* Identification screen mobile */
    .identify-card {
        padding: 24px 20px;
        border-radius: 16px;
        max-width: 95%;
    }
    .identify-icon { width: 48px; height: 48px; margin-bottom: 8px; }
    .identify-card h2 { font-size: 18px; margin-bottom: 4px; }
    .identify-card > p { font-size: 13px; margin-bottom: 16px; }
    .modal-form input { padding: 12px 14px; font-size: 16px; }
    .modal-btn-primary { padding: 12px; font-size: 14px; }
}

/* Very small phones */
@media (max-width: 360px) {
    :root {
        --holo-size: 90px;
        --holo-size-sm: 55px;
    }
    .holo-eyes { gap: 10px; }
    .holo-eye { width: 14px; height: 7px; }
    .holo-pupil { width: 4px; height: 4px; }
    .holo-mouth { width: 22px; }

    .mic-main-btn { width: 50px; height: 50px; }
    .mic-main-btn .mic-icon { width: 22px; height: 22px; }
    .welcome-title { font-size: 15px; }
    .suggestion { padding: 8px; font-size: 11px; }
    .header h1 { font-size: 13px; }
    .response-bubble-content { font-size: 13px; }
}

/* When keyboard is open (detected via JS class on body) */
body.keyboard-open .holo-face-container {
    width: var(--holo-size-sm) !important;
    height: var(--holo-size-sm) !important;
}

body.keyboard-open .welcome-content {
    display: none !important;
}

body.keyboard-open .holo-center {
    justify-content: flex-start;
    padding-top: 8px;
    gap: 8px;
}

body.keyboard-open .response-bubble {
    max-height: 30vh;
    overflow-y: auto;
}

/* Mic stays visible but compact when keyboard is open */
body.keyboard-open .mic-main-area {
    padding: 2px 12px 0;
}
body.keyboard-open .mic-main-btn {
    width: 44px;
    height: 44px;
}
body.keyboard-open .mic-main-btn .mic-icon {
    width: 20px;
    height: 20px;
}
body.keyboard-open .mic-label {
    display: none;
}
body.keyboard-open .listening-indicator {
    font-size: 11px;
    padding: 4px;
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --holo-size: 80px;
        --holo-size-sm: 50px;
    }
    .holo-center { padding: 4px; gap: 6px; }
    .mic-main-area { display: none; }
    .welcome-content { display: none; }
    .header { padding: 4px 10px; }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .input-area {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .identify-screen {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* ==================== RESET OVERLAY (Kiosk mode) ==================== */
.reset-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 10, 20, 0.95);
    z-index: 500;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.reset-overlay.active {
    opacity: 1;
}
.reset-content {
    text-align: center;
    animation: resetPulse 2s ease-in-out infinite;
}
.reset-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: resetWave 1.5s ease-in-out;
}
.reset-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.3);
    margin-bottom: 12px;
}
.reset-subtext {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}
@keyframes resetWave {
    0% { transform: rotate(0deg) scale(1); }
    15% { transform: rotate(14deg) scale(1.1); }
    30% { transform: rotate(-8deg) scale(1.1); }
    45% { transform: rotate(10deg) scale(1.05); }
    60% { transform: rotate(-4deg) scale(1); }
    100% { transform: rotate(0deg) scale(1); }
}
@keyframes resetPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}
