.debug-console{
  background:rgba(0,0,0,0.5);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:12px;
  margin-top:20px;
  max-height:240px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  font-size:11px;
}
.debug-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:rgba(0,0,0,0.3);
  padding:6px 10px;
}
#debug-output{
  flex:1;
  padding:8px 12px;
  overflow-y:auto;
  white-space:pre-wrap;
}
#debug-output .log      {color:#A5F3FC;}   /* cyan  */
#debug-output .warn     {color:#FBBF24;}   /* amber */
#debug-output .error    {color:#F87171;}   /* red   */
#debug-output .va       {color:#4ADE80;}   /* green */

  .voice-assistant-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-hover: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --radius: 16px;
  }

  .voice-assistant-container.expanding {
    animation: va-expand 0.3s ease forwards;
  }

  .voice-assistant-container.collapsing {
    animation: va-collapse 0.2s ease forwards;
  }

  @keyframes va-expand {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

  @keyframes va-collapse {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.6); opacity: 0; }
  }

  .voice-assistant-container * {
    box-sizing: border-box;
  }

  .voice-assistant-container.position-bottom-right {
    bottom: 24px;
    right: 24px;
  }

  .voice-assistant-container.position-bottom-left {
    bottom: 24px;
    left: 24px;
  }

  .voice-assistant-container.position-top-right {
    top: 24px;
    right: 24px;
  }

  .voice-assistant-container.position-top-left {
    top: 24px;
    left: 24px;
  }

  .voice-assistant-container.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .voice-assistant-widget {
    background: rgba(17, 17, 27, 0.9);
    backdrop-filter: blur(30px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.45);
    padding: 24px;
    width: 340px;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .voice-assistant-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  }

  .widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    transition: all 0.3s ease;
  }

  .status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: pulse 2s ease-in-out infinite;
  }

  .status-dot.listening {
    background: var(--primary);
    animation: listening-pulse 1s ease-in-out infinite;
  }

  .status-dot.talking {
    background: var(--warning);
    animation: talking-pulse 0.5s ease-in-out infinite;
  }

  .minimize-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
  }

  .minimize-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .main-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .primary-action {
    width: 100%;
    height: 56px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
  }

  .primary-action.start {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
  }

  .primary-action.start:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  }

  .primary-action.active {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
  }

  .primary-action.active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
  }

  .secondary-controls {
    display: flex;
    gap: 8px;
    justify-content: space-between;
  }

  .control-btn {
    flex: 1;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .control-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .control-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
  }

  .control-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
  }

  .control-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
  }

  .features-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }

  .feature-btn {
    flex: 1;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .feature-btn:hover {
    background: var(--surface);
    color: var(--text);
  }

  .feature-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
  }

  .feature-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  .audio-visualizer {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 16px auto 12px;
    border-radius: 50%;
    border: 2px solid var(--border);
  }

  .audio-bar {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 3px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transform-origin: center bottom;
    transition: all 0.1s ease;
  }

  .audio-bar.active {
    background: linear-gradient(to top, var(--primary), #a855f7);
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.5);
  }

  .status-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
    min-height: 18px;
  }

  .voice-assistant-minimized {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(17, 17, 27, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    color: var(--text-muted);
    font-size: 20px;
  }

  .voice-assistant-minimized:hover {
    transform: scale(1.05);
    background: rgba(17, 17, 27, 1);
    color: var(--text);
  }

  .voice-assistant-minimized.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
  }

  /* Video preview container */
  .video-preview {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000000;
    pointer-events: auto;
    display: none;
  }

  .video-preview.active {
    display: block;
  }

  .video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .video-preview .video-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
  }

  @keyframes listening-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
  }

  @keyframes talking-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.3); }
  }

  /* Light theme */
  .voice-assistant-container.theme-light {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --surface: rgba(0, 0, 0, 0.05);
    --surface-hover: rgba(0, 0, 0, 0.08);
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }

  .voice-assistant-container.theme-light .voice-assistant-widget {
    background: rgba(255, 255, 255, 0.95);
  }

  .voice-assistant-container.theme-light .voice-assistant-minimized {
    background: rgba(255, 255, 255, 0.95);
  }

  /* Mobile responsive */
  @media (max-width: 768px) {
    .voice-assistant-widget {
      width: 300px;
      padding: 18px;
    }
    
    .voice-assistant-container.position-bottom-right,
    .voice-assistant-container.position-bottom-left {
      bottom: 16px;
    }
    
    .voice-assistant-container.position-bottom-right {
      right: 16px;
    }
    
    .voice-assistant-container.position-bottom-left {
      left: 16px;
    }

    .video-preview {
      width: 120px;
      height: 90px;
    }
  }
