/* ============================================
   AIPhonceCaller.in — AI Voice Agent Platform
   Premium Dark Theme with Glassmorphism
   ============================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Colors */
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.6);
  --bg-card-hover: rgba(36, 36, 62, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  --text-primary: #f0f0f8;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8e;
  --text-accent: #c4b5fd;

  --accent-1: #7c3aed;
  --accent-2: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --accent-gradient-hover: linear-gradient(135deg, #8b5cf6, #22d3ee);
  --accent-glow: 0 0 30px rgba(124, 58, 237, 0.3), 0 0 60px rgba(6, 182, 212, 0.15);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(124, 58, 237, 0.3);

  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: ambientShift 20s ease-in-out infinite;
}

@keyframes ambientShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -1%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

/* ── Header ── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--accent-glow);
}

.logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  transition: background var(--transition-normal);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ── Main Layout ── */
#app-main {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* ── Panels ── */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--accent-gradient);
  opacity: 0;
  z-index: -1;
  filter: blur(12px);
  transition: opacity var(--transition-normal);
}

.btn-glow:hover::after {
  opacity: 0.5;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ── Agent List ── */
.agent-list {
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.agent-list::-webkit-scrollbar {
  width: 4px;
}

.agent-list::-webkit-scrollbar-track {
  background: transparent;
}

.agent-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.agent-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.agent-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-glass-hover);
}

.agent-card:hover::before {
  opacity: 0.03;
}

.agent-card.active {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.08);
}

.agent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.agent-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.agent-card-visibility {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  flex-shrink: 0;
}

.agent-card-visibility.public {
  background: rgba(34, 197, 94, 0.15);
  color: #9ee6bb;
}

.agent-card-visibility.private {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd588;
}

.agent-card-meta {
  font-size: 0.75rem;
  color: var(--text-accent);
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.agent-public-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.agent-public-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.agent-card-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.agent-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.agent-card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 60px;
  text-align: center;
}

.empty-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* ── Agent Form ── */
.agent-form-container {
  padding: 24px;
  height: 100%;
  overflow-y: auto;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.form-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-select {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

::placeholder {
  color: var(--text-muted);
}

/* Voice Selection Grid */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.voice-option {
  position: relative;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-option:hover {
  border-color: var(--border-accent);
  background: var(--bg-glass-hover);
}

.voice-option.selected {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 0 0 1px var(--accent-1);
}

.voice-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.voice-option-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.voice-option-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.voice-option.selected .voice-option-name {
  color: var(--text-accent);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ── Call Panel ── */
.call-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.call-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.call-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.call-model-badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-2);
  font-weight: 500;
  white-space: nowrap;
}

/* Split layout: waveform left, transcript right */
.call-body-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}

.call-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 20px;
  border-right: 1px solid var(--border-color);
}

.call-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Waveform Visualizer */
.visualizer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#waveform-canvas {
  width: 320px;
  height: 160px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.call-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.call-status.active {
  color: var(--success);
}

.call-status.connecting {
  color: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.call-timer {
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.call-voice-info {
  display: flex;
  justify-content: center;
}

.voice-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--text-accent);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Call Control Buttons */
.call-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-call {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-mute {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-mute:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
}

.btn-mute.muted {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn-phone {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.btn-phone:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(34, 197, 94, 0.5);
}

.btn-phone.active {
  background: var(--danger);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  animation: phonePulse 2s ease-in-out infinite;
}

.btn-phone.active:hover {
  box-shadow: 0 6px 30px rgba(239, 68, 68, 0.5);
}

@keyframes phonePulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.6); }
}

/* ── Transcript Panel ── */
.transcript-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transcript-body::-webkit-scrollbar {
  width: 4px;
}

.transcript-body::-webkit-scrollbar-track {
  background: transparent;
}

.transcript-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.transcript-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 40px;
  line-height: 1.6;
}

.transcript-msg {
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.25s ease-out;
}

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

.transcript-msg.user {
  align-items: flex-end;
}

.transcript-msg.model {
  align-items: flex-start;
}

.transcript-role {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  padding: 0 8px;
}

.transcript-msg.user .transcript-role {
  color: var(--accent-2);
}

.transcript-msg.model .transcript-role {
  color: var(--text-accent);
}

.transcript-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}

.transcript-msg.user .transcript-bubble {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.15);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.transcript-msg.model .transcript-bubble {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.15);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.transcript-time {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 8px;
}

/* ── Debug Log Panel ── */
.debug-log-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.debug-log-body {
  height: 170px;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-log-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.debug-log-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.74rem;
  line-height: 1.4;
}

.debug-log-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.debug-log-message {
  color: var(--text-secondary);
  word-break: break-word;
}

.debug-log-item.error .debug-log-message {
  color: #fca5a5;
}

.debug-log-item.warn .debug-log-message {
  color: #fcd34d;
}

.debug-log-item.info .debug-log-message {
  color: var(--text-secondary);
}

/* ── Loading Skeleton ── */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-card {
  height: 90px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg,
    var(--bg-glass) 25%,
    rgba(255, 255, 255, 0.05) 37%,
    var(--bg-glass) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

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

/* Empty agent list */
.agent-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease-out;
  max-width: 360px;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ── Utility ── */
.hidden {
  display: none !important;
}

/* ── Responsive ── */

/* Tablet & Large Mobile (max-width: 1024px) */
@media (max-width: 1024px) {
  #app-main {
    grid-template-columns: 320px 1fr;
    padding: 20px;
    gap: 20px;
  }
}

/* Tablets (max-width: 900px) */
@media (max-width: 900px) {
  #app-main {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .agent-panel {
    max-height: none;
    order: 2;
  }

  .detail-panel {
    order: 1;
    min-height: 500px;
  }

  .agent-list {
    max-height: 400px;
  }

  .header-content {
    padding: 0 16px;
  }

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

  .call-body-split {
    grid-template-columns: 1fr;
  }

  .call-left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 24px 16px;
  }

  .call-right {
    min-height: 300px;
  }

  .debug-log-body {
    height: 140px;
  }
}

/* Mobile (max-width: 640px) */
@media (max-width: 640px) {
  .logo h1 {
    font-size: 1.1rem;
  }

  .panel-header {
    padding: 16px 20px;
  }

  .panel-header h2 {
    font-size: 1rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-icon {
    width: 80px;
    height: 80px;
  }

  .agent-form-container {
    padding: 16px;
  }

  .call-header {
    padding: 12px 16px;
  }

  .call-header h2 {
    font-size: 1rem;
  }

  .visualizer-container {
    width: 100%;
  }

  #waveform-canvas {
    width: 100%;
    max-width: 320px;
    height: 140px;
  }

  .call-timer {
    font-size: 1.5rem;
  }

  .btn-phone {
    width: 56px;
    height: 56px;
  }

  .btn-mute {
    width: 48px;
    height: 48px;
  }
}

/* Small Mobile (max-width: 400px) */
@media (max-width: 400px) {
  .header-status span {
    display: none;
  }

  .btn-sm-text-hidden span {
    display: none;
  }

  #waveform-canvas {
    max-width: 280px;
  }

  .voice-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
}
