/* ==========================================================================
   IA.JROBOTWEB Premium CSS Design System
   ========================================================================== */

/* Color Tokens & System Defaults */
:root {
  --bg-primary: #0a0b0d;
  --bg-secondary: #111216;
  --bg-tertiary: #1b1c21;
  --card-bg: rgba(23, 25, 30, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  
  --accent-primary: #3b82f6; /* Premium Cobalt Blue */
  --accent-primary-hover: #2563eb;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

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

/* Reset & Global Rules */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: -webkit-fill-available;
  width: 100vw;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

html {
  height: 100vh;
  height: -webkit-fill-available;
}

/* Layout Framework */
.app-container {
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
  background-color: var(--bg-primary);
}

/* Sidebar Drawer Style */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: calc(1.5rem + var(--safe-top)) 1.25rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-glow {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-primary);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
}

.history-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.empty-history {
  padding: 1rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  border: 1px dashed rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  background-color: transparent;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.history-item:hover, .history-item.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.03);
}

.history-item .title-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.history-item .chat-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .delete-chat-btn {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.history-item:hover .delete-chat-btn {
  opacity: 1;
}

.history-item .delete-chat-btn:hover {
  color: var(--accent-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
  border-top: 1px solid var(--card-border);
}

/* Button Component Styles */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.25rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

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

.primary-btn:active {
  transform: scale(0.98);
}

.new-chat-btn {
  margin: 0.5rem 1rem 1rem 1rem;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
}

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

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.95);
}

.danger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
}

.danger-btn:hover {
  background-color: var(--accent-danger);
  color: #ffffff;
}

/* Main Content Layout */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Top App Header */
.app-header {
  height: calc(3.75rem + var(--safe-top));
  padding: var(--safe-top) 1.25rem 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  background-color: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.current-bot-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--card-border);
}

.bot-info h2 {
  font-size: 0.95rem;
  font-weight: 700;
}

.status-select-container {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-success);
  display: inline-block;
}

.header-model-select {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: var(--accent-success) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  outline: none !important;
  width: auto !important;
  max-width: 180px;
  font-family: var(--font-sans);
  height: auto !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border-radius: 0 !important;
}

.header-model-select:hover {
  text-decoration: underline;
}

/* Quick Role Bar Carousel */
.role-selector-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--card-border);
  background-color: rgba(10, 11, 13, 0.5);
  scrollbar-width: none; /* Hide scrollbar for clean layout */
}

.role-selector-bar::-webkit-scrollbar {
  display: none;
}

.role-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--border-radius-xl);
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.role-pill:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.role-pill.active {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-primary);
}

/* Messaging Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

/* Custom Scrollbars */
.chat-messages::-webkit-scrollbar, .sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb, .sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-xl);
}

/* Welcome Screen */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  text-align: center;
  max-width: 480px;
  padding: 2rem 1rem;
}

.welcome-logo {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #1e40af 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.welcome-container h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.welcome-container p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  text-align: left;
}

.feature-icon {
  font-size: 1.4rem;
  padding: 0.25rem;
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

.feature-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.feature-text p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 0;
}

/* Chat Messages */
.message-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.message-bubble {
  max-width: 85%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

/* User Message */
.message-wrapper.user {
  align-items: flex-end;
}

.message-wrapper.user .message-bubble {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* AI Message */
.message-wrapper.bot {
  align-items: flex-start;
}

.message-wrapper.bot .message-bubble {
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.bot-avatar-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

/* Message Image Attachments */
.message-image {
  max-width: 250px;
  max-height: 180px;
  border-radius: var(--border-radius-md);
  margin-bottom: 0.5rem;
  object-fit: cover;
  border: 1px solid var(--card-border);
}

/* Message Options Toolbar (Copy / TTS) */
.message-tools {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.message-wrapper:hover .message-tools {
  opacity: 1;
}

.tool-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
}

.tool-btn.speaking {
  color: var(--accent-primary);
  animation: pulse-audio 1.2s infinite ease-in-out;
}

@keyframes pulse-audio {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Custom Markdown styling in messages */
.message-bubble p {
  margin-bottom: 0.75rem;
}

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

.message-bubble ul, .message-bubble ol {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
}

.message-bubble li {
  margin-bottom: 0.25rem;
}

.message-bubble pre {
  background-color: #121318 !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  max-width: 100%;
}

.message-bubble code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.message-bubble pre code {
  padding: 0;
  background-color: transparent;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Floating Status Toast (for Dictation status) */
.status-toast {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 15;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: popUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-toast::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  animation: pulse-ring 1.5s infinite;
}

@keyframes popUp {
  from { transform: translate(-50%, 15px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Attachment Preview */
.attachment-preview-container {
  padding: 0.5rem 1.25rem;
  background-color: var(--bg-primary);
  display: flex;
  border-top: 1px solid var(--card-border);
}

.preview-card {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Input Command Panel */
.input-panel {
  padding: 0.75rem 1.25rem calc(0.75rem + var(--safe-bottom)) 1.25rem;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  z-index: 10;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-xl);
  padding: 0.4rem 0.5rem 0.4rem 0.8rem;
  transition: border-color var(--transition-fast);
}

.input-container:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
}

.input-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.input-action-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.mic-btn.active {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  animation: pulse-mic 1.5s infinite;
}

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

.input-container textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.45rem 0;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.input-container textarea::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

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

.send-btn:active {
  transform: scale(0.92);
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn var(--transition-normal) forwards;
}

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

.modal-card, .onboarding-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleUp var(--transition-normal) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.settings-subgroup {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--card-border);
}

.settings-subgroup label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.border-top {
  border-top: 1px solid var(--card-border);
  padding-top: 1.25rem;
}

/* Forms & Controls */
input[type="text"], input[type="password"], select {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--accent-primary);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 3rem;
}

.toggle-pass-btn {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.helper-link {
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-decoration: none;
  align-self: flex-start;
}

.helper-link:hover {
  text-decoration: underline;
}

/* Toggle Switch Control */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.slider {
  position: relative;
  width: 42px;
  height: 24px;
  background-color: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: var(--transition-fast);
}

.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-switch input:checked + .slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(18px);
  background-color: #ffffff;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Select wrapper styling for custom arrow drop */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "▼";
  font-size: 0.7rem;
  color: var(--text-secondary);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
}

/* Onboarding Specific Styles */
.onboarding-card {
  padding: 2.25rem 2rem;
  gap: 1.5rem;
}

.onboarding-splash {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-container {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.logo-inner {
  font-size: 2.5rem;
  font-weight: 850;
  color: white;
  font-family: var(--font-sans);
}

.onboarding-splash h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.tagline {
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

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

.onboarding-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onboarding-input-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.wide-btn {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 95;
  animation: fadeIn var(--transition-fast) forwards;
}

/* ==========================================================================
   Responsive Breakpoints & Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  /* Mobile Sidebar Toggle */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar.open + .sidebar-overlay {
    display: block;
  }
  
  /* Menu Button display */
  .menu-btn {
    display: flex;
  }
  
  .app-header {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 769px) {
  .menu-btn, .close-btn {
    display: none;
  }
}
