/* ============================================================
   同声传译面板 - 深色科技感主题样式
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color Palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1e2742;
  --bg-input: #0f1624;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-blue-subtle: rgba(59, 130, 246, 0.1);
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-dim: #334155;

  --border-color: #1e293b;
  --border-active: #3b82f6;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Subtle grid background */
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- App Layout ---------- */
#app {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--gap-md);
  gap: var(--gap-md);
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px var(--accent-blue-glow));
}

.title {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition-normal);
}
.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse-dot 2s infinite;
}
.status-dot.connecting {
  background: var(--accent-orange);
  animation: pulse-dot 1s infinite;
}
.status-dot.error {
  background: var(--accent-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ---------- Settings Bar ---------- */
.settings-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-md);
  padding: var(--gap-md) var(--gap-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  min-width: 130px;
  flex: 1;
}

.setting-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.setting-input,
.setting-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: var(--gap-sm) var(--gap-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.setting-input:focus,
.setting-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-subtle);
}

.setting-input::placeholder {
  color: var(--text-dim);
}

.setting-select {
  cursor: pointer;
  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='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: background var(--transition-fast);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translate(20px, -50%);
  background: white;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  padding: var(--gap-sm) var(--gap-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex: 1;
  justify-content: center;
}

.mode-btn svg {
  width: 14px;
  height: 14px;
}

.mode-btn.active {
  background: var(--accent-blue);
  color: white;
  font-weight: 600;
}

.mode-btn:not(.active):hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

/* ---------- Transcript Area ---------- */
.transcript-area {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
}

.panel-divider { display: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.panel-lang {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 1px;
}

.source-lang {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}
.target-lang {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-lg);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.placeholder-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: var(--gap-xl);
  opacity: 0.7;
}

.panel-footer {
  padding: var(--gap-sm) var(--gap-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
}

.timestamp {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Chat Bubbles */
.chat-row {
  display: flex;
  animation: slideInLine 0.2s ease;
}

.chat-row.source { justify-content: flex-end; }
.chat-row.target { justify-content: flex-start; }

.chat-bubble {
  max-width: 72%;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.6;
  word-break: break-word;
}

.chat-row.source .chat-bubble {
  background: rgba(59, 130, 246, 0.15);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.chat-row.target .chat-bubble {
  background: rgba(6, 182, 212, 0.12);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.chat-row.source.interim .chat-bubble {
  opacity: 0.6;
  font-style: italic;
}
.chat-row.target.interim .chat-bubble {
  opacity: 0.6;
  font-style: italic;
}

@keyframes slideInLine {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.control-group {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.control-group.center {
  gap: var(--gap-sm);
}

.control-group.right {
  gap: var(--gap-sm);
}

.control-group.left {
  gap: var(--gap-md);
}

/* Mic Button */
.mic-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  background: var(--accent-blue-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  outline: none;
}

.mic-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-glow-blue);
  transform: scale(1.05);
}

.mic-btn.recording {
  background: var(--accent-red);
  border-color: var(--accent-red);
  animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-icon-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  opacity: 0;
  transition: all var(--transition-normal);
}

.mic-btn.recording .mic-icon-ring {
  opacity: 1;
  animation: ring-expand 1.5s infinite;
}

@keyframes ring-expand {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.mic-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-blue);
  transition: color var(--transition-normal);
}

.mic-btn.recording .mic-icon {
  color: white;
}

.mic-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 140px;
  line-height: 1.4;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: var(--shadow-glow-blue);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  gap: 4px;
}
.btn-sm svg { width: 12px; height: 12px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

/* Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-xs) var(--gap-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.audio-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--accent-blue);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.audio-toggle svg {
  width: 14px;
  height: 14px;
}

.audio-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow-blue);
}

.audio-waveform {
  flex: 1;
  overflow: hidden;
}

#waveCanvas {
  display: block;
}

/* ---------- Audio Visualizer ---------- */
.audio-viz {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

#vizCanvas {
  width: 100%;
  height: 100%;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-md) var(--gap-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 0.85rem;
  color: var(--text-primary);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--accent-green);
}

.toast.error {
  border-left: 3px solid var(--accent-red);
}

.toast.warning {
  border-left: 3px solid var(--accent-orange);
}

.toast.info {
  border-left: 3px solid var(--accent-blue);
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-green); }
.toast.error .toast-icon { color: var(--accent-red); }
.toast.warning .toast-icon { color: var(--accent-orange); }
.toast.info .toast-icon { color: var(--accent-blue); }

.toast-message {
  flex: 1;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.speaking {
  color: var(--accent-green) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .transcript-area {
    flex-direction: column;
  }

  .panel-divider {
    display: none;
  }

  .settings-bar {
    overflow-y: auto;
    max-height: 160px;
  }

  .mic-hint {
    display: none;
  }
}

@media (max-width: 600px) {
  #app {
    padding: var(--gap-sm);
  }

  .header {
    padding: var(--gap-sm) var(--gap-md);
  }

  .title {
    font-size: 1.1rem;
  }

  .subtitle {
    display: none;
  }

  .settings-bar {
    flex-direction: column;
  }

  .setting-group {
    min-width: unset;
  }

  .controls {
    flex-wrap: wrap;
    gap: var(--gap-sm);
  }

  .control-group {
    flex: 1;
    min-width: 100px;
  }

  .mic-btn {
    width: 52px;
    height: 52px;
  }
}

/* Char-by-char animation */
@keyframes charFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.char-new {
  display: inline;
  animation: charFadeIn 0.15s ease forwards;
}

/* ---------- Token Usage Bar ---------- */
.usage-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 14px;
  background: var(--bg-input);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 0.3s ease;
  font-family: var(--font-mono);
}

.usage-bar.has-data {
  opacity: 1;
}

.usage-item {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
}

.usage-item svg {
  flex-shrink: 0;
  color: var(--accent-cyan);
  opacity: 0.7;
}

.usage-item.usage-total svg {
  color: var(--accent-blue);
  opacity: 1;
}

.usage-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.usage-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.usage-bar.has-data .usage-value {
  color: var(--text-primary);
}

.usage-item.usage-total .usage-value {
  color: var(--accent-blue);
}

.usage-sep {
  width: 1px;
  height: 16px;
  background: var(--border-color);
  margin: 0 10px;
  flex-shrink: 0;
}

/* ---------- Activation Key Bar ---------- */
.key-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  transition: all 0.3s ease;
}

.key-bar--collapsed {
  display: none;
}

.key-bar--verified {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.key-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
}

.key-bar-inner svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.key-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.key-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 5px 10px;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.key-input:focus {
  border-color: var(--accent-blue);
}

.key-input[readonly] {
  opacity: 0.7;
  cursor: default;
}

.key-hint {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
}

/* ---------- Activation Key Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 480px;
  width: 90%;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  text-align: center;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header svg {
  color: var(--accent-cyan);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.modal-body {
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.key-input-large {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 14px 16px;
  letter-spacing: 0.1em;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.key-input-large:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.key-hint-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 20px;
}

.btn-large {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  justify-content: center;
}

.modal-footer-text {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Key Status Chip (header) ---------- */
.key-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.key-status svg { flex-shrink: 0; }

.key-status--idle {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.key-status--loading {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.3);
}

.key-status--ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

.key-status--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}
