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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f5f5f5;
    overflow: hidden;
}

.mobile-block {
    display: none;
    width: 100%;
    max-width: 560px;
    padding: 24px;
}

.mobile-block-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.05);
    text-align: left;
}

.mobile-block-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.mobile-block-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
}

.mobile-block-text:last-child {
    margin-bottom: 0;
}

.mobile-block-link {
    display: inline-flex;
    margin-top: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
}

.mobile-block-link:hover {
    background: rgba(255, 255, 255, 0.18);
}

.container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.orb-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 40px;
}

.orb {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #d9d9d9 35%, #0f0f0f 100%);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.orb:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.4);
}

.orb:active {
    transform: scale(0.98);
}

.orb.listening {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f0f0f0 40%, #202020 100%);
    animation: pulse 2s ease-in-out infinite;
}

.orb.thinking {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #e0e0e0 45%, #1b1b1b 100%);
    animation: spin 2s linear infinite;
}

.orb.speaking {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #ededed 45%, #151515 100%);
    animation: soundwave 0.8s ease-in-out infinite;
}

.orb.error {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #cfcfcf 45%, #3b3b3b 100%);
    animation: shake 0.5s ease-in-out;
}

.orb-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: inherit;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.orb.listening .orb-glow,
.orb.speaking .orb-glow {
    opacity: 0.6;
}

.orb-pulse {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
}

.orb.listening .orb-pulse {
    animation: pulseRing 2s ease-out infinite;
}

.status-text {
    margin-top: 18px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.9;
    transition: all 0.3s ease;
    min-height: 24px;
    color: #f5f5f5;
}

.helper-text {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.pwa-note {
    display: none;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
    max-width: 560px;
}

.pwa-title {
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}

.pwa-text {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
}

.pwa-steps {
    margin: 8px 0 0 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.6;
}

body.mobile-only .container {
    display: none;
}

body.mobile-only .mobile-block {
    display: flex;
    justify-content: center;
}

body.mobile-only .pwa-note {
    display: block;
}

.listening-status::after {
    content: '…';
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: dots 1.2s steps(4, end) infinite;
}

.transcript-container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 24px;
    margin: 20px auto;
    max-width: 720px;
    max-height: 300px;
    min-height: 300px;
    height: 300px;
    overflow: hidden;
    scrollbar-gutter: stable;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.transcript {
    text-align: left;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
}

.lead-summary {
    display: none;
    width: 100%;
    max-width: 720px;
    margin: 14px auto 0;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: left;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.lead-summary.visible {
    display: block;
}

.lead-summary-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.lead-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
    font-size: 14px;
    color: #f5f5f5;
}

.lead-summary-list span {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    margin-right: 6px;
}

.message {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 15px;
    animation: slideIn 0.3s ease-out;
    line-height: 1.6;
}

.message.user {
    background: rgba(255, 255, 255, 0.18);
    margin-left: 40px;
    border-bottom-right-radius: 5px;
}

.message.assistant {
    background: rgba(255, 255, 255, 0.14);
    margin-right: 40px;
    border-bottom-left-radius: 5px;
}

.message-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-text {
    font-size: 17px;
    color: #f5f5f5;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.45);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 20px rgba(255, 255, 255, 0.15);
}

.control-btn.active:hover {
    background: rgba(255, 255, 255, 0.28);
}

.control-labels {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 16px;
    margin-top: 12px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.65);
}

.control-label {
    text-align: center;
}

.control-help {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.mic-helper {
    margin-top: 14px;
    font-size: 12px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mic-helper.visible {
    opacity: 1;
}

.play-response-btn {
    margin-top: 14px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    display: none;
}

.play-response-btn.visible {
    display: inline-flex;
}

.start-convo-btn {
    margin-top: 12px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    display: none;
}

.start-convo-btn.visible {
    display: inline-flex;
}


/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes soundwave {
    0%, 100% { 
        transform: scale(1);
        border-radius: 50%;
    }
    50% { 
        transform: scale(1.05);
        border-radius: 45%;
    }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: '...'; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

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

/* Scrollbar styling */
.transcript-container::-webkit-scrollbar {
    width: 8px;
}

.transcript-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.transcript-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.transcript-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .orb {
        width: 150px;
        height: 150px;
    }
    
    .transcript-container {
        padding: 20px;
        max-height: 300px;
    }
    
    .message {
        padding: 12px 15px;
    }
    
    .message.user {
        margin-left: 20px;
    }
    
    .message.assistant {
        margin-right: 20px;
    }
}
