/* ═══════════════════════════════════════════════════
   Eric's Executive Assistant — Design System
   ═══════════════════════════════════════════════════ */

:root {
  /* Colors — Light mode */
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f7;
  --bg-sidebar: #1a1b2e;
  --bg-input: #ffffff;
  --bg-hover: #edf0f7;
  --bg-active: rgba(99, 102, 241, 0.08);
  --bg-message-user: #4f46e5;
  --bg-message-assistant: #f0f2f7;
  --bg-recording: #fee2e2;

  --text-primary: #1a1b2e;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-sidebar: #c7d2e8;
  --text-sidebar-active: #ffffff;
  --text-message-user: #ffffff;
  --text-message-assistant: #1a1b2e;
  --text-link: #4f46e5;

  --border-light: #e2e8f0;
  --border-focus: #4f46e5;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: rgba(79, 70, 229, 0.1);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 280px;

  --transition: 200ms ease;
}

/* Dark mode */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d28;
  --bg-tertiary: #252836;
  --bg-sidebar: #0d0e16;
  --bg-input: #1a1d28;
  --bg-hover: #252836;
  --bg-active: rgba(99, 102, 241, 0.15);
  --bg-message-user: #4f46e5;
  --bg-message-assistant: #1e2030;
  --bg-recording: #3b1c1c;

  --text-primary: #e8eaf0;
  --text-secondary: #8891a5;
  --text-tertiary: #5a6477;
  --text-message-assistant: #e8eaf0;
  --text-link: #818cf8;

  --border-light: #2a2d3a;
  --border-focus: #818cf8;

  --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);
}

/* ── Reset ──────────────────────────────────────────── */

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Screens ────────────────────────────────────────── */

.screen {
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* ── Login ──────────────────────────────────────────── */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1b2e 0%, #2d1b69 50%, #1a1b2e 100%);
  min-height: 100vh;
}

.login-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.logo-icon.small {
  width: 32px;
  height: 32px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.logo-icon.large {
  width: 80px;
  height: 80px;
  font-size: 28px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ── Lock Screen (soft lock) ────────────────────────── */

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.75);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  animation: lockFadeIn 0.4s ease;
}

.lock-screen.hidden {
  display: none;
}

@keyframes lockFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lock-card {
  text-align: center;
  animation: lockCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lockCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.lock-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin-top: 16px;
}

.lock-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 32px;
}

.lock-continue {
  width: 200px;
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lock-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(79, 70, 229, 0.5);
}

.lock-continue:active {
  transform: translateY(0);
}

.lock-signout {
  display: block;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  transition: color 0.15s ease;
}

.lock-signout:hover {
  color: rgba(255, 255, 255, 0.7);
}

.input-group {
  margin-bottom: 16px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

/* ── App Layout ─────────────────────────────────────── */

#app-screen {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: margin-left 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
  overflow: hidden;
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-sidebar-active);
  font-weight: 600;
  font-size: 14px;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.conv-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.conv-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.conv-delete {
  display: none;
  background: none;
  border: none;
  color: var(--text-sidebar);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0.5;
  transition: all var(--transition);
  flex-shrink: 0;
}

.conv-item:hover .conv-delete {
  display: block;
}

.conv-delete:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.conv-delete.armed {
  display: block !important;
  opacity: 1;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.2);
  font-weight: 700;
}

.conv-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sidebar-active);
}

.conv-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-sidebar-active);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-sidebar);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.btn-text:hover {
  opacity: 1;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-sidebar-active);
}

/* ── Sidebar Toggle ─────────────────────────────────── */

.sidebar-toggle {
  display: none; /* hidden when sidebar is visible */
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 100;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: opacity 200ms ease, transform 200ms ease;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

/* Show toggle when sidebar is collapsed on desktop */
.sidebar.collapsed ~ .sidebar-toggle {
  display: flex;
}

.sidebar-collapse-btn {
  color: var(--text-sidebar);
  padding: 4px;
}

.sidebar-collapse-btn:hover {
  color: var(--text-sidebar-active);
}

/* ── Chat Area ──────────────────────────────────────── */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Welcome state */
.welcome-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-content {
  text-align: center;
  max-width: 520px;
  padding: 24px;
}

.welcome-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.welcome-content p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

/* Briefing button */
.briefing-action {
  margin-bottom: 12px;
}

.quick-action.briefing {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 16px;
  text-align: center;
}

.quick-action.briefing:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  color: #fff;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-action {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.quick-action:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Service status strip */
.service-status {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  opacity: 0.6;
  font-size: 11px;
  color: var(--text-tertiary);
  transition: opacity 0.2s;
}

.service-status:hover {
  opacity: 1;
}

.service-status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.ok {
  background: #22c55e;
}

.status-dot.issue {
  background: #f59e0b;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.messages {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

.message {
  margin-bottom: 24px;
  animation: fadeInUp 300ms ease;
}

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

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.message-avatar.user {
  background: var(--accent);
  color: white;
}

.message-avatar.assistant {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
}

.message-meta {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 12px;
}

.message-content {
  padding-left: 36px;
  color: var(--text-primary);
  line-height: 1.7;
}

.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.message-content pre {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 12px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content ul, .message-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.message-content strong {
  font-weight: 600;
}

.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding-left: 36px;
  padding-top: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.typing-status {
  width: auto !important;
  height: auto !important;
  background: none !important;
  animation: none !important;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 6px;
  align-self: center;
}

/* ── Input Area ─────────────────────────────────────── */

.input-area {
  padding: 16px 24px 24px;
  background: var(--bg-primary);
}

.input-wrapper {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.model-selector select {
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}

.model-selector-pill {
  flex-shrink: 0;
}

.model-selector-pill select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 5px 24px 5px 10px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.model-selector-pill select:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-hover);
}

.model-selector-pill select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.input-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#message-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: transparent;
  resize: none;
  max-height: 150px;
  line-height: 1.5;
  padding: 6px 0;
}

#message-input::placeholder {
  color: var(--text-tertiary);
}

.input-actions {
  display: flex;
  gap: 4px;
}

.input-actions .btn-icon {
  color: var(--text-tertiary);
  padding: 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}

.input-actions .btn-icon svg,
.attach-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.attach-btn {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}

.input-actions .btn-icon:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.send-btn:not(:disabled) {
  color: var(--accent) !important;
}

.voice-btn.recording {
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ── Attachment Menu ───────────────────────────────────── */

.attach-menu-container {
  position: relative;
  flex-shrink: 0;
}

.attach-btn {
  color: var(--text-tertiary) !important;
  padding: 8px !important;
  border-radius: 50% !important;
  transition: all var(--transition);
}

.attach-btn:hover {
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
  z-index: 50;
  animation: menuSlideIn 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.attach-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.attach-option:hover {
  background: var(--bg-hover);
}

.attach-option svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── User Info (sidebar footer) ─────────────────────────── */

.user-info {
  color: var(--text-sidebar);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Attachment Chips (staged, above input) ────────────── */

.attachment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 4px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.attachment-chip.uploading {
  opacity: 0.6;
}

.attachment-chip svg { color: var(--accent); flex-shrink: 0; }

.chip-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
  transition: color var(--transition);
}
.chip-remove:hover { color: var(--danger); }

.chip-loading { font-size: 11px; }

/* ── Message Attachment Chips (in sent messages) ──────── */

.msg-attachment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 6px 44px;
}

.msg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent-light);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

.msg-chip svg { flex-shrink: 0; }

/* ── Google Link Chips (in AI responses) ──────────────── */

.google-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  text-decoration: none !important;
  color: var(--text-primary) !important;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  margin: 4px 2px;
  vertical-align: middle;
}

.google-link-chip:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(138, 103, 255, 0.15);
}

.glc-icon { font-size: 16px; flex-shrink: 0; }

.glc-label {
  color: var(--text-primary);
  font-weight: 600;
}

.glc-id {
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: var(--font-mono, monospace);
}

.glc-external {
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: 2px;
  transition: color var(--transition);
}

.google-link-chip:hover .glc-external { color: var(--accent); }

/* ── Drive Search Modal ───────────────────────────────── */

.drive-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drive-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 540px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.drive-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.drive-modal-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.drive-modal-close:hover { color: var(--text-primary); }

.drive-search-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
}

.drive-search-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.drive-search-bar input:focus { border-color: var(--accent); }

.btn-sm {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-sm:hover { filter: brightness(1.1); }

.drive-results {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
  max-height: 400px;
}

.drive-hint {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 24px;
}

.drive-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.drive-file:hover { background: var(--bg-hover); }
.drive-file.loading { opacity: 0.5; cursor: wait; }

/* Multi-select checkmark */
.drive-file-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 150ms ease;
}
.drive-file-check svg { opacity: 0; transition: opacity 150ms ease; }

.drive-file.selected .drive-file-check {
  background: var(--accent);
  border-color: var(--accent);
}
.drive-file.selected .drive-file-check svg {
  opacity: 1;
  stroke: white;
}

.drive-file.already-loaded {
  opacity: 0.4;
  cursor: default;
}
.drive-file.already-loaded .drive-file-check {
  background: var(--text-tertiary);
  border-color: var(--text-tertiary);
}
.drive-file.already-loaded .drive-file-check svg {
  opacity: 1;
  stroke: white;
}

.drive-file-icon { font-size: 20px; flex-shrink: 0; }

.drive-file-info { display: flex; flex-direction: column; min-width: 0; }

.drive-file-name {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drive-file-name small {
  color: var(--text-tertiary);
  font-weight: 400;
}

.drive-file-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Drive modal mode toggle */
.drive-modal-mode {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-light);
}

.drive-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.drive-mode-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.drive-mode-hint {
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Drive modal footer */
.drive-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

.drive-modal-footer span {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-primary {
  background: var(--accent) !important;
  color: white !important;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Deep Context Bar ─────────────────────────────────── */

.context-bar {
  padding: 0 24px;
  animation: slideDown 200ms ease;
}

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

.context-bar-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(138, 103, 255, 0.08), rgba(99, 102, 241, 0.06));
  border: 1px solid rgba(138, 103, 255, 0.2);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

.context-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.context-bar-label svg { stroke: var(--accent); }

.context-bar-count {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 11px;
}

.context-bar-docs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.context-bar-docs::-webkit-scrollbar { display: none; }

.context-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.context-doc-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
  border-radius: 50%;
  transition: color var(--transition);
}
.context-doc-remove:hover { color: var(--danger); }

.context-bar-clear {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all var(--transition);
  font-family: var(--font);
}
.context-bar-clear:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}


.recording-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--danger);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-top: 6px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.recording-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.recording-label {
  color: var(--text-secondary);
  font-style: italic;
}

#recording-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
}

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

.recording-control-btn.cancel {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.recording-control-btn.cancel:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.recording-control-btn.done {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.recording-control-btn.done:hover {
  background: rgba(34, 197, 94, 0.25);
  transform: scale(1.1);
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

/* ── Theme Toggle ───────────────────────────────────── */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0;
  cursor: pointer;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--accent);
  transform: scale(1.1);
}

/* ── Narrow desktop / Tablet ───────────────────────── */

@media (max-width: 900px) {
  .model-selector-pill { display: none; }
}

/* ── Mobile ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: left 300ms ease;
    box-shadow: var(--shadow-lg);
    width: 280px;
    margin-left: 0 !important; /* override desktop collapse */
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .sidebar.open {
    left: 0;
  }

  /* Dark overlay behind open sidebar */
  .sidebar.open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
  }

  .sidebar-toggle {
    display: flex !important; /* always show on mobile */
  }

  /* Smaller welcome logo on mobile */
  .welcome-content .message-avatar.assistant {
    width: 56px;
    height: 56px;
    font-size: 18px;
    border-radius: 14px;
  }

  .welcome-content h2 {
    font-size: 22px;
  }

  .welcome-content p {
    font-size: 14px;
  }

  /* Quick actions: 2-column on mobile */
  .quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .quick-action {
    padding: 12px;
    font-size: 13px;
  }

  /* Briefing button: full width on mobile */
  .quick-action.briefing {
    font-size: 15px;
    padding: 14px;
  }

  .messages {
    padding: 0 12px;
  }

  .message-content {
    font-size: 14px;
  }

  .input-area {
    padding: 8px 12px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .chat-input {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .model-selector-pill {
    display: none;
  }

  .input-wrapper {
    gap: 4px;
    padding: 6px 6px 6px 10px;
  }

  .input-actions {
    gap: 2px;
  }

  .input-actions .btn-icon {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
  }

  /* Floating buttons top-right on mobile */
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .bug-report-btn {
    top: 54px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  /* Service status: smaller text on mobile */
  .service-status {
    font-size: 11px;
    gap: 12px;
  }
}

/* ── Scrollbar ──────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── Sidebar Search ────────────────────────────────────── */

.sidebar-search {
  padding: 0 12px 8px;
  position: relative;
}

.sidebar-search .search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(199, 210, 232, 0.4);
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.sidebar-search input::placeholder {
  color: rgba(199, 210, 232, 0.4);
}

.sidebar-search input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

/* ── Conversation Rename ───────────────────────────────── */

.conv-rename-input {
  width: 100%;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text-sidebar-active);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}

/* ── Copy Button ───────────────────────────────────────── */

.msg-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
  margin-left: auto;
  display: flex;
  align-items: center;
}

.message:hover .msg-copy-btn {
  opacity: 1;
}

.msg-copy-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.msg-copy-btn.copied {
  color: var(--success);
  opacity: 1;
}

/* ── Markdown Rendered Content ─────────────────────────── */

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}

.message-content th,
.message-content td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--border-light);
}

.message-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}

.message-content tr:hover td {
  background: var(--bg-hover);
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.3;
}

.message-content h1 { font-size: 1.3em; }
.message-content h2 { font-size: 1.15em; }
.message-content h3 { font-size: 1.05em; }
.message-content h4 { font-size: 0.95em; color: var(--text-secondary); }

.message-content pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
}

.message-content code {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.9em;
}

.message-content :not(pre) > code {
  background: var(--bg-tertiary);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

.message-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 12px 0;
  padding: 4px 16px;
  color: var(--text-secondary);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message-content ol,
.message-content ul {
  padding-left: 24px;
  margin: 8px 0;
}

.message-content li {
  margin: 4px 0;
}

.message-content a {
  color: var(--text-link);
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content p {
  margin: 6px 0;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* ── Bug Report Button ─────────────────────── */
.bug-report-btn {
  position: fixed;
  top: 64px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  opacity: 0.6;
}

.bug-report-btn:hover {
  opacity: 1;
  color: #ef4444;
  border-color: #ef4444;
  transform: scale(1.1);
}

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

[data-theme="dark"] .modal-card {
  background: #1e1e2e;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.modal-body textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

.modal-body textarea:focus {
  border-color: var(--primary);
}

.screenshot-area {
  margin-top: 12px;
}

.screenshot-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: border-color 0.2s;
}

.screenshot-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.screenshot-preview {
  margin-top: 8px;
  max-height: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  width: 100%;
}

.modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   Security Features — v1.1.0
   ═══════════════════════════════════════════════════ */

/* ── Emulation Banner ──────────────────────────────── */
.emulation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1b2e;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  animation: slideDown 300ms ease;
}

.emulation-banner .emulation-exit {
  color: #1a1b2e;
  text-decoration: underline;
  font-weight: 700;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

body.emulating #app-screen { padding-top: 40px; }
body.emulating .sidebar { top: 40px; height: calc(100vh - 40px); }

/* ── Settings Button ───────────────────────────────── */
.settings-btn {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.settings-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

/* ── Settings Modal ────────────────────────────────── */
.settings-modal-card {
  max-width: 440px;
  width: 90vw;
}

.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child { border-bottom: none; }

.settings-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.password-rules {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin: 4px 0 12px;
}

.success-text {
  color: var(--success);
  font-size: 0.82rem;
  margin-top: 8px;
}

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

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: #dc2626;
}

/* ── 2FA Status Badge ──────────────────────────────── */
.twofa-status {
  margin-bottom: 12px;
}

.twofa-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.twofa-badge.on {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.twofa-badge.off {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ── 2FA Login Screen ──────────────────────────────── */
#twofa-screen .login-card { text-align: center; }

.twofa-alt {
  margin-top: 12px;
  text-align: center;
}

/* ── 2FA Setup Modal ──────────────────────────────── */
.twofa-setup-card {
  max-width: 480px;
  width: 92vw;
}

.twofa-setup-body {
  text-align: center;
}

.twofa-setup-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.qr-wrapper {
  margin: 16px auto;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.qr-wrapper img {
  width: 200px;
  height: 200px;
}

.manual-entry {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 8px 0 16px;
}

.manual-entry code {
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--text-primary);
  user-select: all;
}

.backup-codes-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  text-align: left;
}

.backup-codes-section h5 {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.backup-codes-grid code {
  background: var(--bg-secondary);
  padding: 4px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  text-align: center;
  letter-spacing: 1px;
  border: 1px solid var(--border-light);
}

/* ── Dark mode overrides ───────────────────────────── */
[data-theme="dark"] .emulation-banner {
  color: #1a1b2e;
}

[data-theme="dark"] .qr-wrapper {
  background: white;
}

[data-theme="dark"] .backup-codes-grid code {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
