/* ==========================================================================
   CA STUDY LOUNGE — Ultra-Modern High-Contrast Dark Theme
   Zero External Assets | Pure CSS & Native Browser Capabilities
   ========================================================================== */

:root {
  --bg-darkest: #070a12;
  --bg-darker: #0d121f;
  --bg-card: #131a2c;
  --bg-card-hover: #1a233a;
  --bg-elevated: #1f2a44;
  --border-subtle: #24304e;
  --border-strong: #33446c;
  
  --emerald-glow: #10b981;
  --emerald-dark: #065f46;
  --purple-final: #a855f7;
  --blue-inter: #38bdf8;
  --amber-warning: #f59e0b;
  --rose-danger: #f43f5e;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-glow-emerald: 0 0 18px rgba(16, 185, 129, 0.55), 0 0 0 2px rgba(16, 185, 129, 0.8);
  --shadow-glow-amber: 0 0 16px rgba(245, 158, 11, 0.45), 0 0 0 2px rgba(245, 158, 11, 0.7);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-darkest);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.app-header {
  height: 64px;
  background: rgba(13, 18, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981 0%, #0284c7 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--emerald-glow);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

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

.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 12px;
  color: #fbbf24;
}

.hours-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 12px;
  color: #38bdf8;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
  overflow: hidden;
}

.user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Level Badges
   ========================================================================== */
.level-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
}

.level-final {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
}

.level-inter {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.level-foundation {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.level-spom {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

/* ==========================================================================
   Lobby & Filtering
   ========================================================================== */
.lobby-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1;
}

.lobby-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.lobby-hero-text h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.lobby-hero-text p {
  color: var(--text-muted);
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

/* Filter Bar */
.filter-bar {
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  min-width: 60px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.filter-pill.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald-glow);
  color: #34d399;
  font-weight: 600;
}

/* Room Cards Grid */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.room-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.room-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.room-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.mode-discussion {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mode-pomodoro {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mode-qa {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.room-subject-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.room-doubt-preview {
  background: rgba(7, 10, 18, 0.6);
  border-left: 3px solid var(--emerald-glow);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: #cbd5e1;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.room-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: auto;
}

.seat-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.seat-counter.full {
  color: var(--rose-danger);
}

.seat-dots {
  display: flex;
  gap: 3px;
}

.seat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #334155;
}

.seat-dot.filled {
  background: var(--emerald-glow);
}

.seat-dot.ghost {
  background: var(--amber-warning);
}

/* ==========================================================================
   In-Room Stage Layout
   ========================================================================== */
.room-stage-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
  position: relative;
}

/* Sticky Pinned Doubt Banner */
.pinned-doubt-banner {
  background: linear-gradient(90deg, #131a2c 0%, #162238 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
}

.pinned-doubt-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.pinned-icon {
  font-size: 18px;
}

.pinned-text {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-ref {
  font-size: 11px;
  color: var(--emerald-glow);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.scratchpad-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Pomodoro Bar */
.pomodoro-bar {
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pomodoro-phase-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.pomodoro-focus {
  color: var(--emerald-glow);
}

.pomodoro-break {
  color: var(--amber-warning);
}

.pomodoro-timer {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: white;
}

.pomodoro-lock-notice {
  font-size: 11px;
  font-weight: 600;
  color: var(--rose-danger);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Stage Main Split (Audio Stage + Chat) */
.stage-split {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.stage-audio-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

/* Participant Grid */
.participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: auto 0;
  max-width: 900px;
  width: 100%;
  align-self: center;
}

.participant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: all 0.2s ease;
}

.participant-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.participant-avatar-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  background: #334155;
}

/* Emerald Voice Glow Ring */
.participant-avatar-wrap.speaking {
  box-shadow: var(--shadow-glow-emerald);
  border-color: var(--emerald-glow);
  transform: scale(1.04);
}

/* Amber Ghost Seat Ring */
.participant-avatar-wrap.ghost {
  box-shadow: var(--shadow-glow-amber);
  border-color: var(--amber-warning);
  opacity: 0.75;
}

.ghost-badge {
  position: absolute;
  bottom: -4px;
  background: var(--amber-warning);
  color: black;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.mic-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #1e293b;
  border: 1px solid var(--border-strong);
}

.mic-badge.muted {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose-danger);
  color: var(--rose-danger);
}

.mic-badge.live {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--emerald-glow);
  color: var(--emerald-glow);
}

.participant-info {
  text-align: center;
  width: 100%;
}

.participant-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Host action hover menu */
.participant-mod-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.mod-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mod-btn:hover {
  background: var(--rose-danger);
  color: white;
  border-color: var(--rose-danger);
}

/* ==========================================================================
   In-Room Live Text Chat & ICAI Citations
   ========================================================================== */
.stage-chat-panel {
  width: 340px;
  background: var(--bg-darker);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.chat-sender-name {
  font-weight: 700;
  font-size: 11px;
  color: var(--emerald-glow);
}

.chat-timestamp {
  font-size: 10px;
  color: var(--text-faint);
}

.chat-text {
  color: #e2e8f0;
  line-height: 1.45;
  word-break: break-word;
}

.chat-pin-doubt-btn {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 10px;
  cursor: pointer;
  margin-top: 4px;
  padding: 2px 4px;
}

.chat-pin-doubt-btn:hover {
  color: var(--amber-warning);
}

/* ICAI Citation Pills */
.icai-citation-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  margin: 0 2px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.icai-citation-pill:hover {
  transform: translateY(-1px);
}

.pill-sa {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
}

.pill-indas {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #38bdf8;
}

.pill-as {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid #a855f7;
  color: #c084fc;
}

.pill-sec {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.pill-exam {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid #f43f5e;
  color: #fb7185;
}

/* Chat Input & Fast Citation Chips */
.chat-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-darkest);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.citation-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: white;
  font-size: 13px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--emerald-glow);
}

.chat-send-btn {
  background: var(--emerald-glow);
  color: black;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   Bottom Controls Bar
   ========================================================================== */
.stage-controls-bar {
  height: 72px;
  background: rgba(13, 18, 31, 0.95);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 30;
}

.controls-left, .controls-center, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.control-btn.active-danger {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose-danger);
  color: #fb7185;
}

.control-btn.active-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--emerald-glow);
  color: #34d399;
}

.ptt-indicator {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}

.leave-room-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leave-room-btn:hover {
  background: var(--rose-danger);
  color: white;
}

/* ==========================================================================
   Modals & Drawers (Ambient Mixer, Scratchpad, Auth, Create Room)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-darker);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--emerald-glow);
}

/* Working Note Scratchpad Modal */
.scratchpad-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 10px;
}

.scratchpad-table th, .scratchpad-table td {
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
}

.scratchpad-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  text-align: left;
}

.scratchpad-table td.amount-col {
  text-align: right;
  font-weight: 600;
  color: #34d399;
}

.scratchpad-total-row {
  background: rgba(16, 185, 129, 0.1);
  font-weight: 800;
  border-top: 2px solid var(--emerald-glow);
}

/* Sound Mixer Drawer */
.sound-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

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

.sound-slider-name {
  font-weight: 600;
  font-size: 13px;
}

.sound-slider-val {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--emerald-glow);
}

input[type="range"] {
  accent-color: var(--emerald-glow);
  cursor: pointer;
}

/* Ghost Reconnect Toast Banner */
.ghost-reconnect-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 158, 11, 0.95);
  color: black;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 99;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.02); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Responsive */
@media (max-width: 900px) {
  .stage-split {
    flex-direction: column;
  }
  .stage-chat-panel {
    width: 100%;
    height: 250px;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .app-header {
    padding: 0 16px;
  }
}
