/* ==========================================================================
   VoxBridge · Mobile-First Ultra-Clean Realtime Translation App
   Designed specifically for mobile devices with safe-area support
   ========================================================================== */

:root {
  --bg-backdrop: #07090e;
  --bg-frame: #0e121b;
  --bg-card: #151a26;
  --bg-card-hover: #1c2233;
  --bg-elevated: #222a3d;
  --bg-input: #0a0d14;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(139, 92, 246, 0.4);
  --border-green: rgba(16, 185, 129, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090c13;

  --accent-emerald: #10b981;
  --accent-emerald-dark: #059669;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);

  --accent-violet: #8b5cf6;
  --accent-violet-dark: #6d28d9;
  --accent-violet-glow: rgba(139, 92, 246, 0.35);

  --accent-rose: #f43f5e;
  --accent-rose-dark: #e11d48;
  --accent-rose-glow: rgba(244, 63, 94, 0.35);

  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background-color: var(--bg-backdrop);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Mobile Shell & Layout
   ========================================================================== */

.mobile-body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.mobile-frame {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--bg-frame);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 481px) {
  .mobile-body {
    align-items: center;
  }
  .mobile-frame {
    height: 94vh;
    height: 94dvh;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-medium);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* ==========================================================================
   Top Header Bar
   ========================================================================== */

.app-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(8px, calc(var(--safe-top) + 4px)) 14px 8px 14px;
  background: rgba(14, 18, 27, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
  gap: 8px;
}

.topbar-status-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

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

.status-dot.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 1.5s infinite;
}

.status-dot.connecting {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.status-dot.error {
  background: var(--accent-rose);
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.session-timer {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.device-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.device-pill:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.12);
}

.device-icon {
  font-size: 0.9rem;
}

.device-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-topbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-topbar:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.12);
}

.btn-topbar.btn-ai {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-accent);
  color: #c4b5fd;
  font-weight: 600;
}

.btn-topbar.btn-ai:active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.3));
}

/* ==========================================================================
   Dialogue Main Scrollable Stream
   ========================================================================== */

.dialogue-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* Custom minimal scrollbar */
.dialogue-main::-webkit-scrollbar {
  width: 4px;
}
.dialogue-main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Empty State */
.dialogue-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  max-width: 340px;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.empty-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Dialogue Bubbles */
.dialogue-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialogue-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: bubbleAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.bubble-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-direction-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.bubble-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bubble-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bubble-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bubble-btn:active {
  transform: scale(0.93);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.bubble-source {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.bubble-target {
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  word-break: break-word;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Live Active Streaming Bubble */
.live-active-bubble {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid var(--border-green);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
  animation: pulseLiveCard 2.5s infinite;
}

@keyframes pulseLiveCard {
  0% { border-color: rgba(16, 185, 129, 0.3); }
  50% { border-color: rgba(16, 185, 129, 0.6); }
  100% { border-color: rgba(16, 185, 129, 0.3); }
}

.live-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: liveBlink 1s infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.live-status-text {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.live-lang-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.live-source-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.4;
  min-height: 20px;
}

.live-arrow-divider {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-violet);
  margin: 2px 0;
}

.live-target-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
  min-height: 24px;
}

/* ==========================================================================
   Bottom Control Dock (Thumb Ergonomics)
   ========================================================================== */

.app-bottom-dock {
  flex-shrink: 0;
  background: rgba(14, 18, 27, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 14px max(12px, calc(var(--safe-bottom) + 8px)) 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

/* 1. Audio Routing Mode Bar */
.audio-mode-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-btn:active {
  transform: scale(0.97);
}

.mode-btn.active {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.mode-btn.active#modeBtnSplit {
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.mode-btn.active#modeBtnEarphone {
  border-color: rgba(6, 182, 212, 0.4);
  color: #67e8f9;
}

.mode-btn.active#modeBtnSpeaker {
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.mode-icon {
  font-size: 0.9rem;
}

/* 2. Dual-Language Quick Switcher */
.lang-switcher-card {
  width: 100%;
}

.lang-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-pill {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-pill:active {
  transform: scale(0.97);
}

.lang-pill.active-target {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  border-color: var(--accent-violet);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.pill-top {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.pill-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.pill-name {
  font-size: 0.88rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.lang-pill.active-target .pill-role {
  color: var(--accent-cyan);
  font-weight: 600;
}

.lang-swap-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.lang-swap-btn:active {
  transform: scale(0.9) rotate(180deg);
  background: rgba(255, 255, 255, 0.1);
}

.btn-more-langs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  height: 48px;
  transition: var(--transition-fast);
}

.btn-more-langs:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.1);
}

.more-icon {
  font-size: 1.1rem;
}

.more-text {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* 3. Big Central Start/Stop Action Button */
.action-btn-area {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
}

.action-wave-wrapper {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-wave-wrapper.active {
  opacity: 1;
}

.action-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  border: 2px solid var(--accent-emerald);
  animation: waveRingAnim 2s infinite ease-out;
}

.action-ring.ring-2 {
  animation-delay: 1s;
}

@keyframes waveRingAnim {
  0% { transform: scale(0.96); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 0; }
}

.btn-main-action {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-emerald-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 2;
}

.btn-main-action:active {
  transform: scale(0.97);
}

.btn-main-action.active {
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-rose-dark));
  box-shadow: 0 4px 20px var(--accent-rose-glow);
}

.main-action-icon {
  font-size: 1.25rem;
}

/* ==========================================================================
   Bottom Sheets (Mobile Drawers)
   ========================================================================== */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  max-height: 85dvh;
  background: var(--bg-frame);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: max(16px, var(--safe-bottom));
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  margin: 10px auto 4px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-title-icon {
  font-size: 1.2rem;
}

.sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sheet-close-btn:active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sheet-body {
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   AI Sheet Elements
   ========================================================================== */

.task-chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.task-chips-container::-webkit-scrollbar {
  display: none;
}

.task-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.task-chip:active {
  transform: scale(0.95);
}

.task-chip.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.2));
  border-color: var(--accent-violet);
  color: #c4b5fd;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.custom-prompt-row {
  display: flex;
  gap: 8px;
}

.custom-prompt-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.custom-prompt-input:focus {
  border-color: var(--accent-violet);
}

.btn-run-custom {
  background: var(--accent-violet);
  border: none;
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.btn-run-custom:active {
  transform: scale(0.95);
  background: var(--accent-violet-dark);
}

.transcript-preview-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.transcript-preview-summary {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.transcript-edit-area {
  width: 100%;
  background: var(--bg-input);
  border: none;
  border-top: 1px solid var(--border-subtle);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  font-family: var(--font-sans);
}

.ai-result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.ai-task-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-violet);
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-violet);
}

.btn-copy-result {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-result:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.16);
}

.ai-result-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-empty-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  gap: 8px;
}

.prompt-icon {
  font-size: 1.8rem;
}

/* Markdown Rendering in AI Sheet */
.ai-result-content h1,
.ai-result-content h2,
.ai-result-content h3 {
  color: #fff;
  margin: 12px 0 6px 0;
  font-weight: 700;
}
.ai-result-content h1 { font-size: 1.15rem; }
.ai-result-content h2 { font-size: 1.05rem; }
.ai-result-content h3 { font-size: 0.95rem; }
.ai-result-content p { margin-bottom: 8px; }
.ai-result-content ul,
.ai-result-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.ai-result-content li { margin-bottom: 4px; }
.ai-result-content strong { color: #fff; font-weight: 600; }
.ai-result-content code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.8em;
  color: #a7f3d0;
}

/* Loading Shimmer in AI Sheet */
.ai-loading-state {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.ai-shimmer-line {
  height: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.5s infinite;
  border-radius: 6px;
}

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

/* ==========================================================================
   Device Settings Sheet Elements
   ========================================================================= */

.device-status-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.status-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sink-support-tag {
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

.split-info-card {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.split-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 6px;
}

.split-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.device-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mobile-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.btn-sheet-confirm {
  width: 100%;
  background: var(--accent-emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 4px;
}

.btn-sheet-confirm:active {
  transform: scale(0.97);
  background: var(--accent-emerald-dark);
}

/* ==========================================================================
   Languages Grid Sheet Elements
   ========================================================================== */

.lang-slot-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.slot-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.slot-tab.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-violet);
  color: #fff;
  font-weight: 600;
}

.languages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lang-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.lang-select-card:active {
  transform: scale(0.96);
  background: var(--bg-card-hover);
}

.lang-select-card.selected {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.card-flag {
  font-size: 1.4rem;
  line-height: 1;
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-native {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.card-en {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notification Hub
   ========================================================================== */

.toast-container {
  position: fixed;
  top: max(16px, calc(var(--safe-top) + 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: rgba(22, 27, 38, 0.96);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.toast-success {
  border-color: var(--accent-emerald);
}

.toast.toast-error {
  border-color: var(--accent-rose);
}

.toast.toast-info {
  border-color: var(--accent-violet);
}

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