/**
 * Futuristic Audio Artifacts Dashboard Stylesheet
 * Custom designed for Cyberpunk Theme
 */

:root {
    /* Fonts */
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;

    /* Theme Colors */
    --bg-main: #05050a;
    --bg-header: rgba(10, 10, 18, 0.7);
    --bg-sidebar: rgba(12, 12, 24, 0.5);
    --bg-card: rgba(18, 18, 32, 0.45);
    --bg-console: #06060c;
    
    /* Neon Colors */
    --neon-blue: #00f0ff;
    --neon-blue-glow: rgba(0, 240, 255, 0.25);
    --neon-purple: #bc34fa;
    --neon-purple-glow: rgba(188, 52, 250, 0.25);
    --neon-green: #39ff14;
    --neon-green-glow: rgba(57, 255, 20, 0.25);
    --neon-orange: #ff9f1c;
    --neon-red: #ff3366;
    --neon-red-glow: rgba(255, 51, 102, 0.25);

    /* UI Borders & Accents */
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-hover: rgba(255, 255, 255, 0.1);
    --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --glass-blur: blur(25px);
}

/* Reset and Core Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 100%, rgba(188, 52, 250, 0.08) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(0, 240, 255, 0.08) 0px, transparent 40%);
    color: #cbd5e1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphic Dashboard Header */
.glass-header {
    background-color: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1rem 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid var(--border-glass);
    position: relative;
}

.glass-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-blue), transparent);
    opacity: 0.6;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.header h1 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 70%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-sub {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neon-blue);
    text-decoration: none;
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(0, 240, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue-glow);
    transform: translateX(-2px);
}

/* Master Page Workspace */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar Sessions Panels */
.glass-sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
}

#sidebar-sessions-panel,
#sidebar-memories-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

.sidebar h2 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.session-count-badge {
    font-family: var(--font-header);
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.session-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
}

/* Sidebar Scrollbar */
.session-list::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.sandbox-log::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.session-list::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.sandbox-log::-webkit-scrollbar-track {
    background: transparent;
}

.session-list::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.sandbox-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.session-list::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.sandbox-log::-webkit-scrollbar-thumb:hover {
    background: rgba(188, 52, 250, 0.25);
}

/* Session List Items: Beautiful card hovering */
.session-item {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.session-item.active {
    background: rgba(188, 52, 250, 0.08);
    border: 1px solid rgba(188, 52, 250, 0.35);
    box-shadow: 0 4px 15px rgba(188, 52, 250, 0.05);
}

.session-id {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
    word-break: break-all;
    transition: color 0.2s;
}

.session-item.active .session-id {
    color: var(--neon-purple);
    text-shadow: 0 0 10px rgba(188, 52, 250, 0.3);
}

.session-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
}

/* Main Workspace Viewport */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem 3rem;
}

/* Welcome Overlay */
.welcome-message {
    max-width: 500px;
    margin: 6rem auto 0 auto;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glow-shadow);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(188, 52, 250, 0.4));
}

.welcome-message h3 {
    font-family: var(--font-header);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Session Timeline Nodes */
.timeline {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    animation: fade-in-dashboard 0.35s ease-out;
}

@keyframes fade-in-dashboard {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.timeline-header {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    padding: 1.25rem 1.75rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: var(--glow-shadow);
}

.session-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.title-meta {
    font-size: 0.75rem;
    color: var(--neon-purple);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#current-session-title {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
}

.user-badge {
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    padding: 0.3rem 0.85rem;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #cbd5e1;
}

.audio-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid rgba(255,255,255,0.03);
}

/* Audio block card structure */
.audio-block {
    display: flex;
    flex-direction: column;
    width: 80%;
    padding: 1.1rem;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glow-shadow);
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
}

/* timeline connecting dots */
.audio-block::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    left: calc(-1rem - 6px);
    top: 2rem;
    border: 2px solid var(--bg-main);
    transition: all 0.3s;
}

/* Input Audio: Blue Neon Glow (User speaking) */
.audio-block.input {
    align-self: flex-end;
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.03);
}

.audio-block.input::after {
    background-color: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
}

.audio-block.input:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* Output Audio: Purple Neon Glow (Gemini responding) */
.audio-block.output {
    align-self: flex-start;
    border-color: rgba(188, 52, 250, 0.2);
    box-shadow: 0 4px 20px rgba(188, 52, 250, 0.03);
}

.audio-block.output::after {
    background-color: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
}

.audio-block.output:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(188, 52, 250, 0.1);
}

/* Header Inside block cards */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.input .block-header { 
    color: var(--neon-blue); 
    font-family: var(--font-header);
    letter-spacing: 0.5px;
}
.output .block-header { 
    color: var(--neon-purple); 
    font-family: var(--font-header);
    letter-spacing: 0.5px;
}

.timestamp {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #64748b;
    font-weight: normal;
}

/* Custom Styled Audio Controllers */
audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    outline: none;
    filter: invert(0.9) hue-rotate(180deg); /* Style default chrome audio to look dark/cyber */
    opacity: 0.85;
    transition: opacity 0.2s;
}

audio:hover {
    opacity: 1;
}

/* Buttons and Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn.primary { 
    background: linear-gradient(135deg, var(--neon-blue) 0%, #0099ff 100%); 
    color: #030712; 
    box-shadow: 0 4px 10px rgba(0,240,255,0.2);
}

.btn.primary:hover {
    box-shadow: 0 0 15px var(--neon-blue-glow);
}

.btn.secondary { 
    background-color: rgba(255,255,255,0.05); 
    color: #f1f5f9; 
    border: 1px solid rgba(255,255,255,0.1); 
}

.btn.secondary:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
}

.btn.danger { 
    background: linear-gradient(135deg, var(--neon-red) 0%, #dc2626 100%); 
    color: white; 
    box-shadow: 0 4px 10px rgba(255,51,102,0.2);
}

.btn.danger:hover {
    box-shadow: 0 0 15px var(--neon-red-glow);
}

/* Inject Audio Block Button */
.inject-btn {
    margin-top: 0.75rem;
    align-self: flex-end;
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 30px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--neon-blue);
    font-family: var(--font-header);
    font-weight: 700;
}

.inject-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-glow);
}

/* Sandbox Panel Overhaul (Developer Console) */
.glass-sandbox {
    width: 380px;
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
    animation: slide-in-sandbox 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-in-sandbox {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sandbox-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sandbox-title-block {
    display: flex;
    flex-direction: column;
}

.sandbox-header h2 { 
    font-family: var(--font-header);
    font-size: 1.1rem; 
    color: #ffffff;
    font-weight: 700;
}

.sandbox-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.sandbox-controls {
    display: flex;
    align-items: center;
}

/* Sandbox connection status light */
.sandbox-status {
    padding: 0.75rem 1.25rem;
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
    background-color: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot-wrapper {
    position: relative;
    width: 8px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #475569; /* disconnected */
    border-radius: 50%;
    z-index: 2;
    transition: background-color 0.3s;
}

.status-dot.connected {
    background-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}

.status-dot-pulse {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid var(--neon-green);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.status-dot.connected + .status-dot-pulse {
    animation: status-pulse-ring 2s infinite;
}

@keyframes status-pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.status-label {
    color: #64748b;
}

#sandbox-status-text {
    color: #cbd5e1;
}

/* Monospaced Log Container */
.sandbox-log-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-console);
    overflow: hidden;
}

.sandbox-log-header {
    background-color: rgba(0,0,0,0.3);
    padding: 0.5rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #475569;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.sandbox-log {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* Individual Sandbox Log Entries */
.log-entry {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    word-break: break-all;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.log-entry.system { 
    color: #64748b; 
    background-color: rgba(255,255,255,0.01); 
    border-left: 2px solid #475569;
}

.log-entry.injected { 
    color: #e2e8f0; 
    border-left: 3px solid var(--neon-blue); 
    background-color: rgba(0, 240, 255, 0.02);
}

.log-entry.model { 
    color: #f8fafc; 
    border-left: 3px solid var(--neon-purple); 
    background-color: rgba(188, 52, 250, 0.02);
}

/* Scroll Styling inside Console entries */
.log-entry pre {
    margin-top: 0.4rem;
    padding: 0.4rem;
    background: #030712;
    border-radius: 4px;
    overflow-x: auto;
    color: #38bdf8;
    font-size: 0.7rem;
}

/* Timeline Barge-In Overlap Interrupted Badge Styles */
.audio-block.has-interruption {
    border-color: rgba(255, 51, 102, 0.3) !important;
}

.interruption-alert {
    margin-top: 0.75rem;
    animation: pulse-border-red 2s infinite alternate;
    border-radius: 8px;
}

.interruption-badge {
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.35);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    backdrop-filter: var(--glass-blur);
}

.badge-icon {
    font-size: 0.95rem;
    filter: drop-shadow(0 0 5px var(--neon-red));
    animation: flash-slow 1.5s infinite;
}

.badge-title {
    font-family: var(--font-header);
    font-weight: 700;
    color: var(--neon-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
}

.badge-details {
    color: #cbd5e1;
}

.badge-details strong {
    color: #ffffff;
    font-family: var(--font-mono);
}

@keyframes pulse-border-red {
    0% { box-shadow: 0 0 5px rgba(255, 51, 102, 0.1); }
    100% { box-shadow: 0 0 12px rgba(255, 51, 102, 0.25); }
}

@keyframes flash-slow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}


/* --- Sandbox Live Level Monitor Styling --- */
.sandbox-monitor {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background-color: rgba(255, 255, 255, 0.01);
}

.monitor-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.monitor-title {
    font-family: var(--font-header);
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.btn-mic-toggle {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 30px !important;
}

.btn-mic-toggle.active {
    background: rgba(0, 240, 255, 0.15) !important;
    border-color: var(--neon-blue) !important;
    color: var(--neon-blue) !important;
    box-shadow: 0 0 10px var(--neon-blue-glow);
}

.level-meter-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.db-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: #475569;
}

.level-meter-bar-wrapper {
    position: relative;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: visible; /* Need visible for markers to hover outside */
}

.level-meter-bar {
    height: 100%;
    width: 0%;
    border-radius: 5px;
    background: linear-gradient(90deg, 
        var(--neon-green) 0%, 
        var(--neon-green) 60%, 
        var(--neon-blue) 60%, 
        var(--neon-blue) 85%, 
        var(--neon-purple) 85%, 
        var(--neon-purple) 95%, 
        var(--neon-red) 95%
    );
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
    transition: width 0.1s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.marker {
    position: absolute;
    top: -5px;
    bottom: -5px;
    width: 2px;
    z-index: 10;
    transition: left 0.3s ease;
}

.marker-label {
    position: absolute;
    top: -11px;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
}

.noise-floor-marker {
    background-color: var(--neon-orange);
    box-shadow: 0 0 6px var(--neon-orange);
}

.noise-floor-marker .marker-label {
    color: var(--neon-orange);
}

.vad-gate-marker {
    background-color: var(--neon-blue);
    border-left: 1px dashed var(--neon-blue);
    width: 0;
}

.vad-gate-marker .marker-label {
    color: var(--neon-blue);
}

.monitor-metrics {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.metric {
    display: flex;
    gap: 0.3rem;
    font-size: 0.65rem;
}

.metric-label {
    color: #64748b;
}

.metric-value {
    font-family: var(--font-mono);
    color: #cbd5e1;
    font-weight: 500;
}

.acoustics-alert-banner {
    margin-top: 0.75rem;
    background: rgba(255, 159, 28, 0.08);
    border: 1px solid rgba(255, 159, 28, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: #ffd8a8;
    animation: fade-in-dashboard 0.25s ease-out;
}

.alert-icon {
    font-size: 0.8rem;
}


/* --- Sandbox Interruption Diagnostics HUD Styling --- */
.sandbox-diagnostics {
    background-color: rgba(10, 10, 20, 0.4);
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sandbox-diagnostics.collapsed {
    max-height: 48px; /* Header height only */
}

.sandbox-diagnostics:not(.collapsed) {
    max-height: 380px; /* Fully expanded */
}

.diagnostics-header {
    height: 48px;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.01);
    transition: background 0.2s;
    user-select: none;
}

.diagnostics-header:hover {
    background: rgba(255,255,255,0.03);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon {
    font-size: 0.95rem;
}

.header-title {
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.75px;
    color: #e2e8f0;
}

.diagnostics-arrow {
    font-size: 0.65rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

.sandbox-diagnostics:not(.collapsed) .diagnostics-arrow {
    transform: rotate(90deg);
}

.diagnostics-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.diagnostics-placeholder {
    color: #475569;
    font-size: 0.72rem;
    text-align: center;
    margin: 2rem 0;
    line-height: 1.5;
    font-style: italic;
}

.diagnostics-report {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    animation: fade-in-dashboard 0.3s ease-out;
}

.diagnostic-verdict {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.verdict-tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.4);
    color: var(--neon-red);
}

.verdict-tag.aec-ok {
    background: rgba(57, 255, 20, 0.15);
    border-color: rgba(57, 255, 20, 0.4);
    color: var(--neon-green);
}

.verdict-tag.network-warning {
    background: rgba(255, 159, 28, 0.15);
    border-color: rgba(255, 159, 28, 0.4);
    color: var(--neon-orange);
}

.verdict-title {
    font-family: var(--font-header);
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.diagnostic-timing {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    gap: 0.4rem;
}

.diagnostic-timing strong {
    color: #cbd5e1;
}

.diagnostic-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.02);
    padding: 0.75rem;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
}

.detail-label {
    color: #64748b;
}

.detail-value {
    color: #cbd5e1;
}

.detail-value.text-green { color: var(--neon-green) !important; font-weight: bold; }
.detail-value.text-red { color: var(--neon-red) !important; font-weight: bold; }
.detail-value.text-orange { color: var(--neon-orange) !important; font-weight: bold; }

.diagnostic-recommendations {
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 0.75rem;
    border-radius: 8px;
}

.recommendations-title {
    font-family: var(--font-header);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    letter-spacing: 0.5px;
}

.diagnostic-recommendations p {
    font-size: 0.72rem;
    line-height: 1.45;
    color: #cbd5e1;
}

/* Scrollbar styles for diagnostic scroll elements */
.diagnostics-content::-webkit-scrollbar {
    width: 3px;
}

.diagnostics-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}


/* --- Response/Layout Adjustments --- */
@media (max-width: 1100px) {
    .main-container {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .glass-sidebar {
        width: 100%;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    
    .main-content {
        padding: 1.5rem;
        max-height: calc(100vh - 350px);
    }
    
    .glass-sandbox {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-glass);
        max-height: 300px;
    }
}

/* --- Acoustics Monitor Guide Legend --- */
.monitor-guide {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.guide-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 0.7rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.55);
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 5px;
    flex-shrink: 0;
}

.floor-dot {
    background: var(--neon-orange);
    box-shadow: 0 0 6px var(--neon-orange);
}

.vad-dot {
    background: var(--neon-blue);
    box-shadow: 0 0 6px var(--neon-blue);
}

.guide-text strong {
    color: #ffffff;
}

/* --- Double-Channel Transcription Persistence & Visualization --- */
.audio-transcription {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.audio-transcription.collapsed {
    /* Keep container visible so header can be clicked; only child content is toggled via display property in JS */
}
.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    user-select: none;
}
.transcription-header:hover {
    color: #cbd5e1;
}
.transcription-caret {
    font-size: 0.6rem;
    transition: transform 0.2s;
}
.audio-transcription:not(.collapsed) .transcription-caret {
    transform: rotate(90deg);
}
.transcription-content {
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #cbd5e1;
    word-break: break-word;
}
.input .audio-transcription {
    border-color: rgba(0, 240, 255, 0.1);
}
.input .transcription-header {
    color: rgba(0, 240, 255, 0.6);
}
.input .transcription-header:hover {
    color: var(--neon-blue);
}
.output .audio-transcription {
    border-color: rgba(188, 52, 250, 0.1);
}
.output .transcription-header {
    color: rgba(188, 52, 250, 0.6);
}
.output .transcription-header:hover {
    color: var(--neon-purple);
}

/* --- Interactive Function Call Timelines --- */
.tool-call-block {
    align-self: center;
    width: 60%;
    background: rgba(6, 30, 15, 0.3);
    border: 1px dashed var(--neon-green);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.05);
    position: relative;
    animation: fade-in-dashboard 0.3s ease-out;
}
.tool-call-block.sandbox-run {
    background: rgba(30, 41, 59, 0.45);
    border: 1px dashed #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.08);
}
.tool-call-block.sandbox-run::after {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}
.tool-call-block.sandbox-run .tool-call-header {
    color: #f59e0b;
}
.tool-call-block.sandbox-run .tool-call-latency {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.tool-call-block.sandbox-run .tool-call-code {
    color: #e2e8f0;
}

.tool-call-block::after {

    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    left: calc(-1rem - 6px);
    top: 2rem;
    border: 2px solid var(--bg-main);
}
.tool-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--neon-green);
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}
.tool-call-latency {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: rgba(57, 255, 20, 0.1);
    color: var(--neon-green);
    padding: 2px 6px;
    border-radius: 4px;
}
.tool-call-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tool-call-section-title {
    font-size: 0.65rem;
    color: #475569;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 0.25rem;
}
.tool-call-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a7f3d0;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* --- Intelligent Intent Regression Judge Widget --- */
.sandbox-intent-judge {
    margin-top: 14px;
    background: rgba(18, 18, 32, 0.65);
    border: 1px solid var(--border-glass);
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.judge-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.judge-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px var(--neon-blue));
}
.judge-title {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.75px;
    color: #ffffff;
}
.badge-glow-wrapper {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}
.verdict-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    transition: all 0.3s;
}
.verdict-score {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: 30px;
}
.verdict-badge.MATCH {
    border-color: rgba(57, 255, 20, 0.4);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.15);
}
.verdict-badge.MATCH .badge-status-dot {
    background-color: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.verdict-badge.ALTERNATIVE_OK {
    border-color: rgba(255, 159, 28, 0.4);
    color: var(--neon-orange);
    box-shadow: 0 0 15px rgba(255, 159, 28, 0.15);
}
.verdict-badge.ALTERNATIVE_OK .badge-status-dot {
    background-color: var(--neon-orange);
    box-shadow: 0 0 6px var(--neon-orange);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.verdict-badge.MISMATCH {
    border-color: rgba(255, 51, 102, 0.4);
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.15);
}
.verdict-badge.MISMATCH .badge-status-dot {
    background-color: var(--neon-red);
    box-shadow: 0 0 6px var(--neon-red);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.verdict-explanation {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* --- High-Tech Split Screen HUD Modal --- */
.hud-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 10, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: opacity 0.3s ease;
}
.hud-modal.hidden {
    display: none !important;
}
.hud-modal-content {
    width: 90%;
    max-width: 950px;
    background: rgba(15, 15, 28, 0.85);
    border: 1px solid rgba(188, 52, 250, 0.25);
    box-shadow: 0 0 40px rgba(188, 52, 250, 0.15);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: zoom-in-hud 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes zoom-in-hud {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.hud-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
}
.hud-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.60rem;
}
.hud-modal-title-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 8px var(--neon-purple));
}
.hud-modal-header h3 {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}
.close-btn {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.close-btn:hover {
    color: var(--neon-red);
}
.hud-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 2rem;
    overflow-y: auto;
    max-height: 70vh;
}
.comparison-column {
    display: flex;
    flex-direction: column;
}
.comparison-column h4 {
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}
.comparison-column.original h4 {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue-glow);
}
.comparison-column.live-replay h4 {
    color: var(--neon-purple);
    text-shadow: 0 0 8px var(--neon-purple-glow);
}
.col-content {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.field-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field-text-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 12px;
    min-height: 80px;
    max-height: 180px;
    overflow-y: auto;
}
.field-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
}
.field-text-box.response {
    border-color: rgba(0, 240, 255, 0.15);
}
.field-text-box.live-response {
    border-color: rgba(188, 52, 250, 0.15);
}
.verdict-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 5px;
    transition: all 0.3s;
}
.verdict-banner.MATCH {
    border-color: rgba(57, 255, 20, 0.25);
    background: rgba(57, 255, 20, 0.02);
}
.verdict-banner.ALTERNATIVE_OK {
    border-color: rgba(255, 159, 28, 0.25);
    background: rgba(255, 159, 28, 0.02);
}
.verdict-banner.MISMATCH {
    border-color: rgba(255, 51, 102, 0.25);
    background: rgba(255, 51, 102, 0.02);
}
.score-ring {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
.circular-chart {
    display: block;
    max-width: 100%;
    max-height: 100%;
}
.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.8;
}
.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease;
}
.MATCH .circle { stroke: var(--neon-green); }
.ALTERNATIVE_OK .circle { stroke: var(--neon-orange); stroke-dasharray: 0, 100; }
.MISMATCH .circle { stroke: var(--neon-red); stroke-dasharray: 0, 100; }

.percentage {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-anchor: middle;
    fill: #ffffff;
}
.banner-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.banner-text .category {
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}
.MATCH .banner-text .category { color: var(--neon-green); text-shadow: 0 0 10px rgba(57, 255, 20, 0.2); }
.ALTERNATIVE_OK .banner-text .category { color: var(--neon-orange); text-shadow: 0 0 10px rgba(255, 159, 28, 0.2); }
.MISMATCH .banner-text .category { color: var(--neon-red); text-shadow: 0 0 10px rgba(255, 51, 102, 0.2); }

.banner-text .explanation {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .hud-modal-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* --- Translucent HUD Metadata Console --- */
.session-metadata-hud {
    background: rgba(18, 18, 32, 0.4) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1.25rem 0 1.5rem 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInSlide 0.5s ease-out;
}

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

.hud-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.hud-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.hud-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Icons */
.hud-card-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.hud-card[data-card="model"] .hud-card-icon {
    background: rgba(56, 189, 248, 0.1);
}
.hud-card[data-card="session-id"] .hud-card-icon {
    background: rgba(168, 85, 247, 0.1);
}
.hud-card[data-card="tokens"] .hud-card-icon {
    background: rgba(34, 197, 94, 0.1);
}
.hud-card[data-card="stats"] .hud-card-icon {
    background: rgba(236, 72, 153, 0.1);
}

/* Card Content Layout */
.hud-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0; /* Prevent overflow */
}

.hud-card-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 700;
    font-family: var(--font-header);
}

.hud-card-value {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Neon Text Accents */
.neon-blue-text {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.neon-purple-text {
    color: #c084fc;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}
.neon-green-text {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}
.neon-pink-text {
    color: #f472b6;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.25);
}

/* Session ID copy wrapper */
.live-id-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.hud-copy-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.hud-copy-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Token stats styling */
.hud-token-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hud-token-total {
    font-size: 0.9rem;
    font-weight: 700;
}

.hud-token-subrow {
    display: flex;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: #94a3b8;
}

/* Multimodal Progress Bar */
.modality-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.modality-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    display: flex;
    overflow: hidden;
}

.modality-segment {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-segment {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    box-shadow: 0 0 6px rgba(14, 165, 233, 0.4);
}

.audio-segment {
    background: linear-gradient(90deg, #c084fc, #a855f7);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
}

.modality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #64748b;
}

.text-label {
    color: #38bdf8;
}

.audio-label {
    color: #c084fc;
}

/* Responsive grid for HUD */
@media (max-width: 1200px) {
    .hud-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hud-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   🎙️ ASR COMPARE PANEL STYLES (Added for Multi-Engine Speech-to-Text Comparison)
   ========================================================================== */

.asr-compare-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.asr-compare-panel:hover {
    border-color: rgba(0, 240, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.03);
}

.asr-compare-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: var(--font-header);
    letter-spacing: 0.5px;
}

.asr-compare-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--neon-blue);
}

.asr-compare-panel.collapsed {
    border-color: rgba(255, 255, 255, 0.03);
}

.asr-compare-caret {
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.asr-compare-panel:not(.collapsed) .asr-compare-caret {
    transform: rotate(90deg);
    color: var(--neon-blue);
}

.asr-compare-body {
    padding: 14px;
    animation: fade-in-asr 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-in-asr {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.asr-engine-selectors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.asr-compare-run-btn {
    font-size: 0.75rem !important;
    padding: 5px 12px !important;
    border-radius: 4px !important;
    margin-left: auto;
    font-weight: 600;
}

/* Custom Checkbox Container */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 22px;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    user-select: none;
    transition: color 0.2s;
}

.checkbox-container:hover {
    color: #f1f5f9;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 14px;
    width: 14px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: rgba(0, 240, 255, 0.4);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 7px;
    border: solid #030712;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

/* Results section */
.asr-compare-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asr-result-row {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.asr-result-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.asr-result-row.gemini-row:hover {
    border-color: rgba(168, 85, 247, 0.2);
}

.asr-result-row.chirp3-row:hover {
    border-color: rgba(0, 240, 255, 0.2);
}

.asr-result-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.gemini-row .asr-result-label {
    color: #c084fc;
}

.chirp3-row .asr-result-label {
    color: #22d3ee;
}

.asr-result-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
    word-break: break-all;
}

.no-result {
    color: #475569;
    font-style: italic;
    font-size: 0.75rem;
}

.error-text {
    color: #ef4444;
}

/* 🎨 Character Alignment Highlights */
.diff-match {
    color: #e2e8f0; /* Default text color, clean layout */
}

.diff-sub {
    color: #fbbf24; /* Amber/gold */
    text-decoration: underline dashed #f59e0b;
    text-underline-offset: 4px;
    cursor: help;
    background: rgba(251, 191, 36, 0.06);
    padding: 1px 2px;
    border-radius: 2px;
}

.diff-ins {
    color: #06b6d4; /* Cyan */
    text-decoration: underline #0891b2;
    text-underline-offset: 4px;
    background: rgba(6, 182, 212, 0.06);
    padding: 1px 2px;
    border-radius: 2px;
}

.diff-del {
    color: #f87171; /* Coral/red */
    text-decoration: line-through #ef4444;
    opacity: 0.8;
    background: rgba(248, 113, 113, 0.06);
    padding: 1px 2px;
    border-radius: 2px;
}

/* 🌀 Premium Shimmer Loader */
.shimmer-loader {
    height: 14px;
    width: 80%;
    max-width: 300px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: shimmer-animation 1.5s infinite linear;
    margin-top: 4px;
}

@keyframes shimmer-animation {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 🏷️ Glowing ASR Result Similarity Badges */
.asr-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    width: 100%;
}

.asr-match-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.asr-match-badge.match-perfect {
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.asr-match-badge.match-high {
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.asr-match-badge.match-low {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

.asr-match-badge.match-recovered {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}


/* ==========================================================================
   🧠 Vertex AI Long-Term Memory Bank Premium Styles
   ========================================================================== */

/* --- Sidebar Tabs Switcher --- */
.sidebar-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #8a8d93;
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

#btn-tab-sessions.active {
    color: #ffffff;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
    font-weight: 600;
}

#btn-tab-memories.active {
    color: #ffffff;
    background: rgba(188, 52, 250, 0.1);
    border: 1px solid rgba(188, 52, 250, 0.25);
    box-shadow: 0 0 12px rgba(188, 52, 250, 0.12);
    font-weight: 600;
}

.sidebar-memory-info {
    padding: 14px;
    background: rgba(188, 52, 250, 0.02);
    border: 1px dashed rgba(188, 52, 250, 0.15);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 15px;
}

.sidebar-memory-info code {
    font-family: var(--font-mono);
    color: var(--neon-purple);
    background: rgba(188, 52, 250, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
}

/* --- Memory Bank View --- */
.memory-bank-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fade-in-dashboard 0.35s ease-out;
}

.memory-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.memory-title-info .title-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
}

.memory-title-info h2 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 4px 0 0 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* --- Search Controls --- */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 380px;
    min-width: 240px;
}

.search-container input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(188, 52, 250, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-container input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px var(--neon-purple-glow), inset 0 2px 4px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    color: rgba(188, 52, 250, 0.6);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-container .clear-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-container .clear-btn:hover {
    color: #ffffff;
}

/* --- Memory Stats HUD Card --- */
.memory-stats-hud {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(18, 18, 32, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.memory-stats-hud .stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.memory-stats-hud .stat-label {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.75px;
}

.memory-stats-hud .stat-value {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
}

.text-glow-blue {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue-glow);
}

.text-glow-purple {
    color: var(--neon-purple);
    text-shadow: 0 0 8px var(--neon-purple-glow);
}

.text-glow-green {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green-glow);
}

/* --- Memory Cards Grid --- */
.memory-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.memory-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: rgba(18, 18, 32, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--neon-purple);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(188, 52, 250, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.memory-card:hover {
    transform: translateY(-3px);
    border-color: rgba(188, 52, 250, 0.25);
    border-left-color: var(--neon-purple);
    box-shadow: 0 8px 24px rgba(188, 52, 250, 0.12);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.memory-card-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(188, 52, 250, 0.08);
    border: 1px solid rgba(188, 52, 250, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--neon-purple);
    flex-shrink: 0;
}

.memory-card-delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.memory-card-delete-btn:hover {
    background: rgba(255, 51, 102, 0.12);
    color: var(--neon-red);
    border: 1px solid rgba(255, 51, 102, 0.2);
    box-shadow: 0 0 6px var(--neon-red-glow);
}

.memory-card-body {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.45;
    font-weight: 400;
    word-break: break-word;
}

.memory-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.68rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 8px;
}

.memory-card-time {
    font-family: var(--font-mono);
}

.memory-card-type-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #64748b;
}

/* --- Deletion Graceful Fade Out Keyframes --- */
.memory-card.deleting {
    animation: fadeOutExit 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

@keyframes fadeOutExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    40% {
        opacity: 0.5;
        transform: translateY(-6px) scale(0.96);
        background: rgba(255, 51, 102, 0.06);
        border-color: rgba(255, 51, 102, 0.2);
        border-left-color: var(--neon-red);
        box-shadow: 0 0 12px var(--neon-red-glow);
    }
    100% {
        opacity: 0;
        transform: translateY(-16px) scale(0.92);
        margin-bottom: -100px;
    }
}

/* --- Empty/Zero State Styling --- */
.memory-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.005);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.memory-empty-state .empty-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    opacity: 0.3;
    animation: pulseHeartbeat 2.2s infinite ease-in-out;
}

.memory-empty-state h4 {
    font-family: var(--font-header);
    font-size: 1rem;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.memory-empty-state p {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #64748b;
    max-width: 280px;
    margin: 0;
    line-height: 1.45;
}

@keyframes pulseHeartbeat {
    0%, 100% { transform: scale(1); opacity: 0.25; }
    50% { transform: scale(1.06); opacity: 0.45; }
}

/* --- 🎙️ Batch ASR Button Loader & Spinning Animations --- */
.btn-batch-asr {
    padding: 0.45rem 1.15rem !important;
    font-size: 0.8rem !important;
    background: linear-gradient(135deg, var(--neon-blue) 0%, #00bcff 100%) !important;
    color: #030712 !important;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25) !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-batch-asr:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5) !important;
    transform: translateY(-1px) scale(1.02);
}

.btn-batch-asr.loading {
    pointer-events: none !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #64748b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: btn-spin-kf 0.8s linear infinite;
    margin-right: 6px;
}

@keyframes btn-spin-kf {
    to { transform: rotate(360deg); }
}

/* Elegant glassmorphic styles for text-only chat blocks in the timeline */
.audio-block.text-only-block {
    background: rgba(15, 23, 42, 0.45);
    border-style: dashed;
    border-width: 1px;
}

.audio-block.text-only-block.input {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.02);
}

.audio-block.text-only-block.input:hover {
    border-color: rgba(0, 240, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
}

.audio-block.text-only-block.output {
    border-color: rgba(188, 52, 250, 0.4);
    box-shadow: 0 4px 15px rgba(188, 52, 250, 0.02);
}

.audio-block.text-only-block.output:hover {
    border-color: rgba(188, 52, 250, 0.8);
    box-shadow: 0 0 15px rgba(188, 52, 250, 0.08);
}

.audio-block.text-only-block .audio-transcription {
    margin-top: 0.5rem;
    border: none;
    background: transparent;
    padding: 0;
}

.audio-block.text-only-block .transcription-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.audio-block.text-only-block .transcription-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #f1f5f9;
    padding: 0 8px;
    white-space: pre-wrap;
    word-break: break-word;
}