/* ===================================================================
   Amba AI — Master System Design System & Stylesheet
   Modern Glassmorphism, Dark Mode, Elegant Typography, Responsive
   =================================================================== */

:root {
  color-scheme: dark;
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1f293d;
  --bg-card: rgba(26, 34, 52, 0.7);
  --bg-glass: rgba(17, 24, 39, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.15);
  
  --sidebar-width: 290px;
  --header-height: 68px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  line-height: 1.6;
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  z-index: 100;
  flex-wrap: nowrap;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  transition: height 0.25s ease, padding 0.25s ease;
}

.top-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 2560px; /* Ergonomic containment on 24"-32" ultrawide displays */
  height: 100%;
  gap: 0.75rem;
  box-sizing: border-box;
}

.header-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  user-select: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.35);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.brand-tag {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* PWA Standalone Mode Indicator Badge */
.pwa-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.pwa-mode-badge i {
  font-size: 0.72rem;
  color: #10b981;
}

/* Header Center: Unified Time & Session Status Hub (Clock + Stopwatch + Minutes Wallet) */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-shrink: 1;
  min-width: 0;
}

/* Docked Footer Activity Hub (Clock + Session Stopwatch + Minutes Wallet) Below Input Box */
.footer-activity-hub {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0.4rem auto 0.2rem auto;
  pointer-events: auto;
}

/* Segmented Island Capsule */
.activity-hub-capsule {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  gap: 0.45rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.22s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.activity-hub-capsule:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.2);
}

.capsule-divider {
  width: 1px;
  height: 20px;
  background: rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
}

.clock-badge,
.session-timer-badge,
.minutes-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  height: 36px;
  box-sizing: border-box;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.clock-badge:hover,
.session-timer-badge:hover,
.minutes-pill:hover {
  background: rgba(56, 189, 248, 0.08);
}

.clock-icon {
  color: var(--accent-cyan);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.clock-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.clock-time {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.clock-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.session-timer-badge {
  background: rgba(16, 185, 129, 0.08);
}

.timer-icon {
  color: var(--accent-emerald);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.session-time {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-emerald);
}

.timer-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Header Right: Voice, Speed, Language Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  position: relative;
  flex-wrap: nowrap;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.styled-select,
select.styled-select {
  color-scheme: dark !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #f8fafc !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  font-family: var(--font-body) !important;
  outline: none !important;
  cursor: pointer !important;
  border-radius: var(--radius-full) !important;
  padding: 0.25rem 0.6rem !important;
  transition: all 0.2s ease !important;
}

.styled-select:focus,
select.styled-select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35) !important;
}

.styled-select optgroup {
  color-scheme: dark !important;
  background-color: #0b1120 !important;
  color: #38bdf8 !important;
  font-family: var(--font-heading) !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.04em !important;
  padding: 0.55rem 0.75rem !important;
  border-top: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.styled-select option {
  color-scheme: dark !important;
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
  padding: 0.55rem 0.85rem !important;
}

.styled-select option:checked,
.styled-select option:hover,
.styled-select option:focus {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.slider-control {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-md);
}

.slider-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  gap: 0.4rem;
}

.slider-control label span {
  color: var(--accent-cyan);
  font-weight: 600;
}

.slider-control input[type="range"] {
  width: 75px;
  height: 4px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.icon-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.icon-btn.active {
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.4);
}

.mini-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px;
}

.mini-icon-btn:hover {
  color: var(--accent-emerald);
}

/* Main Body Layout */
.main-body {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 90;
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sidebar-top {
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-close-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
}

.new-topic-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-topic-btn:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(59, 130, 246, 0.3));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.sidebar-section {
  padding: 0.65rem 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.55rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  margin-top: 0.4rem;
}

.badge {
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.topics-section {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.topic-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border-subtle);
}

.topic-item.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.35);
}

.topic-title-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 190px;
}

.topic-item-name {
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.topic-item-step {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

.topic-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.topic-del-btn:hover {
  color: var(--accent-rose);
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.footer-action-btn:hover {
  color: var(--accent-cyan);
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

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

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Step Progress Banner (Hidden per request) */
.step-progress-banner {
  display: none !important;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.step-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  max-width: 600px;
}

.step-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topic-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.step-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.step-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.step-controls {
  display: flex;
  gap: 0.5rem;
}

.text-ctrl-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.text-ctrl-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.text-ctrl-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Chat Messages (Expansive Center Screen Canvas with 2% Side Margins) */
.chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 2% calc(140px + env(safe-area-inset-bottom, 0px)) 2%;
  width: 100%;
  max-width: 98% !important;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) rgba(15, 23, 42, 0.35);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.4);
}

/* Welcome Screen */
.welcome-screen {
  margin: 0 auto;
  text-align: center;
  max-width: 100%;
  width: 100%;
  padding: 1.8rem 1rem;
}

/* Center Screen Welcome Hero (Fills Center Canvas, Eliminates Dead Space) */
.welcome-screen.welcome-center-hero {
  margin: 0 auto;
  text-align: center;
  max-width: 100%;
  width: 100%;
  padding: 1.5rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.welcome-center-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.welcome-center-hero .welcome-sub {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0;
}

/* Center Domain Selector Pills */
.center-domain-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.center-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.center-domain-pill:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.center-domain-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.28);
}

.center-domain-pill .pill-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.center-domain-pill.active .pill-badge {
  background: rgba(6, 182, 212, 0.25);
  color: #fff;
}

/* Callout Guide Banner to Right Split-Screen */
.welcome-guide-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.8));
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-top: 0.35rem;
}

.welcome-guide-banner .banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.welcome-guide-banner .banner-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.welcome-guide-banner .banner-text strong {
  font-size: 0.96rem;
  color: #ffffff;
  font-weight: 700;
}

.welcome-guide-banner .banner-text span {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.btn-focus-panel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-focus-panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* ===================================================================
   Quick Requirement Diagnosis Card
   =================================================================== */
.quick-diagnosis-card {
  width: 100%;
  max-width: 960px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.45rem;
  margin: 1.15rem 0 1.35rem 0;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.quick-diagnosis-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #06b6d4, #10b981);
}

.diagnosis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.95rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.diagnosis-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.diagnosis-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.diagnosis-header h3 {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.diagnosis-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
  line-height: 1.35;
}

.diagnosis-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.diagnosis-group {
  display: flex;
  flex-direction: column;
}

.diagnosis-q-title {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.diagnosis-options {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.diag-chk-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.65rem;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.diag-chk-label:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(6, 182, 212, 0.3);
  color: #f8fafc;
}

.diag-chk-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  flex-shrink: 0;
}

.diag-chk-label.is-checked {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.45);
  color: #f8fafc;
  font-weight: 600;
}

.diagnosis-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.diagnosis-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.35;
  max-width: 520px;
}

.diagnosis-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-clear-diagnosis {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-clear-diagnosis:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-submit-diagnosis {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-submit-diagnosis:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .diagnosis-grid {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }
  .diagnosis-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .diagnosis-actions {
    justify-content: flex-end;
  }
}

.center-lang-cards-container {
  width: 100%;
  max-width: 960px;
  margin-top: 1rem;
  text-align: left;
}

/* ===================================================================
   Center Screen AI Related Cards Grid
   =================================================================== */
.center-ai-cards-container {
  width: 100%;
  max-width: 960px;
  margin-top: 0.65rem;
  text-align: left;
}

.center-cards-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.95rem;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.14), rgba(15, 23, 42, 0.6));
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
}

.center-cards-heading .heading-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.center-cards-heading h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.center-cards-heading .live-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.center-cards-heading .heading-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.center-ai-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  width: 100%;
}

.ai-card-item {
  position: relative;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-card-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--accent-cyan);
  transition: height 0.25s ease;
}

.ai-card-item:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.18), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ai-card-item:hover::before {
  height: 100%;
}

.ai-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-card-icon {
  font-size: 1.35rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.ai-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-card-title {
  font-family: var(--font-heading);
  font-size: 0.93rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.ai-card-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-card-action {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.2s ease;
}

.ai-card-item:hover .ai-card-action {
  transform: translateX(3px);
  color: #38bdf8;
}

@media (max-width: 1024px) {
  .center-ai-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .center-ai-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Featured Master Course Spotlight */
.featured-master-banner {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(245, 158, 11, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.featured-master-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #06b6d4);
}

.featured-master-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  align-self: flex-start;
}

.featured-master-body {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.featured-master-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(236, 72, 153, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fbbf24;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.featured-master-content {
  flex: 1;
}

.featured-master-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.featured-master-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.featured-master-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.featured-master-tags .f-tag {
  font-size: 0.74rem;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.22rem 0.58rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.featured-master-tags .f-tag i {
  color: #10b981;
  font-size: 0.68rem;
}

.featured-master-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-start-featured {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.btn-start-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* Category Showcases */
.center-category-showcase {
  width: 100%;
  max-width: 100%;
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.showcase-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.showcase-header-left i {
  font-size: 1.4rem;
}

.showcase-header-left h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.showcase-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
}

.showcase-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
  white-space: nowrap;
}

.center-cards-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.showcase-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.35rem;
}

.btn-browse-category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-browse-category:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  transform: translateX(2px);
}

/* In-Chat Calibration Card (Shown only on first message) */
.in-chat-calibration-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin: 0.75rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Three Core Value Highlights in Center */
.welcome-hero-features-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  margin-top: 0.35rem;
}

.welcome-hero-features-center .hero-feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  flex: 1 1 220px;
  text-align: left;
}

.welcome-hero-features-center .hero-feature-item .feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.welcome-hero-features-center .hero-feature-item .feature-text {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
}

.welcome-hero-features-center .hero-feature-item .feature-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.welcome-hero-features-center .hero-feature-item .feature-text span {
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

.welcome-cat-pill .pill-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.welcome-cat-pill.active .pill-badge {
  background: rgba(6, 182, 212, 0.25);
  color: #fff;
}

/* Hero Value Highlights */
.welcome-hero-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-feature-item .feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.hero-feature-item .feature-text {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.hero-feature-item .feature-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-feature-item .feature-text span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* Right Side Cards Column */
.welcome-cards-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.75rem;
}

.welcome-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.25rem 0.5rem 0.25rem;
}

.cards-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cards-header-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cards-header-title i {
  color: var(--accent-cyan);
}

.cards-header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cards-header-count {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.welcome-screen h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.welcome-sub {
  color: #cbd5e1;
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.prompt-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  text-align: left;
}

/* 2-Column Cards Grid for Welcome Screen Right Side */
.welcome-split-layout .prompt-cards-grid,
.prompt-cards-grid.cards-2-col {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 0.75rem !important;
  max-height: calc(100vh - 215px);
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.5rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.4) transparent;
}

.welcome-split-layout .prompt-cards-grid::-webkit-scrollbar {
  width: 6px;
}

.welcome-split-layout .prompt-cards-grid::-webkit-scrollbar-track {
  background: transparent;
}

.welcome-split-layout .prompt-cards-grid::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.35);
  border-radius: 4px;
}

.welcome-split-layout .prompt-cards-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.6);
}

/* Category Dividers inside grid */
.prompt-category-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  margin-top: 0.4rem;
  margin-bottom: 0.15rem;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.4));
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.prompt-category-header .cat-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f1f5f9;
}

.prompt-category-header .cat-header-title i {
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.prompt-category-header .cat-header-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  text-transform: none;
}

.prompt-card {
  position: relative;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.prompt-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--accent-cyan);
  transition: height 0.25s ease;
}

.prompt-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.prompt-card:hover::after {
  height: 100%;
}

.prompt-cards-grid.cards-2-col .prompt-card {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.prompt-cards-grid.cards-2-col .card-icon {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.prompt-cards-grid.cards-2-col .card-title {
  font-size: 0.92rem;
  line-height: 1.25;
}

.prompt-cards-grid.cards-2-col .card-desc {
  font-size: 0.77rem;
  line-height: 1.38;
}

.prompt-card.card-hidden,
.prompt-category-header.card-hidden {
  display: none !important;
}

.card-icon {
  font-size: 1.25rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive Welcome Split Layout */
@media (max-width: 991px) {
  .welcome-screen.welcome-split-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0.5rem;
  }

  .welcome-hero-col {
    position: static;
    text-align: center;
    align-items: center;
  }

  .welcome-hero-col .welcome-badge {
    align-self: center;
  }

  .welcome-category-pills {
    justify-content: center;
  }

  .welcome-hero-features {
    display: none;
  }

  .welcome-split-layout .prompt-cards-grid,
  .prompt-cards-grid.cards-2-col {
    max-height: none;
  }
}

@media (max-width: 600px) {
  .welcome-split-layout .prompt-cards-grid,
  .prompt-cards-grid.cards-2-col {
    grid-template-columns: 1fr !important;
  }
}

/* Message Rows */
.message-row {
  display: flex;
  gap: 1rem;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.message-row.user-row {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-row .message-avatar {
  background: #334155;
  color: #cbd5e1;
}

.assistant-row .message-avatar {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  max-width: 780px;
  line-height: 1.6;
}

.user-row .message-bubble {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-right-radius: 4px;
  color: #f1f5f9;
}

.assistant-row .message-bubble {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
  width: 100%;
}

.step-tag-pill {
  display: inline-block;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
}

/* Audio Player Bar */
.audio-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.audio-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.audio-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.audio-btn.playing {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.audio-status-label {
  display: none !important;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* Markdown Content Elements */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  font-family: var(--font-heading);
  margin-top: 0.85rem;
  margin-bottom: 0.4rem;
  color: #fff;
}

.message-bubble p {
  margin-bottom: 0.65rem;
}

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

.message-bubble ul, .message-bubble ol {
  margin-left: 1.4rem;
  margin-bottom: 0.65rem;
}

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

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.85rem;
}

.message-bubble th, .message-bubble td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.message-bubble th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-cyan);
  font-weight: 600;
}

.message-bubble pre {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  position: relative;
}

.message-bubble code {
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.88rem;
}

.copy-code-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.copy-code-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Interactive SVG Diagram Card */
.svg-diagram-card {
  margin: 1.25rem 0;
  background: #0f172a;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

.svg-diagram-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.15);
}

.svg-diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.svg-diagram-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.svg-diagram-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.svg-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.svg-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

.svg-diagram-stage {
  padding: 1.25rem;
  background: #090d16;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  min-height: 200px;
}

.svg-diagram-stage svg {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.svg-code-collapsed {
  display: none !important;
}

/* Follow-up Prompts */
.followups-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.followup-chip {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  font-size: 0.76rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.followup-chip:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent-cyan);
}

/* Frozen User Input Box / Fixed Footer Bar */
.chat-input-wrapper {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0.55rem 2% max(0.75rem, env(safe-area-inset-bottom, 0px)) 2%;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(56, 189, 248, 0.16);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.55);
  width: 100%;
  box-sizing: border-box;
}

.input-container {
  max-width: min(1140px, 93%);
  width: 93%;
  margin: 0 auto;
  min-height: 50px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 28px;
  display: flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  gap: 0.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.22s ease;
  box-sizing: border-box;
}

.input-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35), 0 4px 24px rgba(0, 0, 0, 0.45);
}

.mic-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mic-btn:hover {
  color: var(--accent-cyan);
}

.mic-btn.recording {
  color: var(--accent-rose);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px var(--accent-rose)); }
  100% { transform: scale(1); }
}

#chatInput {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.4;
  resize: none;
  height: 28px;
  min-height: 28px;
  max-height: 160px;
  outline: none;
  padding: 0.25rem 0.15rem;
  overflow-y: hidden;
  box-sizing: border-box;
}

#chatInput::placeholder {
  color: var(--text-muted);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.interrupt-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Enter Key / Send Button View */
.send-btn {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.send-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-0.5px);
  transition: transform 0.18s ease;
}

.send-btn:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.55);
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.92);
  box-shadow: 0 1px 6px rgba(6, 182, 212, 0.4);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: rgba(30, 41, 59, 0.7);
  color: #64748b;
}

/* Dynamic ready-to-send state when text is typed */
.send-btn.ready-to-send {
  background: linear-gradient(135deg, #06b6d4 0%, #38bdf8 50%, #2563eb 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.65), 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.send-btn.ready-to-send:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.8) !important;
}

.input-footer-note {
  text-align: center;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  user-select: none;
}

.ai-disclaimer {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ai-disclaimer i {
  color: #f59e0b;
  font-size: 0.72rem;
}

.disclaimer-sub {
  font-size: 0.65rem;
  color: #64748b;
  letter-spacing: 0.02em;
}

.hidden {
  display: none !important;
}

/* Profile Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

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

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.modal-title i {
  color: var(--accent-cyan);
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
}

.memory-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.memory-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.memory-header h4 {
  font-size: 0.9rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.memory-header h4 i {
  color: var(--accent-emerald);
}

.memory-note {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.memory-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
}

.memory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.4);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.mem-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.mem-del-btn:hover {
  color: var(--accent-rose);
}

.modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.primary-btn:hover {
  opacity: 0.95;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.secondary-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.95);
}

/* Policy Badge Button */
.policy-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.policy-badge-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* Large Modal */
.modal-card.modal-lg {
  max-width: 820px;
  width: 95%;
  max-height: 88vh;
}

.policy-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-height: calc(88vh - 140px);
}

.policy-status-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.policy-status-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-emerald);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.policy-meta-info {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: monospace;
}

.policy-section-box {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.policy-box-title {
  font-size: 0.88rem;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.policy-box-title i {
  color: var(--accent-cyan);
}

.policy-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

@media (max-width: 700px) {
  .policy-checklist-grid {
    grid-template-columns: 1fr;
  }
}

.policy-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-emerald);
}

.policy-check-item i {
  color: var(--accent-emerald);
  font-size: 0.75rem;
}

.policy-markdown-content {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: 380px;
  overflow-y: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-main);
}

.policy-markdown-content h1,
.policy-markdown-content h2,
.policy-markdown-content h3 {
  color: #fff;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.policy-markdown-content h1 { font-size: 1.2rem; }
.policy-markdown-content h2 { font-size: 1.05rem; color: var(--accent-cyan); }
.policy-markdown-content h3 { font-size: 0.95rem; }

.policy-markdown-content ul,
.policy-markdown-content ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.policy-markdown-content li {
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .prompt-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: absolute;
    height: calc(100vh - var(--header-height));
    z-index: 95;
  }
  .header-center .clock-badge {
    display: none;
  }
}

@media (max-width: 640px) {
  .prompt-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Gemini Graphics Generation Studio Styles
   ========================================== */
.graphics-quick-btn {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graphics-quick-btn:hover {
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.graphics-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.graphics-banner .banner-icon {
  font-size: 1.5rem;
  color: var(--accent-cyan);
}

.graphics-banner .banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.graphics-banner .banner-text strong {
  color: #fff;
  font-size: 0.95rem;
}

.graphic-templates-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.templates-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.template-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-pill:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

.tier-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tier-badge-auto {
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.tier-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.tier-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-card input[type="radio"] {
  margin-top: 0.25rem;
  margin-right: 0.65rem;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.tier-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(30, 41, 59, 0.85);
}

.tier-card.active,
.tier-card:has(input[type="radio"]:checked) {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.15);
}

.tier-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tier-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.tier-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tier-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
}

.tier-cost-tag {
  font-size: 0.68rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.primary-badge { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.pro-badge { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.lite-badge { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.eff-badge { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.legacy-badge { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

.form-row-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

/* Reference Dropzone */
.reference-upload-box {
  margin-top: 0.85rem;
}

.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.hidden-file-input {
  display: none;
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dropzone-empty i {
  font-size: 1.6rem;
  color: var(--accent-cyan);
}

.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.dropzone-preview img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-filename {
  font-size: 0.82rem;
  color: #fff;
  font-weight: 500;
}

.mini-danger-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  cursor: pointer;
}

.mini-danger-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Cost & Usage Card */
.cost-usage-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.82rem;
}

.cost-info-col {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.cost-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cost-label {
  color: var(--text-muted);
}

.cost-value {
  color: #38bdf8;
}

.cost-sub {
  color: #94a3b8;
  font-size: 0.75rem;
}

.security-badge-col {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #34d399;
  font-size: 0.75rem;
}

/* Generation Progress Box */
.graphics-loading-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spinRing 0.9s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.loading-msg-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.loading-msg-group strong {
  color: #fff;
  font-size: 0.9rem;
}

.loading-msg-group span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Result Box */
.graphics-result-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.result-header h4 {
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-badge-group {
  display: flex;
  gap: 0.4rem;
}

.badge-sub {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

.result-image-wrapper {
  background: #020617;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1rem;
}

.result-image-wrapper img {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.result-explanation-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.explanation-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.explanation-title-row h5 {
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.mini-voice-btn {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.mini-voice-btn:hover {
  background: rgba(6, 182, 212, 0.3);
}

.result-explanation-box p {
  color: var(--text-main);
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0;
}

.result-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

/* Inline Chat Graphic Card */
.chat-graphic-card {
  margin: 0.85rem 0;
  background: #0b1120;
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.chat-graphic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: rgba(30, 41, 59, 0.7);
  font-size: 0.76rem;
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-graphic-img-wrap {
  text-align: center;
  padding: 0.5rem;
  background: #030712;
}

.chat-graphic-img-wrap img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 4px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
}

.chat-graphic-img-wrap img:hover {
  transform: scale(1.01);
}

.chat-graphic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

/* ===================================================================
   Amba AI — Authentication, Inline Messages & Administrator System
   =================================================================== */

/* User Auth Wrapper & Interactive Avatar Dropdown */
.user-auth-wrapper {
  position: relative;
  display: inline-block;
}

/* Unified Avatar Pill (Trigger for Dropdown) */
.user-avatar-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  padding: 0.28rem 0.85rem 0.28rem 0.32rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar-pill:hover,
.user-auth-wrapper.dropdown-open .user-avatar-pill {
  background: rgba(30, 41, 59, 1);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.28), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.guest-avatar-pill {
  border-color: rgba(6, 182, 212, 0.35);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
}

.guest-avatar-pill:hover,
.user-auth-wrapper.dropdown-open .guest-avatar-pill {
  border-color: var(--accent-cyan);
}

/* Avatar Circle */
.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.user-avatar-circle i {
  font-size: 0.88rem;
}

.guest-avatar-circle {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
}

.logged-avatar-circle {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.45);
}

/* Status Indicator Dot */
.avatar-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

.avatar-status-dot.guest {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.avatar-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Text and Labels inside Pill */
.user-avatar-pill-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.user-avatar-name {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge-mini {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.user-role-badge-mini.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-role-badge-mini.user {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.user-role-badge-mini.guest {
  background: rgba(6, 182, 212, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.avatar-chevron {
  font-size: 0.68rem;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  margin-left: 2px;
}

.user-auth-wrapper.dropdown-open .avatar-chevron {
  transform: rotate(180deg);
  color: #38bdf8;
}

/* ===================================================================
   Avatar Dropdown Menu
   =================================================================== */
.user-profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-height: min(620px, calc(100vh - 85px));
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 0.7rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 1000;
  backdrop-filter: blur(20px);
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Avatar Dropdown Voice & Language Settings */
.menu-settings-box {
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.55);
  border-radius: var(--radius-md);
  margin: 0.25rem 0.5rem 0.65rem 0.5rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.dropdown-control-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dropdown-control-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-select {
  width: 100% !important;
  font-size: 0.82rem !important;
  padding: 0.4rem 0.6rem !important;
  border-radius: var(--radius-sm) !important;
  background: rgba(15, 23, 42, 0.95) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  outline: none;
}

.dropdown-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.slider-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
}

.slider-title-bar span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.slider-val-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.dropdown-slider-row input[type="range"] {
  width: 100%;
  height: 6px;
  accent-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.8);
  border-radius: 999px;
  cursor: pointer;
}

.user-profile-menu.hidden {
  display: none !important;
}

/* User Info Header in Dropdown */
.menu-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.7rem;
}

.menu-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.menu-avatar-large.guest-avatar-large {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.4);
}

.menu-avatar-large.logged-avatar-large {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.45);
}

.menu-user-details {
  flex: 1;
  min-width: 0;
}

.menu-user-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: #f8fafc;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.user-role-tag.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-role-tag.user {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.user-role-tag.guest {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Section Header Labels */
.menu-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.65px;
  color: #64748b;
  padding: 0.45rem 0.6rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.4rem 0;
}

/* Individual Dropdown Menu Buttons */
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-family: var(--font-body);
  font-size: 0.83rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item.menu-item-primary {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  margin-bottom: 2px;
}

.menu-item.menu-item-primary:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: #38bdf8;
}

.menu-item.admin-highlight-item {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.menu-item.admin-highlight-item:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #fbbf24;
}

.menu-item.admin-highlight-item .menu-item-title,
.admin-title {
  color: #fbbf24;
  font-weight: 700;
}

.pwa-install-icon {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.guest-user-info {
  background: rgba(14, 165, 233, 0.08);
  padding: 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.guest-avatar-large {
  color: #38bdf8;
}

.menu-item.danger .menu-item-title,
.danger-title {
  color: #f87171;
  font-weight: 600;
}

.menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
}

.menu-item-icon-wrap {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  transition: all 0.18s ease;
}

.menu-item:hover .menu-item-icon-wrap {
  transform: scale(1.08);
}

.auth-signin-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.auth-signup-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.admin-icon-wrap {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.danger-icon-wrap {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-item-title {
  font-weight: 600;
  font-size: 0.83rem;
  color: #f1f5f9;
  line-height: 1.3;
}

.menu-item-sub {
  font-size: 0.71rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* Inline Message Notification Box (Strictly No Popups, 9-Minute Auto Disappear) */
.inline-msg-box {
  margin: 0.75rem 1.4rem 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.45;
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: slideInMsg 0.25s ease-out;
  position: relative;
}

#globalInlineMsg {
  margin: 0.75rem 1.5rem 0.5rem;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.inline-msg-text {
  flex: 1;
}

.inline-msg-close {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-msg-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.inline-msg-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.inline-msg-box.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.inline-msg-box.warning {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.inline-msg-box.info {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.inline-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.65rem;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff !important;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  transition: all 0.2s ease;
  vertical-align: middle;
  white-space: nowrap;
}

.inline-action-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5);
  filter: brightness(1.1);
}

.inline-msg-box.fading {
  opacity: 0;
  transform: translateY(-6px);
}

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

/* Auth Modal Tabs & Elements */
.auth-modal-card {
  max-width: 480px;
}

/* Auth Polite Banner (Base / Dark Mode) */
.auth-polite-banner {
  background: rgba(14, 165, 233, 0.12);
  border-bottom: 1px solid rgba(14, 165, 233, 0.25);
  padding: 0.9rem 1.25rem;
  font-size: 0.86rem;
  color: #bae6fd;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.auth-banner-icon {
  font-size: 1.15rem;
  margin-top: 0.15rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.auth-banner-content {
  flex: 1;
}

.auth-banner-title {
  color: #ffffff;
  font-weight: 700;
  display: inline;
}

.auth-banner-text {
  color: #bae6fd;
}

.auth-banner-sub {
  color: #cbd5e1;
  margin-top: 0.2rem;
  font-size: 0.84rem;
}

.auth-banner-link {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.auth-banner-link:hover {
  color: #7dd3fc;
}

.auth-tabs-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.35rem 0.6rem 0;
  gap: 0.35rem;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.auth-tab-btn:hover {
  color: var(--text-main);
}

.auth-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.auth-modal-body {
  padding: 1.3rem 1.4rem;
}

.auth-pane {
  display: block;
}

.auth-pane.hidden {
  display: none !important;
}

.input-with-button-wrap {
  display: flex;
  gap: 0.5rem;
}

.action-addon-btn {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.action-addon-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(59, 130, 246, 0.4));
  border-color: #38bdf8;
}

.action-addon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.password-input-wrap .form-input {
  padding-right: 2.5rem;
}

.toggle-pwd-btn {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
}

.toggle-pwd-btn:hover {
  color: var(--text-main);
}

.otp-input {
  letter-spacing: 6px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent-cyan);
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-subtle {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-decoration: none;
}

.link-subtle:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.form-actions-stack {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.auth-switch-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.link-highlight {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

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

/* Administrator Modal & Table */
.admin-modal-card {
  max-width: 960px;
  width: 95vw;
}

.role-badge-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.admin-stat-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.stat-icon-wrap.user-icon { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.stat-icon-wrap.admin-icon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.stat-icon-wrap.topic-icon { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.stat-icon-wrap.msg-icon { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.admin-lead-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.lead-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.lead-info {
  flex: 1;
}

.lead-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-role.admin {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.lead-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.admin-table-section {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.table-sub-note {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.table-container {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.admin-table th {
  background: rgba(30, 41, 59, 0.7);
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.role-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

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

.role-pill.user {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.verified {
  color: #34d399;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge.unverified {
  color: #f87171;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.table-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.74rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 0.35rem;
  transition: all 0.15s ease;
}

.table-btn:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.3);
  border-color: #38bdf8;
}

.table-btn.delete-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #fb7185;
  color: #fb7185;
}

/* ==========================================
   Magic Design Studio & Browser Console Styling
   ========================================== */

/* Header & Quick Action Buttons */
.magic-design-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2)) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.magic-design-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.35)) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3) !important;
  transform: translateY(-1px);
}

.browser-console-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15)) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

.browser-console-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25)) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
  transform: translateY(-1px);
}

.magic-quick-btn {
  color: #38bdf8 !important;
}

.magic-quick-btn:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

.browser-quick-btn {
  color: #34d399 !important;
}

.browser-quick-btn:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3) !important;
}

/* Modal sizing */
.modal-xl {
  max-width: 1200px !important;
  width: 95vw !important;
  max-height: 92vh !important;
}

.magic-pill-tag {
  font-size: 0.72rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-left: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Studio Tabs Nav */
.studio-tabs-nav,
.console-tabs-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1.5rem;
  gap: 0.5rem;
  overflow-x: auto;
}

.studio-tab-btn,
.console-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.studio-tab-btn:hover,
.console-tab-btn:hover {
  color: #fff;
}

.studio-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

.console-tab-btn.active {
  color: #10b981;
  border-bottom-color: #10b981;
}

/* Preset Chips Bar */
.preset-chips-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
}

.chips-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.preset-chip-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.preset-chip-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Magic Studio Split View */
.magic-studio-split-view {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
  padding: 1.5rem;
  min-height: 480px;
}

@media (max-width: 900px) {
  .magic-studio-split-view {
    grid-template-columns: 1fr;
  }
}

.magic-controls-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.magic-preview-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

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

.preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.preview-actions-group {
  display: flex;
  gap: 0.4rem;
}

.mini-tool-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.mini-tool-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.mini-tool-btn.highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.mini-tool-btn.highlight:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.magic-canvas-box {
  flex: 1;
  min-height: 340px;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.svg-holder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.svg-holder svg {
  max-width: 100%;
  max-height: 400px;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.5));
}

.canvas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  max-width: 320px;
}

.canvas-empty-state i {
  font-size: 2.2rem;
  color: rgba(56, 189, 248, 0.3);
}

.magic-explanation-bar {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.exp-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.exp-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.magic-explanation-bar p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Magic Design Chat Card (Rendered in Conversation Messages) */
.magic-design-card {
  margin: 1.2rem 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(11, 15, 25, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.08);
  transition: all 0.25s ease;
}

.magic-design-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15);
}

.magic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.2rem;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.magic-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.magic-card-title-group i {
  font-size: 1.2rem;
  color: #38bdf8;
}

.magic-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
}

.magic-card-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  letter-spacing: 0.5px;
}

.magic-card-type-tag.experiment {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.magic-card-type-tag.workflow {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

.magic-card-type-tag.architecture {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.magic-card-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.magic-tool-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.magic-tool-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.magic-tool-btn.open-in-console-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.magic-tool-btn.open-in-console-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.magic-card-body {
  padding: 1.2rem;
  background: #070b14;
}

.magic-card-svg-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.magic-card-svg-stage svg {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ==========================================
   Playwright Browser Console Modal Styles
   ========================================== */
.browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b0f19;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.engine-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.engine-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.browser-control-toolbar {
  display: flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dark-select {
  background: rgba(30, 41, 59, 0.8) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 0.3rem 0.65rem !important;
  font-size: 0.8rem !important;
  border-radius: var(--radius-sm) !important;
}

.checkbox-item {
  margin-left: auto;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checkbox-label input {
  accent-color: #10b981;
}

.toolbar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #34d399;
  font-weight: 600;
}

.browser-console-body {
  padding: 1.2rem;
  min-height: 480px;
}

/* Tab 1: Live Navigator */
.browser-url-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.nav-mini-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-mini-btn:hover {
  color: #fff;
  border-color: #38bdf8;
}

.url-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.url-lock-icon {
  position: absolute;
  left: 0.85rem;
  color: #34d399;
  font-size: 0.75rem;
}

.browser-url-input {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  outline: none;
  transition: all 0.2s;
}

.browser-url-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.nav-go-btn {
  background: linear-gradient(135deg, #059669, #0d9488) !important;
  font-size: 0.82rem !important;
  padding: 0.5rem 1rem !important;
  white-space: nowrap;
}

.browser-metrics-strip {
  display: flex;
  gap: 1.2rem;
  padding: 0.45rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  font-size: 0.76rem;
  flex-wrap: wrap;
}

.metric-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.m-lbl { color: var(--text-dim); }
.m-val { color: #fff; font-weight: 600; }
.m-val.green { color: #34d399; }
.m-val.truncate { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Navigator Split View */
.navigator-split-view {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  min-height: 420px;
}

@media (max-width: 850px) {
  .navigator-split-view {
    grid-template-columns: 1fr;
  }
}

.viewport-display-box {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  position: relative;
  min-height: 380px;
}

.viewport-device-frame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.viewport-device-frame img {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 300px;
  font-size: 0.85rem;
}

.browser-placeholder i {
  font-size: 2.2rem;
  color: rgba(16, 185, 129, 0.3);
}

.nav-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Browser Console Logs */
.browser-logs-panel {
  display: flex;
  flex-direction: column;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.logs-scroll-box {
  flex: 1;
  padding: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry {
  padding: 0.25rem 0.45rem;
  border-radius: 3px;
  line-height: 1.4;
  word-break: break-all;
}

.log-entry.system { color: #94a3b8; background: rgba(148, 163, 184, 0.06); }
.log-entry.log { color: #f8fafc; }
.log-entry.info { color: #38bdf8; background: rgba(56, 189, 248, 0.06); }
.log-entry.warning, .log-entry.warn { color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.log-entry.error { color: #f87171; background: rgba(239, 68, 68, 0.1); }
.log-time { color: var(--text-dim); margin-right: 0.35rem; }
.log-level { font-weight: 700; margin-right: 0.35rem; }

/* Tab 2: Script Runner */
.script-runner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 850px) {
  .script-runner-layout {
    grid-template-columns: 1fr;
  }
}

.script-editor-col,
.script-output-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.script-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.template-picker-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-editor-area {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.code-editor-area:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.terminal-box {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  min-height: 200px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.terminal-line.system { color: #94a3b8; }
.terminal-line.stdout { color: #34d399; }
.terminal-line.stderr { color: #f87171; }

.artifacts-section {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.65rem;
}

.artifacts-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.artifacts-gallery {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.artifact-card {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 140px;
}

.artifact-thumb {
  width: 130px;
  height: 90px;
  object-fit: cover;
  border-radius: 3px;
}

.artifact-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.artifact-name {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75px;
}

.artifact-empty-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.5rem;
}

/* Tab 3: JS REPL */
.repl-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 440px;
}

.repl-logs-box {
  flex: 1;
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.repl-line.info { color: #64748b; font-style: italic; }
.repl-line.query { color: #38bdf8; font-weight: 600; }
.repl-line.result { color: #34d399; }
.repl-line.error { color: #f87171; }

.repl-input-bar {
  display: flex;
  align-items: center;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.5rem;
  gap: 0.4rem;
}

.repl-prompt {
  color: #38bdf8;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  padding-left: 0.4rem;
}

.repl-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  padding: 0.4rem;
}

/* Tab 4: Renderer Bridge */
.renderer-bridge-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

@media (max-width: 850px) {
  .renderer-bridge-layout {
    grid-template-columns: 1fr;
  }
}

.bridge-info-card,
.bridge-preview-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bridge-info-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.bridge-info-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

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

.bridge-preview-header h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.bridge-img-box {
  flex: 1;
  min-height: 280px;
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
}

.bridge-img-box img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.placeholder-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* ===================================================================
   Amba AI Active Thinking & Blinking Indicator
   =================================================================== */

.thinking-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  animation: fadeInThinking 0.3s ease;
}

.thinking-avatar {
  position: relative;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  animation: pulseAvatarGlow 2s infinite ease-in-out;
}

.avatar-glow-ring {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--accent-cyan);
  animation: avatarRingPulse 1.8s infinite ease-out;
  pointer-events: none;
}

.thinking-bubble {
  position: relative;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.85) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px !important;
  padding: 0.95rem 1.25rem;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15), inset 0 0 20px rgba(6, 182, 212, 0.05);
  max-width: 580px;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.thinking-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
}

.thinking-brand-badge .thinking-text {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Blinking dot animation */
.blinking-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.7);
  animation: thinkingDotBlink 1.1s infinite ease-in-out;
  display: inline-block;
  flex-shrink: 0;
}

/* Blinking cursor animation */
.blinking-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #38bdf8;
  vertical-align: middle;
  margin-left: 2px;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  animation: cursorBlink 0.85s infinite steps(2, start);
}

/* Wave bouncing dots */
.thinking-wave-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.thinking-wave-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  display: inline-block;
  animation: waveBounce 1.4s infinite ease-in-out both;
}

.thinking-wave-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-wave-dots span:nth-child(2) { animation-delay: -0.16s; }
.thinking-wave-dots span:nth-child(3) { animation-delay: 0s; }

.thinking-status-text {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  line-height: 1.4;
}

.thinking-status-text i {
  color: var(--accent-amber);
}

/* Shimmer Progress Line */
.thinking-shimmer-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.thinking-shimmer-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), #38bdf8, transparent);
  animation: thinkingShimmerSlide 1.8s infinite ease-in-out;
}

/* Chat Input Thinking Banner (Permanently disabled above input box) */
.chat-thinking-banner {
  display: none !important;
}

.chat-thinking-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.thinking-banner-title {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-family: var(--font-heading);
}

.blinking-dots span {
  animation: waveBounce 1.2s infinite ease-in-out both;
  display: inline-block;
}

.blinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.blinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.blinking-dots span:nth-child(3) { animation-delay: 0s; }

.chat-thinking-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-thinking-note i {
  color: var(--accent-cyan);
}

/* Keyframe Animations */
@keyframes thinkingDotBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 10px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.7);
  }
  50% {
    opacity: 0.2;
    transform: scale(0.8);
    box-shadow: 0 0 2px rgba(56, 189, 248, 0.2);
  }
}

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

@keyframes waveBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.35;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes thinkingShimmerSlide {
  0% { left: -50%; }
  100% { left: 150%; }
}

@keyframes avatarRingPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.38); opacity: 0; }
}

@keyframes pulseAvatarGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(6, 182, 212, 0.35); }
  50% { box-shadow: 0 0 26px rgba(6, 182, 212, 0.85); }
}

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

body.amba-ai-thinking .brand-logo {
  animation: pulseAvatarGlow 1.4s infinite ease-in-out;
}

/* ===================================================================
   Learning Minutes Pill & Header Controls
   =================================================================== */
.minutes-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  height: 38px;
  box-sizing: border-box;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.minutes-pill .minutes-val {
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 58px;
  text-align: center;
}

.minutes-pill .minutes-unit {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.extend-mini-btn,
.buy-mini-btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-mini-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.refresh-mini-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

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

.extend-mini-btn {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.extend-mini-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.buy-mini-btn {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.buy-mini-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.6);
}

/* Custom Language Inline Inputs */
.custom-language-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: fadeInThinking 0.2s ease;
}

.custom-lang-text {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #f1f5f9;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  width: 170px;
}

.custom-ratio-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  cursor: pointer;
}

/* ===================================================================
   Right-Hand Split-Screen Topics Panel (Optimized 35% Width & 65% Center)
   =================================================================== */
.right-topics-panel {
  width: 35%;
  min-width: 440px;
  max-width: 580px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 85;
}

@media (min-width: 1600px) {
  .right-topics-panel {
    width: 35%;
    min-width: 480px;
    max-width: 620px;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  .right-topics-panel {
    width: 360px;
    min-width: 340px;
    max-width: 400px;
  }
}

.right-topics-panel.hidden,
.right-topics-panel.collapsed {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Domain Group Filter Pills in Right Panel */
.right-domain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.right-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.right-domain-pill:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.right-domain-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.right-domain-pill .pill-cnt {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.4rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}

.right-domain-pill.active .pill-cnt {
  background: rgba(6, 182, 212, 0.25);
  color: #fff;
}

.right-domain-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-top: 0.4rem;
  margin-bottom: 0.15rem;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.4));
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f1f5f9;
}

.right-domain-header i {
  color: var(--accent-cyan);
  margin-right: 0.4rem;
}

.right-domain-header .badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  text-transform: none;
}

/* 3-Column Cards Grid in Right Screen (Compact & Snug fit) */
.right-quick-cards-list,
.right-quick-cards-list.cards-3-col,
.right-quick-cards-list.cards-2-col {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.5rem !important;
  padding: 0.35rem 0.15rem 1rem 0.15rem;
}

.right-quick-cards-list .right-quick-item,
.right-quick-cards-list.cards-3-col .right-quick-item,
.right-quick-cards-list.cards-2-col .right-quick-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.65rem;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  gap: 0.25rem;
  min-height: 84px;
}

.right-quick-cards-list .right-quick-item::after,
.right-quick-cards-list.cards-3-col .right-quick-item::after,
.right-quick-cards-list.cards-2-col .right-quick-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--accent-cyan);
  transition: height 0.2s ease;
}

.right-quick-cards-list .right-quick-item:hover,
.right-quick-cards-list.cards-3-col .right-quick-item:hover,
.right-quick-cards-list.cards-2-col .right-quick-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.right-quick-cards-list .right-quick-item:hover::after,
.right-quick-cards-list.cards-3-col .right-quick-item:hover::after,
.right-quick-cards-list.cards-2-col .right-quick-item:hover::after {
  height: 100%;
}

.right-quick-cards-list .item-icon {
  font-size: 1.05rem;
  color: var(--accent-cyan);
  margin-bottom: 0.05rem;
}

.right-quick-cards-list .item-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.25;
}

.right-quick-cards-list .item-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.right-quick-cards-list .item-tag-badge {
  display: inline-block;
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  width: fit-content;
  margin-top: auto;
}

@media (max-width: 1100px) {
  .right-quick-cards-list,
  .right-quick-cards-list.cards-3-col,
  .right-quick-cards-list.cards-2-col {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .right-quick-cards-list,
  .right-quick-cards-list.cards-3-col,
  .right-quick-cards-list.cards-2-col {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile backdrop for right panel */
.right-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  transition: opacity 0.25s ease;
}

.right-panel-backdrop.hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .right-panel-backdrop {
    display: none !important;
  }
}

.right-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.right-panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
}

.right-panel-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.right-panel-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.right-panel-search {
  position: relative;
  padding: 0.65rem 0.9rem;
}

.right-panel-search i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.right-panel-search input {
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  font-size: 0.82rem;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.2s ease;
}

.right-panel-search input:focus {
  border-color: var(--accent-cyan);
}

.right-panel-tabs {
  display: flex;
  padding: 0 0.9rem;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.right-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.right-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.right-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) rgba(15, 23, 42, 0.35);
}

.right-panel-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.right-panel-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
}

.right-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.right-panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.4);
}

.right-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.right-quick-category {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  padding: 0.45rem 0.2rem 0.25rem 0.2rem;
  margin-top: 0.4rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.right-quick-item {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.right-quick-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateX(2px);
}

.right-quick-item .item-icon {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  margin-top: 2px;
  flex-shrink: 0;
}

.right-quick-item .item-text {
  flex: 1;
  overflow: hidden;
}

.right-quick-item .item-title {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.right-quick-item .item-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.right-session-item.active {
  background: rgba(6, 182, 212, 0.16) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.22);
}

.right-session-item.active .item-title {
  color: var(--accent-cyan) !important;
}

.right-session-item.active .item-icon {
  color: var(--accent-cyan) !important;
}

/* ===================================================================
   Razorpay Buy Minutes & Extension Modal Styles
   =================================================================== */
.payment-modal-card {
  max-width: 660px;
  width: 95%;
}

.payment-modal-body {
  padding: 1.25rem 1.5rem;
}

.minutes-status-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.minutes-status-banner .status-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.minutes-status-banner .status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.pricing-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}

.pricing-card.featured {
  border-color: rgba(6, 182, 212, 0.5);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.extension-badge {
  background: linear-gradient(135deg, #10b981, #059669);
}

.pricing-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.4rem;
}

.pricing-amount {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.8rem;
}

.pricing-amount .pricing-sub {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  flex: 1;
}

.pricing-perks li {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pay-razorpay-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  transition: all 0.22s ease;
}

.pay-razorpay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.55);
}

.extend-action-btn {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.22s ease;
}

.extend-action-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.payment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.secure-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ===================================================================
   Amba AI — Unified Responsive Architecture Across All Screen Sizes
   Range 1: 3" to 8" (Compact Phones, Foldables & Handhelds: 240px - 767px)
   Range 2: 8" to 12" (Tablets, iPad Mini/Air/Pro, Surface: 768px - 1199px)
   Range 3: 12" to 32"+ (Laptops, Desktops, 2K & 4K Ultrawides: 1200px - 3840px+)
   =================================================================== */

/* Safe area insets & mobile touch fundamentals */
html, body {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 94;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
}

/* Default state for desktop controls group (inline on desktop >= 1200px) */
.header-controls-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.mobile-controls-toggle {
  display: none !important;
}

/* Floating Voice & Preferences Popover Tray (on tablets, netbooks & mobile < 1200px) */
@media (max-width: 1199px) {
  .mobile-controls-toggle {
    display: flex !important;
  }

  .header-controls-group {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 8px);
    right: 0.85rem;
    left: auto;
    width: min(340px, calc(100vw - 1.7rem));
    background: rgba(11, 17, 32, 0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    gap: 0.95rem;
    z-index: 1050;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(14, 165, 233, 0.2);
    flex-direction: column;
    align-items: stretch;
    animation: ribbonSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-controls-group.open {
    display: flex !important;
  }

  .ribbon-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
  }

  .ribbon-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
  }

  .ribbon-close-btn:hover {
    color: #ffffff;
  }

  .header-controls-group .language-group-wrapper {
    width: 100%;
    min-width: 0;
  }

  .header-controls-group .language-group-wrapper select {
    width: 100%;
    font-size: 0.88rem !important;
    min-height: 42px;
  }

  .header-controls-group .custom-language-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-controls-group .custom-language-row input,
  .header-controls-group .custom-language-row select {
    width: 100%;
  }

  .header-controls-group .slider-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .header-controls-group .slider-control input[type="range"] {
    width: 100%;
    height: 6px;
  }
}

@keyframes ribbonSlideIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===================================================================
   RANGE 3: 12" to 32"+ (Laptops, Desktops, 2K & 4K Monitors: 1200px - 3840px+)
   =================================================================== */

/* Ultra-Wide Monitors & Large 4K Displays (24" to 32"+, > 1920px) */
@media (min-width: 1921px) {
  :root {
    --header-height: 68px;
  }

  body {
    font-size: 17px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 clamp(1.5rem, 3.5vw, 4rem);
  }

  .top-header-inner {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 2%;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .brand-tag {
    font-size: 0.72rem;
  }

  .activity-hub-capsule {
    padding: 3px 8px;
    gap: 0.55rem;
  }

  .clock-badge,
  .session-timer-badge,
  .minutes-pill {
    height: 40px;
    padding: 0.3rem 0.85rem;
    font-size: 0.92rem;
  }

  .slider-control input[type="range"] {
    width: 80px;
  }

  .install-pwa-btn {
    padding: 0.45rem 1rem;
    font-size: 0.86rem;
  }

  /* Center reading canvas with 2% wide side margins */
  .chat-messages {
    max-width: 98% !important;
    padding: 1.5rem 2% calc(140px + env(safe-area-inset-bottom, 0px)) 2% !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  .welcome-screen {
    max-width: 100% !important;
    padding: 2.5rem 0 !important;
  }

  .welcome-sub {
    font-size: 1.15rem;
    max-width: 1000px;
    margin: 0 auto 2.5rem auto;
  }

  .prompt-cards-grid:not(.cards-2-col) {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem;
  }

  .input-container {
    max-width: min(1200px, 93%) !important;
    width: 93% !important;
    padding: 0.65rem 1.15rem;
  }

  .footer-activity-hub {
    max-width: min(1200px, 93%) !important;
    width: 93% !important;
  }

  #chatInput {
    font-size: 1.05rem;
  }

  .message-row {
    max-width: 1040px;
  }

  .message-bubble {
    max-width: 960px;
    font-size: 1.02rem;
  }

  .modal-xl {
    max-width: 1400px !important;
  }
}

/* Standard Laptops & Desktops (12" to 16", 1200px - 1920px) */
@media (min-width: 1200px) and (max-width: 1920px) {
  .top-header {
    padding: 0 1rem;
  }

  .prompt-cards-grid:not(.cards-2-col) {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Standard Desktop Header Inner (1600px - 1920px) */
@media (min-width: 1600px) and (max-width: 1920px) {
  .top-header-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 2%;
  }
}

/* Compact 12" to 14" Laptops (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
  .top-header-inner {
    gap: 0.5rem;
  }

  /* Simplify date on compact 12"-14" laptops to preserve space */
  .clock-date {
    display: none;
  }

  .clock-badge {
    padding: 0.25rem 0.5rem;
  }

  .header-controls-group .language-group-wrapper select {
    max-width: 180px;
  }

  .slider-control input[type="range"] {
    width: 55px;
  }
}

/* ===================================================================
   RANGE 2: 8" to 12" (Tablets, iPad Mini/Air/Pro, Surface: 768px - 1199px)
   =================================================================== */

/* 10" to 12" Tablet Landscape & Compact Netbooks (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  :root {
    --header-height: 60px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 0.85rem;
  }

  .top-header-inner {
    gap: 0.55rem;
  }

  .brand-logo {
    width: 35px;
    height: 35px;
    font-size: 1.05rem;
  }

  .brand-name {
    font-size: 1.05rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.65rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
  }

  /* On 10"-12" tablets: Keep clock live time, collapse date */
  .clock-date {
    display: none !important;
  }

  .clock-badge {
    padding: 0.22rem 0.55rem;
  }

  .clock-time {
    font-size: 0.82rem;
  }

  .session-timer-badge {
    padding: 0.22rem 0.55rem;
  }

  .minutes-pill {
    padding: 0.22rem 0.6rem;
  }

  .install-pwa-btn .install-pwa-text {
    display: inline-block;
  }

  .sidebar {
    width: 250px;
  }

  .prompt-cards-grid:not(.cards-2-col) {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem;
  }

  .message-bubble {
    max-width: 720px;
  }

  /* 10"-12" Tablet Responsive Cards & Bottom Clearance */
  .chat-messages {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .welcome-screen h1,
  .welcome-center-hero h1 {
    font-size: 2.3rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
  }

  .welcome-sub,
  .welcome-center-hero .welcome-sub {
    color: #cbd5e1 !important;
    font-size: 1.05rem !important;
  }

  .center-cards-compact-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .featured-master-banner {
    padding: 1.35rem 1.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .welcome-guide-banner {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* 8" to 10" Tablet Portrait & Foldables (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --header-height: 58px;
    --sidebar-width: 270px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 0.75rem;
  }

  .top-header-inner {
    gap: 0.45rem;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .brand-name {
    font-size: 1rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.62rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
  }

  /* On 8"-10" portrait tablets: Hide IST Clock & its divider to give session timers full breathing room */
  .clock-badge,
  .capsule-divider.clock-divider {
    display: none !important;
  }

  .activity-hub-capsule {
    padding: 2px 5px !important;
  }

  .session-timer-badge,
  .minutes-pill {
    height: 34px !important;
    padding: 0.2rem 0.55rem !important;
    font-size: 0.78rem !important;
  }

  .mobile-controls-toggle {
    display: flex !important;
  }

  /* Compact PWA button: Icon only on 8"-10" portrait */
  .install-pwa-btn .install-pwa-text {
    display: none !important;
  }

  .install-pwa-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .user-avatar-pill-text {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 8"-10" Tablet Responsive Cards & Bottom Clearance */
  .chat-messages {
    padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .welcome-screen,
  .welcome-screen.welcome-center-hero {
    padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .welcome-screen h1,
  .welcome-center-hero h1 {
    font-size: 2.1rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
  }

  .welcome-sub,
  .welcome-center-hero .welcome-sub {
    color: #cbd5e1 !important;
    font-size: 1.02rem !important;
  }

  .center-cards-compact-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }

  .ai-card-item {
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
  }

  .ai-card-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.98rem !important;
  }

  .ai-card-desc {
    color: #cbd5e1 !important;
    font-size: 0.86rem !important;
  }

  .featured-master-banner {
    padding: 1.25rem 1.4rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .featured-master-body {
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 1rem !important;
  }

  .featured-master-title {
    font-size: 1.3rem !important;
    text-align: left !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
  }

  .featured-master-desc {
    font-size: 0.92rem !important;
    text-align: left !important;
    color: #cbd5e1 !important;
  }

  .featured-master-tags {
    justify-content: flex-start !important;
  }

  .featured-master-actions {
    flex-direction: row !important;
    gap: 0.85rem !important;
  }

  .btn-start-featured,
  .btn-browse-category {
    width: auto !important;
  }

  .welcome-guide-banner {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem 1.2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .welcome-guide-banner .banner-text strong {
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
  }

  .welcome-guide-banner .banner-text span {
    color: #cbd5e1 !important;
    font-size: 0.86rem !important;
  }

  .welcome-guide-banner .btn-focus-panel {
    width: auto !important;
    flex-shrink: 0 !important;
  }

  /* Sidebar off-canvas drawer on 8" - 10" tablet portrait */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: min(85vw, 320px);
    min-width: unset;
    max-width: unset;
    height: calc(100vh - var(--header-height));
    z-index: 95;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.6);
    margin-left: 0 !important;
    transform: translateX(0);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
    position: fixed !important;
    margin-left: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .right-topics-panel {
    position: fixed;
    right: 0;
    top: var(--header-height);
    bottom: 0;
    width: min(85vw, 480px);
    max-width: 85vw;
    height: calc(100vh - var(--header-height));
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.75);
    z-index: 1050;
  }

  .prompt-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem;
  }

  .pricing-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
  }

  .magic-studio-split-view,
  .navigator-split-view,
  .script-runner-layout {
    grid-template-columns: 1fr !important;
  }

  .modal-xl,
  .modal-lg,
  .admin-modal-card {
    width: 92vw !important;
    max-width: 92vw !important;
    max-height: 90vh !important;
  }
}

/* ===================================================================
   RANGE 1: 3" to 8" (Smartphones, Foldables & Handhelds: 240px - 767px)
   =================================================================== */

/* Standard to Large Smartphones (5" to 8" screens, 480px - 767px) */
@media (max-width: 767px) {
  :root {
    --header-height: 56px;
    --sidebar-width: 290px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 0.55rem;
    gap: 0.4rem;
  }

  .top-header-inner {
    gap: 0.4rem;
  }

  .header-left {
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .brand-name {
    font-size: 1.02rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    display: inline-block !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.62rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-top: 1px;
  }

  /* Docked Activity Hub Capsule on Mobile (Clock + Timer + Minutes Wallet) */
  .footer-activity-hub {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto 0.35rem auto !important;
  }

  .activity-hub-capsule {
    display: inline-flex !important;
    align-items: center !important;
    padding: 2px 6px !important;
    gap: 0.25rem !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .activity-hub-capsule::-webkit-scrollbar {
    display: none !important;
  }

  /* 1. Regional IST Clock on Mobile (Compact time-only) */
  .clock-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.15rem 0.35rem !important;
    height: 28px !important;
  }

  .clock-badge .clock-icon {
    font-size: 0.78rem !important;
    color: var(--accent-cyan) !important;
  }

  .clock-badge .clock-time {
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    color: #f1f5f9 !important;
  }

  .clock-badge .clock-date {
    display: none !important;
  }

  .capsule-divider {
    display: block !important;
    height: 14px !important;
    width: 1px !important;
    background: rgba(56, 189, 248, 0.25) !important;
    flex-shrink: 0 !important;
  }

  /* 2. Compact Session Stopwatch on Mobile */
  .session-timer-badge {
    display: inline-flex !important;
    align-items: center !important;
    height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.74rem !important;
    gap: 0.25rem !important;
  }

  .session-timer-badge .timer-icon {
    font-size: 0.75rem !important;
    color: #10b981 !important;
  }

  .session-timer-badge .session-time {
    font-size: 0.74rem !important;
    color: #f1f5f9 !important;
  }

  .session-timer-badge .session-status-tag {
    display: none !important; /* Hide "Inactive" text, keep timer */
  }

  .session-timer-badge .mini-icon-btn {
    font-size: 0.65rem !important;
    padding: 1px 2px !important;
  }

  /* 3. Compact Minutes Pill on Mobile */
  .minutes-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.74rem !important;
    gap: 0.25rem !important;
    height: 28px !important;
  }

  .minutes-pill i {
    font-size: 0.74rem !important;
  }

  .minutes-pill .minutes-val {
    font-size: 0.74rem !important;
  }

  .minutes-pill .minutes-unit,
  .minutes-pill .refresh-mini-btn,
  .minutes-pill .extend-mini-btn {
    display: none !important;
  }

  .buy-mini-btn {
    padding: 0.15rem 0.42rem !important;
    font-size: 0.68rem !important;
    border-radius: var(--radius-full) !important;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .header-right {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .mobile-controls-toggle {
    display: flex !important;
  }

  /* Compact PWA button on mobile */
  .install-pwa-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .install-pwa-btn .install-pwa-text {
    display: none !important;
  }

  .user-avatar-pill {
    padding: 2px;
  }

  .user-avatar-pill-text {
    display: none !important;
  }

  .user-avatar-circle {
    width: 32px;
    height: 32px;
  }

  /* Quick Controls popover on small phones */
  .header-controls-group {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    left: 0.65rem;
    right: 0.65rem;
    width: auto;
    max-width: unset;
    border-radius: var(--radius-md);
    padding: 1rem;
    max-height: calc(100vh - var(--header-height) - 16px);
    overflow-y: auto;
  }

  .language-group-wrapper {
    width: 100%;
    min-width: 0;
  }

  .language-group-wrapper select {
    width: 100%;
    font-size: 0.85rem;
  }

  .custom-language-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .custom-language-row input,
  .custom-language-row select {
    width: 100%;
  }

  .slider-control {
    width: 100%;
    padding: 0.45rem 0.75rem;
  }

  .slider-control input[type="range"] {
    width: 100%;
    height: 6px;
  }

  /* Full-bleed off-canvas sidebar */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: min(85vw, 300px);
    min-width: unset;
    max-width: unset;
    height: calc(100vh - var(--header-height));
    z-index: 95;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.65);
    margin-left: 0 !important;
    transform: translateX(0);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
    position: fixed !important;
    margin-left: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .right-topics-panel {
    position: fixed;
    right: 0;
    top: var(--header-height);
    bottom: 0;
    width: min(88vw, 340px);
    max-width: 88vw;
    height: calc(100vh - var(--header-height));
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.75);
    z-index: 1050;
  }

  /* Welcome Screen Fluid Presentation (0" to 8" Displays) */
  .welcome-screen,
  .welcome-screen.welcome-center-hero {
    padding: 0.85rem 0.35rem calc(60px + env(safe-area-inset-bottom, 0px)) 0.35rem !important;
    gap: 0.85rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .welcome-badge {
    font-size: 0.76rem !important;
    padding: 0.28rem 0.75rem !important;
    margin-bottom: 0.35rem !important;
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    font-weight: 700 !important;
  }

  .welcome-screen h1,
  .welcome-center-hero h1,
  .welcome-hero-title {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem) !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8) !important;
  }

  .welcome-sub,
  .welcome-center-hero .welcome-sub,
  .welcome-hero-desc {
    font-size: 0.98rem !important;
    line-height: 1.55 !important;
    margin-bottom: 0.85rem !important;
    max-width: 98% !important;
    color: #cbd5e1 !important;
    font-weight: 500 !important;
  }

  /* Center Domain Selector Pills: Single-Line Horizontal Swipe Carousel */
  .center-domain-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    padding: 0.35rem 0.2rem 0.65rem 0.2rem !important;
    gap: 0.55rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .center-domain-pills::-webkit-scrollbar {
    display: none !important;
  }

  .center-domain-pill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 0.42rem 0.85rem !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-full) !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
  }

  .center-domain-pill.active {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
  }

  .center-domain-pill .pill-badge {
    font-size: 0.72rem !important;
    padding: 0.1rem 0.42rem !important;
    background: rgba(56, 189, 248, 0.22) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
  }

  /* Welcome Guide Banner: 2-Row Responsive Grid on Mobile to prevent squished text */
  .welcome-guide-banner {
    display: grid !important;
    grid-template-columns: 42px 1fr !important;
    gap: 0.65rem 0.75rem !important;
    align-items: start !important;
    padding: 0.95rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-lg) !important;
    margin-top: 0.25rem !important;
    background: rgba(15, 23, 42, 0.94) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
  }

  .welcome-guide-banner .banner-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 1.2rem !important;
    border-radius: 10px !important;
    background: rgba(6, 182, 212, 0.16) !important;
    border: 1px solid rgba(6, 182, 212, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #38bdf8 !important;
  }

  .welcome-guide-banner .banner-text {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
  }

  .welcome-guide-banner .banner-text strong {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    display: block !important;
  }

  .welcome-guide-banner .banner-text span {
    font-size: 0.84rem !important;
    line-height: 1.45 !important;
    color: #cbd5e1 !important;
    display: block !important;
  }

  .welcome-guide-banner .btn-focus-panel {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.68rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    margin-top: 0.2rem !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-md) !important;
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
  }

  .prompt-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .prompt-card {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
  }

  /* ===================================================================
     Mobile Cards & Center Content Responsiveness (0" to 8" Displays)
     =================================================================== */
  .featured-master-banner {
    padding: 1.1rem 1rem !important;
    gap: 0.75rem !important;
    border-radius: var(--radius-lg) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, rgba(26, 36, 56, 0.96), rgba(15, 23, 42, 0.98)) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(245, 158, 11, 0.12) !important;
  }

  .featured-master-badge {
    color: #fbbf24 !important;
    font-weight: 800 !important;
    background: rgba(245, 158, 11, 0.18) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    font-size: 0.74rem !important;
  }

  .featured-master-body {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }

  .featured-master-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.35rem !important;
    margin: 0 auto !important;
    border-radius: var(--radius-md) !important;
  }

  .featured-master-title {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #ffffff !important;
    font-weight: 800 !important;
  }

  .featured-master-desc {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
    margin-bottom: 0.65rem !important;
    text-align: center !important;
    color: #cbd5e1 !important;
    font-weight: 500 !important;
  }

  .featured-master-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.4rem !important;
  }

  .featured-master-tags .f-tag {
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    padding: 0.22rem 0.55rem !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
    border-radius: var(--radius-full) !important;
    white-space: nowrap !important;
  }

  .featured-master-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.6rem !important;
    padding-top: 0.55rem !important;
  }

  .btn-start-featured {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
  }

  .btn-browse-category {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
    background: rgba(14, 165, 233, 0.18) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38bdf8 !important;
  }

  .center-category-showcase {
    padding: 1rem 0.95rem !important;
    border-radius: var(--radius-lg) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 0.85rem !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.3) !important;
  }

  .showcase-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.45rem !important;
  }

  .showcase-header-left {
    gap: 0.65rem !important;
  }

  .showcase-header-left i {
    font-size: 1.25rem !important;
    color: #38bdf8 !important;
  }

  .showcase-header-left h3 {
    font-size: 1.05rem !important;
    color: #ffffff !important;
    font-weight: 800 !important;
  }

  .showcase-subtitle {
    color: #cbd5e1 !important;
    font-size: 0.86rem !important;
  }

  .showcase-pill {
    align-self: flex-start !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
  }

  .center-cards-compact-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .ai-card-item {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.95rem 1rem !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
  }

  .ai-card-header {
    gap: 0.55rem !important;
  }

  .ai-card-title {
    font-size: 0.96rem !important;
    word-break: break-word !important;
    color: #ffffff !important;
    font-weight: 700 !important;
  }

  .ai-card-desc {
    font-size: 0.84rem !important;
    line-height: 1.45 !important;
    color: #cbd5e1 !important;
  }

  .ai-card-tag {
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    font-weight: 600 !important;
  }

  .quick-diagnosis-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: var(--radius-lg) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .diagnosis-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .diagnosis-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .welcome-hero-features-center {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .welcome-hero-features-center .hero-feature-item {
    width: 100% !important;
    flex: 1 1 100% !important;
    padding: 0.55rem 0.75rem !important;
  }

  .in-chat-calibration-card {
    padding: 0.85rem !important;
    border-radius: var(--radius-md) !important;
  }

  /* Step Progress Banner on Mobile */
  .step-progress-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
  }

  .step-info {
    justify-content: space-between;
  }

  .step-controls {
    justify-content: flex-end;
  }

  /* Chat Messages Stream */
  .chat-messages {
    padding: 0.85rem 0.65rem 1rem 0.65rem;
    gap: 1rem;
  }

  .message-row {
    gap: 0.5rem;
    max-width: 100%;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
  }

  /* Zoomed Close Camera Effect: Ultra-Crisp High-Readability Message Board with Footer Clearance */
  .chat-messages {
    padding: 0.85rem 2% calc(150px + env(safe-area-inset-bottom, 0px)) 2% !important;
    gap: 1.15rem !important;
  }

  .message-row {
    gap: 0.65rem !important;
    max-width: 100% !important;
  }

  .message-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 1rem !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.4) !important;
    align-self: flex-start !important;
    margin-top: 2px !important;
  }

  .message-bubble {
    padding: 1.1rem 1.25rem !important;
    border-radius: 18px !important;
    max-width: calc(100% - 44px) !important;
    font-size: 1.05rem !important; /* Zoomed close camera effect */
    line-height: 1.68 !important;
    color: #f8fafc !important;
    box-sizing: border-box !important;
    letter-spacing: 0.01em !important;
    word-break: break-word !important;
  }

  .assistant-row .message-bubble {
    background: rgba(15, 23, 42, 0.94) !important;
    border: 1px solid rgba(56, 189, 248, 0.38) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  .user-row .message-bubble {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #ffffff !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
  }

  .user-row .message-avatar {
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
  }

  /* Typography inside Message Board: Zoomed High-Contrast */
  .message-bubble h1,
  .message-bubble h2,
  .message-bubble h3 {
    font-size: 1.32rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.015em !important;
    line-height: 1.35 !important;
    margin-top: 0.35rem !important;
    margin-bottom: 0.75rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  }

  .message-bubble p {
    font-size: 1.05rem !important;
    line-height: 1.68 !important;
    color: #f8fafc !important;
    margin-bottom: 0.85rem !important;
  }

  .message-bubble strong,
  .message-bubble b {
    color: #38bdf8 !important; /* Luminous cyan accent for bold concepts */
    font-weight: 700 !important;
  }

  .message-bubble ul,
  .message-bubble ol {
    padding-left: 1.35rem !important;
    margin-bottom: 0.85rem !important;
  }

  .message-bubble li {
    font-size: 1.03rem !important;
    line-height: 1.65 !important;
    color: #f1f5f9 !important;
    margin-bottom: 0.55rem !important;
  }

  .message-bubble li::marker {
    color: #38bdf8 !important;
    font-size: 1.15em !important;
  }

  .message-bubble code:not(pre code) {
    background: rgba(15, 23, 42, 0.85) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    font-size: 0.95rem !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 6px !important;
    font-family: var(--font-code) !important;
  }

  .message-bubble table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 0.88rem !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 8px !important;
    margin: 0.75rem 0 !important;
  }

  .message-bubble pre {
    padding: 0.95rem !important;
    font-size: 0.92rem !important;
    border-radius: 12px !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    background: #090e1a !important;
    margin: 0.85rem 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .audio-ctrl-bar {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .audio-btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  /* Frozen User Input Box / Fixed Footer Bar */
  .chat-input-wrapper {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: rgba(11, 15, 25, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.85) !important;
    padding: 0.45rem 2% max(0.6rem, env(safe-area-inset-bottom, 0px)) 2% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .footer-activity-hub {
    margin: 0.35rem auto 0.15rem auto !important;
  }

  .footer-activity-hub .activity-hub-capsule {
    padding: 2px 5px !important;
    gap: 0.25rem !important;
  }

  .input-container {
    width: 95% !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    padding: 0.32rem 0.65rem !important;
    gap: 0.5rem !important;
    border-radius: 26px !important;
    align-items: center !important;
  }

  #chatInput {
    font-size: 16px !important; /* Crucial: 16px prevents iOS Safari auto-zoom on focus */
    padding: 0.32rem 0.25rem !important;
    line-height: 1.4 !important;
    height: 34px !important;
    min-height: 34px !important;
    overflow-y: hidden !important;
    resize: none !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }

  #chatInput::-webkit-scrollbar {
    display: none !important;
  }

  .mic-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  /* Enter Key / Send Button on Mobile */
  .send-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #06b6d4, #0284c7) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .send-btn i {
    transform: translateY(-0.5px);
  }

  .input-footer-note {
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
    padding: 0.25rem 0.4rem 0 0.4rem !important;
    margin-top: 0.25rem !important;
    gap: 0.15rem !important;
  }

  .ai-disclaimer {
    font-size: 0.72rem !important;
    text-align: center !important;
    line-height: 1.35 !important;
    color: #e2e8f0 !important;
    justify-content: center !important;
  }

  .ai-disclaimer i {
    color: #f59e0b !important;
    font-size: 0.72rem !important;
  }

  .disclaimer-sub {
    font-size: 0.62rem !important;
    text-align: center !important;
    opacity: 0.85 !important;
    color: #64748b !important;
  }

  /* Modals on 5" - 8" Phones */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 0.9rem 1.1rem;
  }

  .modal-body {
    padding: 1rem;
    gap: 0.85rem;
  }

  .form-row,
  .form-row-three {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .tier-selection-grid,
  .pricing-cards-grid,
  .policy-checklist-grid {
    grid-template-columns: 1fr !important;
  }

  .otp-inputs-row input {
    width: 38px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* Smartphones in Portrait (3" to 6.8" screens, 320px - 479px) */
@media (max-width: 479px) {
  :root {
    --header-height: 54px;
    --sidebar-width: 285px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 0.45rem !important;
    gap: 0.25rem !important;
  }

  .top-header-inner {
    gap: 0.25rem !important;
    justify-content: space-between !important;
  }

  .header-left {
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }

  .header-nav-btn,
  #sidebarToggleBtn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.88rem !important;
  }

  .brand {
    gap: 0.35rem !important;
  }

  .brand-logo {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .brand-name {
    font-size: 0.94rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.62rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-top: 1px;
  }

  /* Center Hub on Portrait Mobile: hero minutes balance pill */
  .header-center {
    flex-shrink: 0 !important;
  }

  .activity-hub-capsule {
    padding: 2px 5px !important;
    gap: 0.2rem !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .activity-hub-capsule::-webkit-scrollbar {
    display: none !important;
  }

  /* Keep Clock visible & compact on smartphones */
  .clock-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.2rem !important;
    padding: 0.12rem 0.3rem !important;
    height: 26px !important;
  }

  .clock-badge .clock-icon {
    font-size: 0.72rem !important;
  }

  .clock-badge .clock-time {
    font-size: 0.72rem !important;
  }

  .clock-badge .clock-date {
    display: none !important;
  }

  .capsule-divider {
    display: block !important;
    height: 12px !important;
    width: 1px !important;
    background: rgba(56, 189, 248, 0.2) !important;
  }

  /* Keep Session Stopwatch visible & compact on smartphones */
  .session-timer-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.2rem !important;
    padding: 0.12rem 0.3rem !important;
    height: 26px !important;
    font-size: 0.72rem !important;
  }

  .session-timer-badge .timer-icon {
    font-size: 0.72rem !important;
  }

  .session-timer-badge .session-time {
    font-size: 0.72rem !important;
  }

  .session-timer-badge .session-status-tag {
    display: none !important;
  }

  .session-timer-badge .mini-icon-btn {
    font-size: 0.62rem !important;
    padding: 1px 2px !important;
  }

  .minutes-pill {
    padding: 0.12rem 0.35rem !important;
    height: 26px !important;
    font-size: 0.72rem !important;
    gap: 0.2rem !important;
  }

  .minutes-val {
    font-size: 0.72rem !important;
  }

  .refresh-mini-btn,
  .extend-mini-btn,
  .minutes-unit {
    display: none !important;
  }

  .buy-mini-btn {
    padding: 0.12rem 0.32rem !important;
    font-size: 0.66rem !important;
  }

  .header-right {
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
  }

  .header-actions-group {
    gap: 0.25rem !important;
  }

  .icon-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .install-pwa-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
    min-width: 32px !important;
  }

  .install-pwa-btn .install-pwa-text {
    display: none !important;
  }

  .user-avatar-pill {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  .user-avatar-pill-text {
    display: none !important;
  }

  .user-avatar-circle {
    width: 30px !important;
    height: 30px !important;
  }

  /* Compact Cards for 3" to 5" Displays */
  .featured-master-banner {
    padding: 0.85rem 0.75rem !important;
  }

  .featured-master-title {
    font-size: 1.05rem !important;
  }

  .center-category-showcase {
    padding: 0.85rem 0.75rem !important;
  }

  .ai-card-item {
    padding: 0.75rem 0.8rem !important;
  }

  /* Frozen Docked Input on Portrait Mobile */
  .chat-input-wrapper {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: rgba(11, 15, 25, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.85) !important;
    padding: 0.35rem 2% max(0.55rem, env(safe-area-inset-bottom, 0px)) 2% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .footer-activity-hub {
    margin: 0.3rem auto 0.12rem auto !important;
  }

  .footer-activity-hub .activity-hub-capsule {
    padding: 1px 4px !important;
    gap: 0.2rem !important;
  }

  .footer-activity-hub .clock-date {
    display: none !important;
  }

  .ai-disclaimer {
    font-size: 0.68rem !important;
  }

  .disclaimer-sub {
    font-size: 0.6rem !important;
  }
}

/* Compact Smartphones & Mini Displays (3" to 4.7" screens, 240px - 380px) */
@media (max-width: 380px) {
  :root {
    --header-height: 52px;
  }

  .top-header {
    height: var(--header-height);
    padding: 0 0.35rem !important;
    gap: 0.2rem !important;
  }

  .brand-name {
    font-size: 0.94rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.56rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    line-height: 1.1;
  }

  .brand-logo {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.82rem !important;
  }

  .icon-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.78rem !important;
  }

  .minutes-pill {
    padding: 0.15rem 0.35rem !important;
    font-size: 0.68rem !important;
    gap: 0.2rem !important;
  }

  .buy-mini-btn {
    padding: 0.12rem 0.3rem !important;
    font-size: 0.65rem !important;
  }

  .user-avatar-circle {
    width: 28px !important;
    height: 28px !important;
  }

  .chat-messages {
    padding: 0.6rem 0.35rem calc(150px + env(safe-area-inset-bottom, 0px)) 0.35rem !important;
    gap: 0.75rem !important;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }

  .message-bubble {
    font-size: 1.02rem !important;
    line-height: 1.65 !important;
    padding: 0.95rem 1rem !important;
    max-width: calc(100% - 32px);
  }

  .chat-input-wrapper {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: rgba(11, 15, 25, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.9) !important;
    padding: 0.3rem 0.35rem max(0.45rem, env(safe-area-inset-bottom, 0px)) 0.35rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .input-container {
    width: 95% !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    padding: 0.25rem 0.5rem !important;
    gap: 0.4rem !important;
    min-height: 44px !important;
    border-radius: 22px !important;
    align-items: center !important;
  }

  #chatInput {
    font-size: 16px !important;
    padding: 0.28rem 0.2rem !important;
    height: 34px !important;
    min-height: 34px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
  }

  .mic-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 0.88rem !important;
    flex-shrink: 0 !important;
  }

  .send-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 0.92rem !important;
    flex-shrink: 0 !important;
  }

  .modal-card {
    max-height: 95vh !important;
  }

  .modal-header {
    padding: 0.75rem 0.85rem;
  }

  .modal-body {
    padding: 0.85rem 0.75rem;
  }

  .right-topics-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===================================================================
   Amba AI — Active Session Indicator & Minutes Protection Styles
   =================================================================== */

/* Session Status Tag in Timer Badge */
.session-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.3s ease;
  user-select: none;
}

.session-status-tag.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.session-status-tag.status-inactive {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background-color: currentColor;
}

.session-status-tag.status-active .status-pulse-dot {
  animation: pulseActiveDot 1.6s infinite ease-in-out;
  box-shadow: 0 0 8px #10b981;
}

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

/* Zero Minutes Warning Pill State */
.minutes-pill.zero-minutes {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
  animation: pulseZeroMinutes 2.5s infinite ease-in-out;
}

.minutes-pill.zero-minutes .minutes-val {
  color: #f87171 !important;
}

@keyframes pulseZeroMinutes {
  0%, 100% { border-color: rgba(239, 68, 68, 0.4); }
  50% { border-color: rgba(239, 68, 68, 0.85); box-shadow: 0 0 16px rgba(239, 68, 68, 0.5); }
}

/* Zero Minutes Workspace Banner */
.zero-minutes-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  margin: 0.5rem 1.25rem 0.25rem 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: fadeInBanner 0.3s ease;
}

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

.zero-minutes-banner .banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.4;
}

.banner-bolt-icon {
  font-size: 1.35rem;
  color: #fbbf24;
  flex-shrink: 0;
  animation: pulseActiveDot 2s infinite ease-in-out;
}

.banner-bold {
  color: #fde68a;
  font-weight: 700;
}

.banner-sub {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.buy-banner-action-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.buy-banner-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* ===================================================================
   Amba AI — Full Lockout Authentication Gate
   Enforces: "Without login Amba AI not accessible"
   =================================================================== */
#authModal {
  z-index: 10000 !important;
}

.login-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: gateFadeIn 0.35s ease;
}

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

.login-gate-card {
  width: 100%;
  max-width: 580px;
  background: linear-gradient(145deg, rgba(20, 30, 52, 0.95), rgba(13, 20, 36, 0.98));
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(14, 165, 233, 0.15);
  position: relative;
  overflow: hidden;
}

.login-gate-card::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(ellipse, rgba(14, 165, 233, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.gate-icon-glow {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.15rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  color: #38bdf8;
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.gate-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.gate-subtitle {
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.gate-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
  text-align: left;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}

.gate-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.gate-feature-item i {
  color: #38bdf8;
  margin-top: 2px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.gate-btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.96rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.gate-btn-signin {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.4);
}

.gate-btn-signin:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(14, 165, 233, 0.6);
}

.gate-btn-signup {
  background: rgba(30, 41, 59, 0.85);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.gate-btn-signup:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.gate-footer-note {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

@media (max-width: 600px) {
  .login-gate-card {
    padding: 1.6rem 1.25rem;
  }
  .gate-features-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.85rem;
  }
  .gate-title {
    font-size: 1.35rem;
  }
  .zero-minutes-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.5rem 0.65rem;
    padding: 0.75rem 0.85rem;
  }
  .buy-banner-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===================================================================
   Amba AI — Progressive Web App (PWA) & Offline Styles
   =================================================================== */
.install-pwa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(99, 102, 241, 0.22));
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  padding: 0.38rem 0.82rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
  flex-shrink: 0;
}

.install-pwa-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff;
  border-color: #67e8f9;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.5);
  transform: translateY(-1px);
}

.install-pwa-btn:active {
  transform: translateY(0);
}

.install-pwa-btn i {
  font-size: 0.84rem;
}

/* PWA Install Guide Modal */
.pwa-install-modal-card {
  max-width: 680px !important;
  width: 95vw !important;
}

.pwa-install-hero {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.15rem;
}

.pwa-hero-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.pwa-hero-text h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.pwa-hero-text p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.pwa-platforms-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pwa-platform-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  transition: all 0.22s ease;
}

.pwa-platform-card.highlighted {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.94rem;
  color: #ffffff;
  margin-bottom: 0.55rem;
}

.platform-header i {
  font-size: 1.15rem;
}

.pwa-steps-list {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.48;
}

.pwa-steps-list strong {
  color: #f8fafc;
}

.pwa-direct-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-direct-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.45);
}

.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 0.55rem 1rem;
  margin: 0.5rem 1.25rem 0.25rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  animation: fadeInBanner 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.offline-banner i {
  color: #ef4444;
  font-size: 0.95rem;
}

@media (max-width: 680px) {
  .install-pwa-btn .install-pwa-text {
    display: none;
  }
  .install-pwa-btn {
    padding: 0.45rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    justify-content: center;
  }
  .offline-banner {
    margin: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }
}

/* ===================================================================
   Amba AI — Mobile View & PWA: Zoomed Close-Camera & High-Contrast Upgrade
   =================================================================== */

/* 1. Mobile Responsive View (Up to 768px): Zoomed Macro Close-Camera Effect & High Brightness */
@media (max-width: 768px) {
  html {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
  }

  body {
    font-size: 1.05rem !important;
    color: #f8fafc !important;
    background-color: #080c14 !important;
  }

  /* Topbar High-Contrast Brand Text */
  .brand-name {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    letter-spacing: -0.01em !important;
  }

  .brand-tag {
    display: block !important;
    font-size: 0.62rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
  }

  .brand-logo {
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4) !important;
  }

  /* Chat Messages: Zoomed Close-Camera Macro Lens Typography & Card Depth */
  .message-content,
  .markdown-content,
  .message-bubble,
  .assistant-row .message-bubble,
  .message-row.assistant-row .message-bubble {
    font-size: 1.1rem !important;
    line-height: 1.72 !important;
    color: #ffffff !important;
    letter-spacing: 0.01em !important;
  }

  .message-content p,
  .markdown-content p,
  .message-bubble p {
    font-size: 1.1rem !important;
    line-height: 1.72 !important;
    color: #f8fafc !important;
    margin-bottom: 0.95rem !important;
  }

  .message-content li,
  .markdown-content li,
  .message-bubble li {
    font-size: 1.06rem !important;
    line-height: 1.68 !important;
    color: #f1f5f9 !important;
    margin-bottom: 0.6rem !important;
  }

  .message-content ul,
  .markdown-content ul,
  .message-bubble ul,
  .message-content ol,
  .markdown-content ol,
  .message-bubble ol {
    padding-left: 1.45rem !important;
    margin-bottom: 0.95rem !important;
  }

  .message-content li::marker,
  .markdown-content li::marker,
  .message-bubble li::marker {
    color: #38bdf8 !important;
    font-size: 1.18em !important;
    font-weight: bold !important;
  }

  .message-content h1,
  .markdown-content h1,
  .message-bubble h1,
  .message-content h2,
  .markdown-content h2,
  .message-bubble h2,
  .message-content h3,
  .markdown-content h3,
  .message-bubble h3,
  .message-content h4,
  .markdown-content h4,
  .message-bubble h4 {
    color: #38bdf8 !important;
    font-weight: 800 !important;
    letter-spacing: 0.015em !important;
    margin-top: 1.15rem !important;
    margin-bottom: 0.55rem !important;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.25) !important;
  }

  .message-content h1, .markdown-content h1, .message-bubble h1 { font-size: 1.45rem !important; }
  .message-content h2, .markdown-content h2, .message-bubble h2 { font-size: 1.3rem !important; }
  .message-content h3, .markdown-content h3, .message-bubble h3 { font-size: 1.18rem !important; }
  .message-content h4, .markdown-content h4, .message-bubble h4 { font-size: 1.08rem !important; }

  .message-content strong,
  .markdown-content strong,
  .message-bubble strong,
  .message-content b,
  .markdown-content b,
  .message-bubble b {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.4) !important;
  }

  .message-content code:not(pre code),
  .markdown-content code:not(pre code),
  .message-bubble code:not(pre code) {
    font-size: 0.96rem !important;
    color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    padding: 0.2rem 0.48rem !important;
    border-radius: 6px !important;
    font-family: var(--font-code) !important;
  }

  .message-content pre,
  .markdown-content pre,
  .message-bubble pre {
    font-size: 0.95rem !important;
    line-height: 1.58 !important;
    background: #080d1a !important;
    border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
    padding: 0.95rem 1.1rem !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Assistant Message Bubble: Close-Camera Card Depth */
  .assistant-row .message-bubble,
  .message-row.assistant-row .message-bubble {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 18px !important;
    padding: 1.2rem 1.35rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(56, 189, 248, 0.16) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  /* User Message Bubble: Punchy & High-Contrast */
  .user-row .message-bubble,
  .message-row.user-row .message-bubble {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 18px 18px 4px 18px !important;
    padding: 0.95rem 1.25rem !important;
    color: #ffffff !important;
    font-size: 1.06rem !important;
    line-height: 1.55 !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
  }

  .message-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4) !important;
  }

  /* Chat Input: 16px to prevent iOS auto-zoom jump, high brightness text */
  .chat-input-textarea,
  #chatInput {
    font-size: 16px !important;
    line-height: 1.4 !important;
    color: #ffffff !important;
    background: transparent !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0.32rem 0.25rem !important;
    box-sizing: border-box !important;
  }

  #chatInput::placeholder {
    color: #94a3b8 !important;
    font-size: 0.92rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
  }

  /* Action & Followup Buttons: Touch-friendly & Vibrant */
  .followup-chip,
  .suggestion-chip {
    font-size: 0.94rem !important;
    font-weight: 600 !important;
    color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    padding: 0.6rem 1rem !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    border-radius: var(--radius-full) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }

  /* Cards in Center Screen & Right Screen: High Brightness */
  .ai-card-title,
  .item-title {
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
  }

  .ai-card-desc,
  .item-desc {
    font-size: 0.88rem !important;
    line-height: 1.48 !important;
    color: #cbd5e1 !important;
  }

  .welcome-screen h1,
  .welcome-center-hero h1,
  .welcome-hero-title {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem) !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8) !important;
  }

  .welcome-sub,
  .welcome-center-hero .welcome-sub,
  .welcome-hero-desc {
    font-size: 0.98rem !important;
    line-height: 1.55 !important;
    margin-bottom: 0.85rem !important;
    max-width: 98% !important;
    color: #cbd5e1 !important;
    font-weight: 500 !important;
  }

  /* Language Selector & Controls: Bright & Touch-optimized */
  .styled-select,
  select.styled-select {
    font-size: 0.92rem !important;
    color: #ffffff !important;
    background: #0f172a !important;
    min-height: 40px !important;
    padding: 0.35rem 0.75rem !important;
  }
}

/* ===================================================================
   2. KaTeX Math, Physics, Statistics & Chemistry (\ce{...}) Styles
   =================================================================== */
.katex {
  font-size: 1.1em;
  line-height: 1.25;
  text-rendering: auto;
}

.katex-display {
  display: block !important;
  margin: 1rem 0 !important;
  padding: 0.85rem 0.6rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  font-size: 1.2rem !important;
  text-align: center !important;
  color: #ffffff !important;
}

.katex-display::-webkit-scrollbar {
  height: 5px;
}

.katex-display::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

/* LaTeX / TeX Formula Card Container */
.latex-formula-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  margin: 1.1rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.latex-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.95rem;
  background: rgba(30, 41, 59, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.latex-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #38bdf8;
  font-size: 0.86rem;
  font-weight: 600;
}

.latex-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.latex-card-stage {
  padding: 1.2rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  color: #ffffff;
}

.latex-code-collapsed {
  display: none !important;
}

/* ===================================================================
   3. Mermaid Architecture & Flowchart Diagrams Styles
   =================================================================== */
.mermaid-diagram-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  margin: 1.2rem 0;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.mermaid-diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.95rem;
  background: rgba(30, 41, 59, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mermaid-diagram-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #38bdf8;
  font-size: 0.88rem;
  font-weight: 600;
}

.mermaid-diagram-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mermaid-stage {
  padding: 1.25rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.mermaid-stage svg {
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto;
}

.mermaid-code-collapsed {
  display: none !important;
}

.mermaid-loading {
  color: #38bdf8;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 1.5rem;
}

.mermaid-fallback-notice {
  color: #f59e0b;
  font-size: 0.86rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===================================================================
   4. PWA Standalone Mode: Native App Feel, Zoomed & Vivid Display
   =================================================================== */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  html {
    font-size: 16.5px !important;
    -webkit-text-size-adjust: 100% !important;
  }

  body {
    font-size: 1.05rem !important;
    background-color: #060911 !important;
    color: #ffffff !important;
  }

  .top-header {
    padding-top: max(0.5rem, env(safe-area-inset-top));
    height: calc(var(--header-height) + max(0.5rem, env(safe-area-inset-top)));
    background: rgba(11, 15, 25, 0.98) !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
  }

  .brand-name {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  }

  .brand-tag {
    display: block !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
  }

  /* Automatically hide PWA Install button in standalone installed mode */
  .install-pwa-btn,
  #pwaInstallBtn {
    display: none !important;
  }

  /* Display the verified active PWA badge in header */
  .pwa-mode-badge,
  #pwaActiveBadge {
    display: inline-flex !important;
  }

  .chat-container {
    padding-bottom: 0 !important;
  }

  .chat-messages {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .message-content,
  .markdown-content,
  .message-bubble {
    font-size: 1.1rem !important;
    line-height: 1.72 !important;
    color: #ffffff !important;
  }

  .message-content p,
  .markdown-content p,
  .message-bubble p {
    font-size: 1.1rem !important;
    color: #ffffff !important;
  }

  .message-content li,
  .markdown-content li,
  .message-bubble li {
    font-size: 1.06rem !important;
    color: #f8fafc !important;
  }

  .chat-input-wrapper {
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom)) !important;
  }

  .chat-input-box {
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.75) !important;
    border-top: 1px solid rgba(56, 189, 248, 0.4) !important;
  }

  .chat-input-textarea,
  #chatInput {
    font-size: 16.5px !important;
    color: #ffffff !important;
  }
}

/* Standalone body helper class applied via JS */
body.pwa-standalone .install-pwa-btn,
body.pwa-standalone #pwaInstallBtn {
  display: none !important;
}

body.pwa-standalone .pwa-mode-badge,
body.pwa-standalone #pwaActiveBadge {
  display: inline-flex !important;
}

/* ===================================================================
   5. Light Theme Mode: Full WCAG AAA Contrast Compliance
      Active when phone/browser is set to Light Display Setting
      or when body has .light-theme
   =================================================================== */
/* ===================================================================
   5. Light Theme Mode: Full WCAG AAA Contrast Compliance
      Active when phone/browser is set to Light Display Setting
      or when body has .light-theme
   =================================================================== */

/* Color Scheme CSS Variables & Dark Theme Resilience */
body.dark-theme {
  color-scheme: dark !important;
  --bg-primary: #0a0e17 !important;
  --bg-secondary: #111827 !important;
  --bg-tertiary: #1f293d !important;
  --bg-card: rgba(26, 34, 52, 0.7) !important;
  --bg-glass: rgba(17, 24, 39, 0.75) !important;
  --border-subtle: rgba(255, 255, 255, 0.08) !important;
  --border-focus: #38bdf8 !important;
  --text-main: #f8fafc !important;
  --text-muted: #94a3b8 !important;
  --text-dim: #64748b !important;
  --accent-cyan: #06b6d4 !important;
  --accent-blue: #3b82f6 !important;
  --accent-emerald: #10b981 !important;
  --accent-amber: #f59e0b !important;
  --accent-rose: #f43f5e !important;
}

body.dark-theme .user-profile-menu {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
}

body.dark-theme .user-profile-menu::-webkit-scrollbar {
  width: 5px !important;
}

body.dark-theme .user-profile-menu::-webkit-scrollbar-track {
  background: transparent !important;
}

body.dark-theme .user-profile-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 999px !important;
}

body.dark-theme .user-profile-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35) !important;
}

body.dark-theme .welcome-screen h1,
body.dark-theme .welcome-center-hero h1,
body.dark-theme .welcome-hero-title {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .welcome-sub,
body.dark-theme .welcome-center-hero .welcome-sub,
body.dark-theme .welcome-hero-desc {
  color: #cbd5e1 !important;
}

/* Rules applied under both class-based (.light-theme) and system preference */
body.light-theme,
body:not(.dark-theme) {
  color-scheme: light !important;
  --bg-primary: #f8fafc !important;
  --bg-secondary: #ffffff !important;
  --bg-tertiary: #f1f5f9 !important;
  --bg-card: rgba(255, 255, 255, 0.97) !important;
  --bg-glass: rgba(255, 255, 255, 0.95) !important;
  --border-subtle: #e2e8f0 !important;
  --border-focus: #0284c7 !important;
  --text-main: #0f172a !important;
  --text-muted: #475569 !important;
  --text-dim: #64748b !important;
  --accent-cyan: #0284c7 !important;
  --accent-blue: #2563eb !important;
  --accent-emerald: #059669 !important;
  --accent-amber: #d97706 !important;
  --accent-rose: #dc2626 !important;
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* Header & Brand */
body.light-theme .top-header,
body:not(.dark-theme) .top-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .brand-name,
body:not(.dark-theme) .brand-name {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: none !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}

body.light-theme .brand-tag,
body:not(.dark-theme) .brand-tag {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .brand-logo,
body:not(.dark-theme) .brand-logo {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

body.light-theme .icon-btn,
body.light-theme .header-nav-btn,
body.light-theme .mobile-controls-toggle,
body:not(.dark-theme) .icon-btn,
body:not(.dark-theme) .header-nav-btn,
body:not(.dark-theme) .mobile-controls-toggle {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-theme .icon-btn:hover,
body.light-theme .icon-btn.active,
body:not(.dark-theme) .icon-btn:hover,
body:not(.dark-theme) .icon-btn.active {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .install-pwa-btn,
body:not(.dark-theme) .install-pwa-btn {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .pwa-mode-badge,
body:not(.dark-theme) .pwa-mode-badge {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #047857 !important;
}

body.light-theme .pwa-mode-badge i,
body:not(.dark-theme) .pwa-mode-badge i {
  color: #059669 !important;
}

body.light-theme .user-avatar-pill,
body:not(.dark-theme) .user-avatar-pill {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .user-avatar-pill:hover,
body.light-theme .user-auth-wrapper.dropdown-open .user-avatar-pill,
body:not(.dark-theme) .user-avatar-pill:hover,
body:not(.dark-theme) .user-auth-wrapper.dropdown-open .user-avatar-pill {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .user-avatar-name,
body:not(.dark-theme) .user-avatar-name {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

body.light-theme .user-avatar-circle,
body.light-theme .user-avatar-circle.logged-avatar-circle,
body:not(.dark-theme) .user-avatar-circle,
body:not(.dark-theme) .user-avatar-circle.logged-avatar-circle {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .guest-avatar-pill,
body:not(.dark-theme) .guest-avatar-pill {
  background: #f0f9ff !important;
  border: 1.5px solid #7dd3fc !important;
}

body.light-theme .guest-avatar-circle,
body:not(.dark-theme) .guest-avatar-circle {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

body.light-theme .guest-avatar-pill .user-avatar-name,
body:not(.dark-theme) .guest-avatar-pill .user-avatar-name {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .avatar-status-dot,
body:not(.dark-theme) .avatar-status-dot {
  border-color: #ffffff !important;
}

/* Chat Canvas & Messages */
body.light-theme .chat-container,
body.light-theme .chat-messages,
body:not(.dark-theme) .chat-container,
body:not(.dark-theme) .chat-messages {
  background: #f8fafc !important;
}

body.light-theme .assistant-row .message-bubble,
body.light-theme .message-row:not(.user-row) .message-bubble,
body:not(.dark-theme) .assistant-row .message-bubble,
body:not(.dark-theme) .message-row:not(.user-row) .message-bubble {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

body.light-theme .message-content,
body.light-theme .markdown-content,
body:not(.dark-theme) .message-content,
body:not(.dark-theme) .markdown-content {
  color: #0f172a !important;
}

body.light-theme .message-content p,
body.light-theme .markdown-content p,
body:not(.dark-theme) .message-content p,
body:not(.dark-theme) .markdown-content p {
  color: #1e293b !important;
}

body.light-theme .message-content li,
body.light-theme .markdown-content li,
body:not(.dark-theme) .message-content li,
body:not(.dark-theme) .markdown-content li {
  color: #1e293b !important;
}

body.light-theme .message-content li::marker,
body.light-theme .markdown-content li::marker,
body:not(.dark-theme) .message-content li::marker,
body:not(.dark-theme) .markdown-content li::marker {
  color: #0284c7 !important;
}

body.light-theme .message-content h1,
body.light-theme .markdown-content h1,
body.light-theme .message-content h2,
body.light-theme .markdown-content h2,
body.light-theme .message-content h3,
body.light-theme .markdown-content h3,
body.light-theme .message-content h4,
body.light-theme .markdown-content h4,
body:not(.dark-theme) .message-content h1,
body:not(.dark-theme) .markdown-content h1,
body:not(.dark-theme) .message-content h2,
body:not(.dark-theme) .markdown-content h2,
body:not(.dark-theme) .message-content h3,
body:not(.dark-theme) .markdown-content h3,
body:not(.dark-theme) .message-content h4,
body:not(.dark-theme) .markdown-content h4 {
  color: #0369a1 !important;
  text-shadow: none !important;
}

body.light-theme .message-content strong,
body.light-theme .markdown-content strong,
body.light-theme .message-bubble strong,
body.light-theme .message-content b,
body.light-theme .markdown-content b,
body.light-theme .message-bubble b,
body:not(.dark-theme) .message-content strong,
body:not(.dark-theme) .markdown-content strong,
body:not(.dark-theme) .message-bubble strong,
body:not(.dark-theme) .message-content b,
body:not(.dark-theme) .markdown-content b,
body:not(.dark-theme) .message-bubble b {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.light-theme .user-row .message-bubble,
body.light-theme .message-row.user-row .message-bubble,
body:not(.dark-theme) .user-row .message-bubble,
body:not(.dark-theme) .message-row.user-row .message-bubble {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
}

/* Center Screen Welcome Hero & Banners */
body.light-theme .welcome-screen h1,
body.light-theme .welcome-center-hero h1,
body.light-theme .welcome-hero-title,
body:not(.dark-theme) .welcome-screen h1,
body:not(.dark-theme) .welcome-center-hero h1,
body:not(.dark-theme) .welcome-hero-title {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: none !important;
  text-shadow: none !important;
}

body.light-theme .welcome-sub,
body.light-theme .welcome-center-hero .welcome-sub,
body.light-theme .welcome-hero-desc,
body:not(.dark-theme) .welcome-sub,
body:not(.dark-theme) .welcome-center-hero .welcome-sub,
body:not(.dark-theme) .welcome-hero-desc {
  color: #475569 !important;
}

body.light-theme .welcome-badge,
body:not(.dark-theme) .welcome-badge {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

body.light-theme .center-domain-pill,
body:not(.dark-theme) .center-domain-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .center-domain-pill:hover,
body:not(.dark-theme) .center-domain-pill:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .center-domain-pill.active,
body:not(.dark-theme) .center-domain-pill.active {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .center-domain-pill .pill-badge,
body:not(.dark-theme) .center-domain-pill .pill-badge {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

body.light-theme .welcome-guide-banner,
body:not(.dark-theme) .welcome-guide-banner {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .welcome-guide-banner .banner-icon,
body:not(.dark-theme) .welcome-guide-banner .banner-icon {
  background: rgba(2, 132, 199, 0.1) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

body.light-theme .welcome-guide-banner .banner-text strong,
body:not(.dark-theme) .welcome-guide-banner .banner-text strong {
  color: #0f172a !important;
}

body.light-theme .welcome-guide-banner .banner-text span,
body:not(.dark-theme) .welcome-guide-banner .banner-text span {
  color: #475569 !important;
}

body.light-theme .welcome-guide-banner .btn-focus-panel,
body:not(.dark-theme) .welcome-guide-banner .btn-focus-panel {
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  color: #ffffff !important;
}

body.light-theme .featured-master-banner,
body:not(.dark-theme) .featured-master-banner {
  background: #ffffff !important;
  border: 1.5px solid #f59e0b !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.1) !important;
}

body.light-theme .featured-master-badge,
body:not(.dark-theme) .featured-master-badge {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #d97706 !important;
  font-weight: 800 !important;
}

body.light-theme .featured-master-title,
body:not(.dark-theme) .featured-master-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}

body.light-theme .featured-master-desc,
body:not(.dark-theme) .featured-master-desc {
  color: #475569 !important;
}

body.light-theme .featured-master-tags .f-tag,
body:not(.dark-theme) .featured-master-tags .f-tag {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-theme .btn-start-featured,
body:not(.dark-theme) .btn-start-featured {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0f172a !important;
  font-weight: 800 !important;
}

body.light-theme .btn-browse-category,
body:not(.dark-theme) .btn-browse-category {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

body.light-theme .center-category-showcase,
body:not(.dark-theme) .center-category-showcase {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .showcase-header-left h3,
body:not(.dark-theme) .showcase-header-left h3 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-theme .showcase-subtitle,
body:not(.dark-theme) .showcase-subtitle {
  color: #64748b !important;
}

body.light-theme .showcase-pill,
body:not(.dark-theme) .showcase-pill {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

body.light-theme .ai-card-item,
body:not(.dark-theme) .ai-card-item {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .ai-card-item:hover,
body:not(.dark-theme) .ai-card-item:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.12) !important;
}

body.light-theme .ai-card-title,
body:not(.dark-theme) .ai-card-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-theme .ai-card-desc,
body:not(.dark-theme) .ai-card-desc {
  color: #475569 !important;
}

body.light-theme .ai-card-tag,
body:not(.dark-theme) .ai-card-tag {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

body.light-theme .ai-card-action,
body:not(.dark-theme) .ai-card-action {
  color: #0284c7 !important;
}

body.light-theme .ai-card-footer,
body:not(.dark-theme) .ai-card-footer {
  border-top: 1px solid #e2e8f0 !important;
}

/* Bottom Chat Input Bar & Unified Footer Activity Hub */
body.light-theme .chat-input-wrapper,
body:not(.dark-theme) .chat-input-wrapper {
  background: rgba(255, 255, 255, 0.98) !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .input-container,
body.light-theme .chat-input-container,
body.light-theme .chat-input-box,
body:not(.dark-theme) .input-container,
body:not(.dark-theme) .chat-input-container,
body:not(.dark-theme) .chat-input-box {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .input-container:focus-within,
body:not(.dark-theme) .input-container:focus-within {
  border-color: #0284c7 !important;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.25), 0 4px 18px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .chat-input-textarea,
body.light-theme #chatInput,
body:not(.dark-theme) .chat-input-textarea,
body:not(.dark-theme) #chatInput {
  background: transparent !important;
  color: #0f172a !important;
}

body.light-theme #chatInput::placeholder,
body:not(.dark-theme) #chatInput::placeholder {
  color: #64748b !important;
}

body.light-theme .mic-btn,
body:not(.dark-theme) .mic-btn {
  color: #64748b !important;
}

body.light-theme .mic-btn:hover,
body:not(.dark-theme) .mic-btn:hover {
  color: #0284c7 !important;
  background: #f1f5f9 !important;
}

body.light-theme #sendBtn,
body:not(.dark-theme) #sendBtn {
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  color: #ffffff !important;
}

body.light-theme .footer-activity-hub,
body:not(.dark-theme) .footer-activity-hub {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.light-theme .activity-hub-capsule,
body:not(.dark-theme) .activity-hub-capsule {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .capsule-divider,
body:not(.dark-theme) .capsule-divider {
  background: #cbd5e1 !important;
}

body.light-theme .clock-badge,
body.light-theme .clock-time,
body:not(.dark-theme) .clock-badge,
body:not(.dark-theme) .clock-time {
  color: #0f172a !important;
}

body.light-theme .clock-date,
body:not(.dark-theme) .clock-date {
  color: #475569 !important;
}

body.light-theme .clock-icon,
body:not(.dark-theme) .clock-icon {
  color: #0284c7 !important;
}

body.light-theme .session-timer-badge,
body.light-theme .session-time,
body:not(.dark-theme) .session-timer-badge,
body:not(.dark-theme) .session-time {
  color: #0f172a !important;
}

body.light-theme .session-status-tag.status-inactive,
body:not(.dark-theme) .session-status-tag.status-inactive {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

body.light-theme .session-status-tag.status-active,
body:not(.dark-theme) .session-status-tag.status-active {
  background: #dcfce7 !important;
  color: #15803d !important;
}

body.light-theme .timer-actions-wrap .mini-icon-btn,
body:not(.dark-theme) .timer-actions-wrap .mini-icon-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-theme .timer-actions-wrap .mini-icon-btn:hover,
body:not(.dark-theme) .timer-actions-wrap .mini-icon-btn:hover {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

body.light-theme .minutes-pill,
body.light-theme .minutes-balance-pill,
body:not(.dark-theme) .minutes-pill,
body:not(.dark-theme) .minutes-balance-pill {
  color: #0f172a !important;
}

body.light-theme .minutes-pill .minutes-val,
body:not(.dark-theme) .minutes-pill .minutes-val {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .refresh-mini-btn,
body:not(.dark-theme) .refresh-mini-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-theme .extend-mini-btn,
body:not(.dark-theme) .extend-mini-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
}

body.light-theme .buy-mini-btn,
body:not(.dark-theme) .buy-mini-btn {
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  color: #ffffff !important;
}

body.light-theme .input-footer-note,
body.light-theme .chat-disclaimer,
body.light-theme .ai-disclaimer,
body:not(.dark-theme) .input-footer-note,
body:not(.dark-theme) .chat-disclaimer,
body:not(.dark-theme) .ai-disclaimer {
  color: #64748b !important;
}

/* Right-Hand Split-Screen Topics Panel in Light Mode */
body.light-theme .right-topics-panel,
body:not(.dark-theme) .right-topics-panel {
  background: #ffffff !important;
  border-left: 1px solid #e2e8f0 !important;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .right-panel-header,
body:not(.dark-theme) .right-panel-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .right-panel-title,
body:not(.dark-theme) .right-panel-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-theme .right-panel-close-btn,
body:not(.dark-theme) .right-panel-close-btn {
  color: #64748b !important;
}

body.light-theme .right-panel-close-btn:hover,
body:not(.dark-theme) .right-panel-close-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

body.light-theme .right-panel-search,
body:not(.dark-theme) .right-panel-search {
  background: #ffffff !important;
}

body.light-theme .right-panel-search i,
body:not(.dark-theme) .right-panel-search i {
  color: #64748b !important;
}

body.light-theme .right-panel-search input,
body:not(.dark-theme) .right-panel-search input {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .right-panel-search input::placeholder,
body:not(.dark-theme) .right-panel-search input::placeholder {
  color: #94a3b8 !important;
}

body.light-theme .right-panel-search input:focus,
body:not(.dark-theme) .right-panel-search input:focus {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15) !important;
}

body.light-theme .right-panel-tabs,
body:not(.dark-theme) .right-panel-tabs {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .right-tab-btn,
body:not(.dark-theme) .right-tab-btn {
  color: #64748b !important;
}

body.light-theme .right-tab-btn:hover,
body:not(.dark-theme) .right-tab-btn:hover {
  color: #0284c7 !important;
  background: #f8fafc !important;
}

body.light-theme .right-tab-btn.active,
body:not(.dark-theme) .right-tab-btn.active {
  color: #0284c7 !important;
  border-bottom-color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .right-domain-pills,
body:not(.dark-theme) .right-domain-pills {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .right-domain-pill,
body:not(.dark-theme) .right-domain-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-theme .right-domain-pill:hover,
body:not(.dark-theme) .right-domain-pill:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .right-domain-pill.active,
body:not(.dark-theme) .right-domain-pill.active {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .right-domain-pill .pill-cnt,
body:not(.dark-theme) .right-domain-pill .pill-cnt {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

body.light-theme .right-domain-pill.active .pill-cnt,
body:not(.dark-theme) .right-domain-pill.active .pill-cnt {
  background: #0284c7 !important;
  color: #ffffff !important;
}

body.light-theme .right-domain-header,
body:not(.dark-theme) .right-domain-header {
  background: #f1f5f9 !important;
  border-left: 3px solid #0284c7 !important;
  color: #0f172a !important;
}

body.light-theme .right-domain-header i,
body:not(.dark-theme) .right-domain-header i {
  color: #0284c7 !important;
}

body.light-theme .right-domain-header .badge,
body:not(.dark-theme) .right-domain-header .badge {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

body.light-theme .right-panel-body,
body:not(.dark-theme) .right-panel-body {
  background: #ffffff !important;
}

body.light-theme .right-quick-item,
body.light-theme .right-quick-cards-list .right-quick-item,
body:not(.dark-theme) .right-quick-item,
body:not(.dark-theme) .right-quick-cards-list .right-quick-item {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .right-quick-item:hover,
body.light-theme .right-quick-cards-list .right-quick-item:hover,
body:not(.dark-theme) .right-quick-item:hover,
body:not(.dark-theme) .right-quick-cards-list .right-quick-item:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12) !important;
}

body.light-theme .right-quick-item .item-title,
body.light-theme .right-quick-cards-list .item-title,
body:not(.dark-theme) .right-quick-item .item-title,
body:not(.dark-theme) .right-quick-cards-list .item-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.light-theme .right-quick-item .item-desc,
body.light-theme .right-quick-cards-list .item-desc,
body:not(.dark-theme) .right-quick-item .item-desc,
body:not(.dark-theme) .right-quick-cards-list .item-desc {
  color: #475569 !important;
}

body.light-theme .right-quick-item .item-icon,
body.light-theme .right-quick-cards-list .item-icon,
body:not(.dark-theme) .right-quick-item .item-icon,
body:not(.dark-theme) .right-quick-cards-list .item-icon {
  color: #0284c7 !important;
}

body.light-theme .right-quick-item .item-tag-badge,
body.light-theme .right-quick-cards-list .item-tag-badge,
body:not(.dark-theme) .right-quick-item .item-tag-badge,
body:not(.dark-theme) .right-quick-cards-list .item-tag-badge {
  background: rgba(2, 132, 199, 0.08) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

/* Left Sidebar in Light Mode */
body.light-theme .sidebar,
body:not(.dark-theme) .sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme .sidebar-top,
body:not(.dark-theme) .sidebar-top {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .new-topic-btn,
body:not(.dark-theme) .new-topic-btn {
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  color: #ffffff !important;
}

body.light-theme .sidebar-close-btn,
body:not(.dark-theme) .sidebar-close-btn {
  color: #64748b !important;
}

body.light-theme .sidebar-section .section-title,
body:not(.dark-theme) .sidebar-section .section-title {
  color: #0f172a !important;
}

body.light-theme .mode-select,
body:not(.dark-theme) .mode-select {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .topic-item,
body:not(.dark-theme) .topic-item {
  color: #334155 !important;
}

body.light-theme .topic-item:hover,
body:not(.dark-theme) .topic-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-theme .topic-item.active,
body:not(.dark-theme) .topic-item.active {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-left: 3px solid #0284c7 !important;
}

body.light-theme .sidebar-footer,
body:not(.dark-theme) .sidebar-footer {
  border-top: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

body.light-theme .footer-action-btn,
body:not(.dark-theme) .footer-action-btn {
  color: #64748b !important;
}

/* ===================================================================
   Avatar Dropdown in Light Mode — Executive Professional Theme
   =================================================================== */
body.light-theme .user-profile-menu,
body:not(.dark-theme) .user-profile-menu {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 transparent !important;
}

body.light-theme .user-profile-menu::-webkit-scrollbar,
body:not(.dark-theme) .user-profile-menu::-webkit-scrollbar {
  width: 5px !important;
}

body.light-theme .user-profile-menu::-webkit-scrollbar-track,
body:not(.dark-theme) .user-profile-menu::-webkit-scrollbar-track {
  background: transparent !important;
}

body.light-theme .user-profile-menu::-webkit-scrollbar-thumb,
body:not(.dark-theme) .user-profile-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 999px !important;
}

body.light-theme .user-profile-menu::-webkit-scrollbar-thumb:hover,
body:not(.dark-theme) .user-profile-menu::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

/* User Header in Dropdown */
body.light-theme .menu-user-info,
body:not(.dark-theme) .menu-user-info {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 0.65rem 0.75rem !important;
  margin-bottom: 0.4rem !important;
}

body.light-theme .guest-user-info,
body:not(.dark-theme) .guest-user-info {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
}

body.light-theme .menu-user-name,
body:not(.dark-theme) .menu-user-name {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 0.98rem !important;
  line-height: 1.3 !important;
}

body.light-theme .menu-user-email,
body:not(.dark-theme) .menu-user-email {
  color: #475569 !important;
  font-weight: 500 !important;
  font-size: 0.78rem !important;
}

body.light-theme .menu-avatar-large.logged-avatar-large,
body:not(.dark-theme) .menu-avatar-large.logged-avatar-large {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .menu-avatar-large.guest-avatar-large,
body:not(.dark-theme) .menu-avatar-large.guest-avatar-large {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd) !important;
  color: #0284c7 !important;
  border: 1px solid #7dd3fc !important;
}

body.light-theme .user-role-tag.admin,
body:not(.dark-theme) .user-role-tag.admin {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

body.light-theme .user-role-tag.user,
body:not(.dark-theme) .user-role-tag.user {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 700 !important;
}

body.light-theme .user-role-tag.guest,
body:not(.dark-theme) .user-role-tag.guest {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
}

/* Executive Admin Portal Highlight */
body.light-theme .admin-highlight-item,
body:not(.dark-theme) .admin-highlight-item {
  background: #fffbeb !important;
  border: 1.5px solid #fde68a !important;
  border-radius: 10px !important;
}

body.light-theme .admin-highlight-item:hover,
body:not(.dark-theme) .admin-highlight-item:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
}

body.light-theme .admin-highlight-item .menu-item-title,
body.light-theme .admin-title,
body:not(.dark-theme) .admin-highlight-item .menu-item-title,
body:not(.dark-theme) .admin-title {
  color: #92400e !important;
  font-weight: 700 !important;
}

body.light-theme .admin-highlight-item .menu-item-sub,
body:not(.dark-theme) .admin-highlight-item .menu-item-sub {
  color: #78350f !important;
  font-weight: 500 !important;
}

body.light-theme .admin-highlight-item .admin-icon-wrap,
body:not(.dark-theme) .admin-highlight-item .admin-icon-wrap {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fcd34d !important;
}

/* Menu Items, Titles, Descriptions */
body.light-theme .menu-item,
body:not(.dark-theme) .menu-item {
  color: #0f172a !important;
}

body.light-theme .menu-item:hover,
body:not(.dark-theme) .menu-item:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
}

body.light-theme .menu-item-title,
body:not(.dark-theme) .menu-item-title {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-size: 0.84rem !important;
}

body.light-theme .menu-item:hover .menu-item-title,
body:not(.dark-theme) .menu-item:hover .menu-item-title {
  color: #0284c7 !important;
}

body.light-theme .menu-item-sub,
body:not(.dark-theme) .menu-item-sub {
  color: #475569 !important;
  font-size: 0.72rem !important;
  font-weight: 450 !important;
}

body.light-theme .menu-item:hover .menu-item-sub,
body:not(.dark-theme) .menu-item:hover .menu-item-sub {
  color: #334155 !important;
}

/* Menu Item Icon Wraps */
body.light-theme .menu-item-icon-wrap,
body:not(.dark-theme) .menu-item-icon-wrap {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .auth-signin-icon,
body:not(.dark-theme) .auth-signin-icon {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

body.light-theme .auth-signup-icon,
body:not(.dark-theme) .auth-signup-icon {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

body.light-theme .auth-forgot-icon,
body:not(.dark-theme) .auth-forgot-icon {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

body.light-theme .admin-icon-wrap,
body:not(.dark-theme) .admin-icon-wrap {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

body.light-theme .pwa-install-icon,
body:not(.dark-theme) .pwa-install-icon {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

body.light-theme .danger-icon-wrap,
body:not(.dark-theme) .danger-icon-wrap {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}

body.light-theme .menu-item.danger .menu-item-title,
body.light-theme .danger-title,
body:not(.dark-theme) .menu-item.danger .menu-item-title,
body:not(.dark-theme) .danger-title {
  color: #dc2626 !important;
  font-weight: 600 !important;
}

body.light-theme .menu-item.danger .menu-item-sub,
body:not(.dark-theme) .menu-item.danger .menu-item-sub {
  color: #991b1b !important;
}

body.light-theme .menu-item.danger:hover,
body:not(.dark-theme) .menu-item.danger:hover {
  background: #fee2e2 !important;
}

/* Section Header & Divider */
body.light-theme .menu-section-label,
body:not(.dark-theme) .menu-section-label {
  color: #0f172a !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}

body.light-theme .menu-divider,
body:not(.dark-theme) .menu-divider {
  background: #e2e8f0 !important;
  height: 1px !important;
  margin: 0.45rem 0 !important;
}

/* Voice & Language Settings Box */
body.light-theme .menu-settings-box,
body:not(.dark-theme) .menu-settings-box {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
}

body.light-theme .dropdown-control-label,
body:not(.dark-theme) .dropdown-control-label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-theme .dropdown-select,
body:not(.dark-theme) .dropdown-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

body.light-theme .dropdown-select option,
body.light-theme .dropdown-select optgroup,
body:not(.dark-theme) .dropdown-select option,
body:not(.dark-theme) .dropdown-select optgroup {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-theme .slider-title-bar,
body:not(.dark-theme) .slider-title-bar {
  color: #334155 !important;
  font-weight: 600 !important;
}

body.light-theme .slider-title-bar span,
body:not(.dark-theme) .slider-title-bar span {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.light-theme .slider-val-pill,
body:not(.dark-theme) .slider-val-pill {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 700 !important;
}

body.light-theme .dropdown-slider-row input[type="range"],
body:not(.dark-theme) .dropdown-slider-row input[type="range"] {
  background: #e2e8f0 !important;
  accent-color: #0284c7 !important;
}

/* Modals in Light Mode */
body.light-theme .modal-card,
body:not(.dark-theme) .modal-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

body.light-theme .modal-header,
body:not(.dark-theme) .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

body.light-theme .modal-title,
body:not(.dark-theme) .modal-title {
  color: #0f172a !important;
}

body.light-theme .modal-close-btn,
body:not(.dark-theme) .modal-close-btn {
  color: #64748b !important;
}

body.light-theme .modal-close-btn:hover,
body:not(.dark-theme) .modal-close-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

/* Auth Polite Banner in Light Mode (High Contrast WCAG AAA) */
body.light-theme .auth-polite-banner,
body:not(.dark-theme) .auth-polite-banner {
  background: #f0f9ff !important;
  border-bottom: 1.5px solid #bae6fd !important;
  color: #0c4a6e !important;
}

body.light-theme .auth-banner-icon,
body:not(.dark-theme) .auth-banner-icon {
  color: #0284c7 !important;
}

body.light-theme .auth-banner-title,
body:not(.dark-theme) .auth-banner-title {
  color: #075985 !important;
  font-weight: 700 !important;
}

body.light-theme .auth-banner-text,
body:not(.dark-theme) .auth-banner-text {
  color: #0c4a6e !important;
  font-weight: 500 !important;
}

body.light-theme .auth-banner-sub,
body:not(.dark-theme) .auth-banner-sub {
  color: #0369a1 !important;
  font-weight: 500 !important;
}

body.light-theme .auth-banner-link,
body:not(.dark-theme) .auth-banner-link {
  color: #0284c7 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

body.light-theme .auth-banner-link:hover,
body:not(.dark-theme) .auth-banner-link:hover {
  color: #0369a1 !important;
}

/* Auth Modal Navigation Tabs in Light Mode */
body.light-theme .auth-tabs-nav,
body:not(.dark-theme) .auth-tabs-nav {
  background: #f8fafc !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
}

body.light-theme .auth-tab-btn,
body:not(.dark-theme) .auth-tab-btn {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-theme .auth-tab-btn:hover,
body:not(.dark-theme) .auth-tab-btn:hover {
  color: #0f172a !important;
}

body.light-theme .auth-tab-btn.active,
body:not(.dark-theme) .auth-tab-btn.active {
  color: #0284c7 !important;
  border-bottom: 2.5px solid #0284c7 !important;
  font-weight: 700 !important;
}

/* Form Elements inside Modals in Light Mode */
body.light-theme .form-group label,
body.light-theme .label-with-action label,
body:not(.dark-theme) .form-group label,
body:not(.dark-theme) .label-with-action label {
  color: #1e293b !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
}

body.light-theme .form-group label i,
body:not(.dark-theme) .form-group label i {
  color: #0284c7 !important;
}

body.light-theme .form-input,
body.light-theme input.form-input,
body.light-theme select.form-input,
body.light-theme textarea.form-input,
body:not(.dark-theme) .form-input,
body:not(.dark-theme) input.form-input,
body:not(.dark-theme) select.form-input,
body:not(.dark-theme) textarea.form-input {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  border-radius: 8px !important;
}

body.light-theme .form-input:focus,
body.light-theme input.form-input:focus,
body.light-theme select.form-input:focus,
body.light-theme textarea.form-input:focus,
body:not(.dark-theme) .form-input:focus,
body:not(.dark-theme) input.form-input:focus,
body:not(.dark-theme) select.form-input:focus,
body:not(.dark-theme) textarea.form-input:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
  outline: none !important;
}

body.light-theme .form-input::placeholder,
body:not(.dark-theme) .form-input::placeholder {
  color: #94a3b8 !important;
}

/* Verification Code (OTP) Input in Light Mode */
body.light-theme .otp-input,
body.light-theme input.otp-input,
body:not(.dark-theme) .otp-input,
body:not(.dark-theme) input.otp-input {
  background: #f8fafc !important;
  border: 1.5px solid #0284c7 !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  letter-spacing: 6px !important;
}

body.light-theme .otp-input::placeholder,
body:not(.dark-theme) .otp-input::placeholder {
  color: #64748b !important;
  letter-spacing: 2px !important;
  font-weight: 500 !important;
}

/* Action Addon Button (Send OTP) in Light Mode */
body.light-theme .action-addon-btn,
body:not(.dark-theme) .action-addon-btn {
  background: #e0f2fe !important;
  border: 1.5px solid #7dd3fc !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
}

body.light-theme .action-addon-btn:hover:not(:disabled),
body:not(.dark-theme) .action-addon-btn:hover:not(:disabled) {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body.light-theme .action-addon-btn:disabled,
body:not(.dark-theme) .action-addon-btn:disabled {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  opacity: 0.65 !important;
}

/* Field Hint & Link Subtle in Light Mode */
body.light-theme .field-hint,
body:not(.dark-theme) .field-hint {
  color: #475569 !important;
  font-size: 0.77rem !important;
  font-weight: 500 !important;
}

body.light-theme .link-subtle,
body:not(.dark-theme) .link-subtle {
  color: #64748b !important;
  font-weight: 500 !important;
}

body.light-theme .link-subtle:hover,
body:not(.dark-theme) .link-subtle:hover {
  color: #0284c7 !important;
  text-decoration: underline !important;
}

/* Password Toggle Icon in Light Mode */
body.light-theme .toggle-pwd-btn,
body:not(.dark-theme) .toggle-pwd-btn {
  color: #64748b !important;
}

body.light-theme .toggle-pwd-btn:hover,
body:not(.dark-theme) .toggle-pwd-btn:hover {
  color: #0f172a !important;
}

/* Primary Action Buttons in Modals */
body.light-theme .primary-btn,
body.light-theme .primary-btn.full-width,
body:not(.dark-theme) .primary-btn,
body:not(.dark-theme) .primary-btn.full-width {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
}

body.light-theme .primary-btn:hover,
body.light-theme .primary-btn.full-width:hover,
body:not(.dark-theme) .primary-btn:hover,
body:not(.dark-theme) .primary-btn.full-width:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8) !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-1px);
}

/* Auth Switch Note & Highlight Links in Light Mode */
body.light-theme .auth-switch-note,
body:not(.dark-theme) .auth-switch-note {
  color: #475569 !important;
  font-weight: 500 !important;
}

body.light-theme .link-highlight,
body:not(.dark-theme) .link-highlight {
  color: #0284c7 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

body.light-theme .link-highlight:hover,
body:not(.dark-theme) .link-highlight:hover {
  color: #0369a1 !important;
}

/* Login Gate Overlay in Light Mode */
body.light-theme .login-gate-card,
body:not(.dark-theme) .login-gate-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme .gate-title,
body:not(.dark-theme) .gate-title {
  color: #0f172a !important;
}

body.light-theme .gate-subtitle,
body:not(.dark-theme) .gate-subtitle {
  color: #475569 !important;
}

body.light-theme .gate-badge,
body:not(.dark-theme) .gate-badge {
  background: #e0f2fe !important;
  border-color: #bae6fd !important;
  color: #0284c7 !important;
}

body.light-theme .gate-features-grid,
body:not(.dark-theme) .gate-features-grid {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
}

body.light-theme .gate-feature-item,
body:not(.dark-theme) .gate-feature-item {
  color: #334155 !important;
}

body.light-theme .gate-feature-item i,
body:not(.dark-theme) .gate-feature-item i {
  color: #059669 !important;
}

body.light-theme .gate-btn-signup,
body:not(.dark-theme) .gate-btn-signup {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.light-theme .gate-btn-signup:hover,
body:not(.dark-theme) .gate-btn-signup:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .gate-footer-note,
body:not(.dark-theme) .gate-footer-note {
  color: #64748b !important;
}

/* KaTeX & Mermaid in Light Mode */
body.light-theme .katex,
body.light-theme .katex-display,
body:not(.dark-theme) .katex,
body:not(.dark-theme) .katex-display {
  color: #0f172a !important;
}

body.light-theme .latex-formula-card,
body.light-theme .mermaid-diagram-card,
body:not(.dark-theme) .latex-formula-card,
body:not(.dark-theme) .mermaid-diagram-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .latex-card-header,
body.light-theme .mermaid-diagram-header,
body:not(.dark-theme) .latex-card-header,
body:not(.dark-theme) .mermaid-diagram-header {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .latex-card-title,
body.light-theme .mermaid-diagram-title,
body:not(.dark-theme) .latex-card-title,
body:not(.dark-theme) .mermaid-diagram-title {
  color: #0284c7 !important;
}

body.light-theme .latex-card-stage,
body:not(.dark-theme) .latex-card-stage {
  color: #0f172a !important;
}

body.light-theme .styled-select,
body.light-theme select.styled-select,
body:not(.dark-theme) .styled-select,
body:not(.dark-theme) select.styled-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* ===================================================================
   6. Desktop & Wide Screen Layout Optimization (992px to 3840px)
   =================================================================== */
@media (min-width: 992px) {
  .chat-messages {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 98% !important;
  }

  .input-container {
    max-width: min(980px, 94%) !important;
    width: 94% !important;
    margin: 0 auto !important;
  }

  .footer-activity-hub {
    max-width: min(980px, 94%) !important;
    width: 94% !important;
    margin: 0.35rem auto 0.2rem auto !important;
  }

  .welcome-screen {
    max-width: 100% !important;
    padding: 1.8rem 1rem !important;
  }

  .welcome-center-hero h1 {
    font-size: clamp(2.2rem, 3.2vw, 3rem) !important;
    line-height: 1.2 !important;
  }

  .welcome-sub {
    font-size: 1.08rem !important;
    max-width: 760px !important;
    margin: 0 auto !important;
  }
}









