
:root {
  /* Base Obsidian Void Surfaces (SkyDrive Parity) */
  --bg-main: #080b11;
  --bg-sidebar: #0e1422;
  --bg-card: rgba(18, 26, 44, 0.72);
  --bg-card-hover: rgba(26, 38, 64, 0.88);
  --bg-input: #151d2f;
  --bg-drawer: #0e1422;
  --bg-glass: rgba(14, 20, 34, 0.85);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.4);
  --border-strong: rgba(255, 255, 255, 0.16);

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.28);
  --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #3b82f6 50%, #8b5cf6 100%);
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Interactive State Helpers */
  --bg-hover-subtle: rgba(255, 255, 255, 0.08);
  --nav-active-bg: rgba(2, 132, 199, 0.16);
  --nav-active-text: #e0f2fe;
  --nav-active-border: rgba(56, 189, 248, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #64748b;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-input: #f8fafc;
  --bg-drawer: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(2, 132, 199, 0.4);
  --border-strong: rgba(15, 23, 42, 0.14);
  --border-focus: rgba(2, 132, 199, 0.6);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-faint: #94a3b8;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.18);
  --bg-hover-subtle: rgba(15, 23, 42, 0.05);
  --nav-active-bg: rgba(2, 132, 199, 0.1);
  --nav-active-text: #0284c7;
  --nav-active-border: rgba(2, 132, 199, 0.3);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.app-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.app-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  overflow: hidden;
  position: relative;
}

/* ========================================================================
   Sidebar
   ======================================================================== */
.sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
  z-index: 50;
  flex-shrink: 0;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0px !important;
  border-right: none !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary-gradient {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary-gradient:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary-gradient:active {
  transform: translateY(0);
}

.sidebar-search {
  padding: 0.75rem 0.75rem;
  position: relative;
}
.sidebar-search form {
  position: relative;
  width: 100%;
  margin: 0;
}
.sidebar-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}
.sidebar-search input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 7px 12px 7px 2.25rem;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.sidebar-search input:focus {
  border-color: var(--primary-light);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.conversations-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: 1px solid transparent;
}
.chat-history-item:hover {
  background: var(--bg-hover-subtle);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.chat-history-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-color: var(--nav-active-border);
  font-weight: 600;
}
.chat-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 0.5rem;
}
.chat-item-actions {
  display: none;
  gap: 0.35rem;
}
.chat-history-item:hover .chat-item-actions {
  display: flex;
}
.chat-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
}
.chat-action-btn:hover {
  color: #fff;
}
.chat-action-btn.delete:hover {
  color: var(--accent-rose);
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  width: 100%;
  text-align: left;
}
.footer-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.badge-count {
  margin-left: auto;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}

/* ========================================================================
   Main Workspace
   ======================================================================== */
.chat-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.04), transparent 60%),
              var(--bg-main);
  overflow: hidden;
}

.universal-top-bar {
  height: 60px;
  min-height: 60px;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-sizing: border-box;
  gap: 12px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.top-bar-left .brand-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.top-bar-left .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

/* Matching SaaS Brand App Icon (SkyDrive / Nexus Point / OmniChat) */
.brand-app-icon {
  display: inline-block;
  vertical-align: middle;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.brand-app-icon:hover {
  transform: scale(1.04);
}
.brand-app-icon.lg {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  margin-bottom: 6px;
}
.brand-app-icon.sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.logo-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.top-bar-left .brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
  display: block;
  line-height: 1.1;
}

.top-bar-left .brand-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
}

/* Universal App Tabs Navigation */
.universal-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 4px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  margin-left: 6px;
  flex-shrink: 0;
}

.universal-nav-tabs .nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.universal-nav-tabs .nav-tab span {
  white-space: nowrap;
}

.universal-nav-tabs .nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.universal-nav-tabs .nav-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

/* App-Specific Palette Accents on Active Tab matching Logo Colors */
.universal-nav-tabs .nav-tab.active[data-app="skydrive"],
.universal-nav-tabs .nav-tab.active[href="/"] {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0 12px -2px rgba(56, 189, 248, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="chat"],
.universal-nav-tabs .nav-tab.active[href="/chat"],
.universal-nav-tabs .nav-tab.active[href="/chat/"] {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  box-shadow: 0 0 12px -2px rgba(16, 185, 129, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="ai"],
.universal-nav-tabs .nav-tab.active[href="/ai"],
.universal-nav-tabs .nav-tab.active[href="/ai/"] {
  color: #c084fc !important;
  background: rgba(139, 92, 246, 0.16) !important;
  border-color: rgba(192, 132, 252, 0.38) !important;
  box-shadow: 0 0 12px -2px rgba(139, 92, 246, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="docs"],
.universal-nav-tabs .nav-tab.active[href="/docs"],
.universal-nav-tabs .nav-tab.active[href="/docs/"] {
  color: #60a5fa !important;
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.38) !important;
  box-shadow: 0 0 12px -2px rgba(37, 99, 235, 0.28);
}
.universal-nav-tabs .nav-tab.active[data-app="calendar"],
.universal-nav-tabs .nav-tab.active[href="/calendar"],
.universal-nav-tabs .nav-tab.active[href="/calendar/"] {
  color: #22d3ee !important;
  background: rgba(6, 182, 212, 0.16) !important;
  border-color: rgba(34, 211, 238, 0.38) !important;
  box-shadow: 0 0 12px -2px rgba(6, 182, 212, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="gallery"],
.universal-nav-tabs .nav-tab.active[href="/gallery"],
.universal-nav-tabs .nav-tab.active[href="/gallery/"] {
  color: #f472b6 !important;
  background: rgba(236, 72, 153, 0.16) !important;
  border-color: rgba(244, 114, 182, 0.38) !important;
  box-shadow: 0 0 12px -2px rgba(236, 72, 153, 0.25);
}

.universal-nav-tabs .nav-tab-icon {
  flex-shrink: 0;
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
}

.top-bar-center .tier-selector-container {
  flex-shrink: 0;
}

.top-bar-center .model-selector-container {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 320px;
}

.top-bar-center .model-dropdown {
  min-width: 0;
  max-width: 240px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  height: 28px;
  box-sizing: border-box;
}

.server-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.45);
  flex-shrink: 0;
}

.server-status .status-dot.connecting {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.45);
}

.server-status .status-dot.disconnected {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
}

/* Top Bar Right */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-bar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  margin: 0 4px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

/* Universal Profile Pill */
.universal-profile-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px 4px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.user-profile-badge:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar-wrap {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-initial {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-displayname {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-selector-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  gap: 6px;
  color: var(--text-secondary);
  transition: var(--transition);
  box-sizing: border-box;
}

.model-selector-container:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.45);
}

.model-selector-container:focus-within {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22), 0 2px 10px rgba(0, 0, 0, 0.35);
}

#modelSelectorIcon {
  color: #38bdf8;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.model-selector-container:hover #modelSelectorIcon {
  color: #7dd3fc;
  transform: scale(1.08);
}

.model-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 260px;
}

.model-dropdown optgroup {
  background: #11141c;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.74rem;
}

.model-dropdown option {
  background: #11141c;
  color: #f8fafc;
  padding: 4px 8px;
}

#btnRefreshModels {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: auto;
}

#btnRefreshModels:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.connected {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}
.status-dot.disconnected {
  background-color: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}
.status-dot.connecting {
  background-color: var(--accent-amber);
  animation: pulse 1.5s infinite;
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
}

.icon-btn, .icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.icon-btn.danger:hover {
  color: var(--accent-rose);
}
.icon-btn-sm {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}
.icon-btn-sm:hover {
  color: var(--text-primary);
}

/* ========================================================================
   Messages Area
   ======================================================================== */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Hero Welcome */
.welcome-hero {
  margin: auto;
  max-width: 680px;
  text-align: center;
  padding: 2.5rem 1.5rem;
  position: relative;
}
.hero-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.hero-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.welcome-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  text-align: left;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}
.feature-card i {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: inline-block;
}
.feature-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}
.feature-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Dynamic Messages List */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.message-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}
.message-row.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.message-row.user .msg-avatar {
  background: linear-gradient(135deg, var(--accent-purple), var(--primary));
  color: #fff;
}
.message-row.assistant .msg-avatar {
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
  color: #fff;
}

.msg-bubble-wrapper {
  max-width: calc(100% - 52px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  position: relative;
  word-break: break-word;
}
.message-row.user .message-bubble {
  background: #1e2433;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-right-radius: 4px;
}
.message-row.assistant .message-bubble {
  background: rgba(26, 31, 46, 0.6);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
}

/* Thought / Reasoning Accordion (<think> blocks) */
.thought-accordion {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.thought-header {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}
.thought-header:hover {
  color: var(--text-secondary);
}
.thought-content {
  padding: 0.75rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.15);
}

/* Citations & Sources Box */
.citations-wrapper {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.citations-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.citation-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.citation-badge {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition);
}
.citation-badge:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
}

/* Attached Images in Message */
.msg-attached-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.msg-attached-image {
  max-width: 220px;
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  object-fit: cover;
  cursor: pointer;
  transition: var(--transition);
}
.msg-attached-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* Message Content Markdown Styling */
.message-content {
  font-size: 0.95rem;
  line-height: 1.65;
}
.message-content p {
  margin-bottom: 0.75rem;
}
.message-content p:last-child {
  margin-bottom: 0;
}
.message-content code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.message-content pre {
  margin: 0.75rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #181b24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #11131a;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.btn-copy-code {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  transition: var(--transition);
}
.btn-copy-code:hover {
  color: #fff;
}
.message-content pre code {
  padding: 1rem;
  display: block;
  overflow-x: auto;
  background: transparent;
  border: none;
}
.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}
.message-content th, .message-content td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.message-content th {
  background: rgba(255, 255, 255, 0.04);
}
.message-content a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: var(--transition);
  word-break: break-word;
}
.message-content a:hover {
  color: #7dd3fc;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Streaming Cursor Indicator */
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--primary);
  margin-left: 3px;
  animation: blink 0.8s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========================================================================
   Bottom Prompt Box
   ======================================================================== */
.prompt-area {
  padding: 0 1.5rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Attached Images Preview Tray */
.image-preview-tray {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(26, 31, 46, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.preview-thumbnail-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.preview-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-remove-thumb:hover {
  background: var(--accent-rose);
}

/* Active RAG Strip */
.rag-active-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #c7d2fe;
}
.strip-link {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Floating Input Box */
.prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  position: relative;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  transition: var(--transition);
}
.prompt-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus), var(--shadow-md);
}

.drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  z-index: 20;
  pointer-events: none;
}
.prompt-box.drag-over .drag-overlay {
  display: flex;
}

.prompt-tools-left, .prompt-tools-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tool-btn.web-search-btn {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn.web-search-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.tool-btn.web-search-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.tool-btn.web-search-btn.active i {
  filter: drop-shadow(0 0 4px #38bdf8);
  animation: pulseGlobe 3s infinite ease-in-out;
}

@keyframes pulseGlobe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.web-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.2s ease-out;
}

.web-search-pill:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.web-search-pill i {
  font-size: 0.72rem;
}

.prompt-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}
#promptInput {
  width: 100%;
  max-height: 200px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  padding: 0.35rem 0.25rem;
}
#promptInput::placeholder {
  color: var(--text-muted);
}

.btn-send, .btn-stop {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0.95rem;
}
.btn-send {
  background: var(--primary);
  color: #fff;
}
.btn-send:hover {
  background: var(--primary-hover);
  transform: scale(1.04);
}
.btn-stop {
  background: var(--accent-rose);
  color: #fff;
  animation: pulse 1s infinite;
}

.prompt-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.prompt-footer-note code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ========================================================================
   Knowledge Base Drawer (RAG Document Manager)
   ======================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 240;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.knowledge-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 90vw;
  height: 100%;
  height: 100dvh;
  background: var(--bg-drawer);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 250;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
}
.knowledge-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.drawer-title i {
  color: var(--primary);
  font-size: 1.2rem;
}
.drawer-title h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.02);
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}
.upload-dropzone i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.upload-dropzone h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.upload-dropzone p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.embedding-progress-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  transition: width 0.2s ease;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.drawer-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  gap: 0.5rem;
}
.config-row input[type="number"] {
  width: 80px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
}
.config-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-text-danger:hover {
  text-decoration: underline;
}

.doc-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.doc-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
}
.doc-icon {
  font-size: 1.1rem;
  color: var(--primary);
}
.doc-info {
  flex: 1;
  overflow: hidden;
}
.doc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.doc-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.doc-remove-btn:hover {
  color: var(--accent-rose);
}

.empty-docs-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.empty-docs-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* ========================================================================
   Modal Dialogs
   ======================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-dialog {
  background: var(--bg-drawer);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-title i {
  color: var(--primary);
}
.modal-title h2 {
  font-size: 1.15rem;
}
.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
}
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.settings-group h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.settings-group label {
  font-size: 0.85rem;
  font-weight: 500;
}
.input-with-action {
  display: flex;
  gap: 0.5rem;
}
.input-with-action input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
}
.input-with-action input:focus {
  border-color: var(--border-focus);
}
.setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.param-slider {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.param-slider input[type="range"] {
  accent-color: var(--primary);
}
.param-slider input[type="number"], select, textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
}
select option {
  background: var(--bg-sidebar);
}
textarea {
  resize: vertical;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover {
  background: var(--accent-rose);
}

/* Message Actions Bar */
.message-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.message-metrics-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.message-metrics-tag span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.message-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Prompt Starters */
.prompt-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
  max-width: 720px;
}

.starter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 31, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.starter-chip:hover {
  background: rgba(38, 47, 72, 0.85);
  color: var(--text-primary);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2);
}

.starter-chip i {
  color: #38bdf8;
  font-size: 0.85rem;
}

/* SkyDrive Breadcrumbs */
.drive-crumb:hover {
  text-decoration: underline;
}

.drive-browser-item:hover {
  border-color: rgba(56, 189, 248, 0.3) !important;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-drawer: #ffffff;

  --border-color: rgba(0, 0, 0, 0.09);
  --border-focus: rgba(2, 132, 199, 0.6);
  --border-subtle: rgba(0, 0, 0, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .universal-top-bar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .top-bar-left .brand-name {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .universal-nav-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .universal-nav-tabs .nav-tab {
  color: #475569;
}

[data-theme="light"] .universal-nav-tabs .nav-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

[data-theme="light"] .universal-nav-tabs .nav-tab.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

[data-theme="light"] .model-selector-container,
[data-theme="light"] .top-bar-center .model-selector-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .model-selector-container:hover,
[data-theme="light"] .top-bar-center .model-selector-container:hover {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .model-selector-container:focus-within,
[data-theme="light"] .top-bar-center .model-selector-container:focus-within {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #modelSelectorIcon {
  color: #0284c7;
}

[data-theme="light"] .model-selector-container:hover #modelSelectorIcon {
  color: #0369a1;
}

[data-theme="light"] .model-dropdown,
[data-theme="light"] .top-bar-center .model-dropdown {
  color: #0f172a;
}

[data-theme="light"] .model-dropdown optgroup {
  background: #ffffff;
  color: #64748b;
}

[data-theme="light"] .model-dropdown option,
[data-theme="light"] .top-bar-center .model-dropdown option {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] #btnRefreshModels {
  color: #64748b;
}

[data-theme="light"] #btnRefreshModels:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0284c7;
}

[data-theme="light"] .tier-selector-container,
[data-theme="light"] .top-bar-center .tier-selector-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tier-selector-container:hover,
[data-theme="light"] .top-bar-center .tier-selector-container:hover {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tier-selector-container:focus-within,
[data-theme="light"] .top-bar-center .tier-selector-container:focus-within {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tier-dropdown {
  color: #0f172a;
}

[data-theme="light"] .tier-dropdown option {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .quota-badge {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
  color: #b45309;
}

[data-theme="light"] .quota-badge:hover {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .quota-badge.zero {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.4);
  color: #e11d48;
}

[data-theme="light"] .server-status {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569;
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0284c7;
}

[data-theme="light"] .user-profile-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .user-displayname {
  color: #0f172a;
}

[data-theme="light"] .chat-workspace {
  background: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.04), transparent 60%), #f8fafc;
}

[data-theme="light"] .message-row.assistant .message-bubble,
[data-theme="light"] .message-bubble.assistant {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .message-row.user .message-bubble,
[data-theme="light"] .message-bubble.user {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #ffffff;
}

[data-theme="light"] .message-row.user .message-bubble .message-content,
[data-theme="light"] .message-row.user .message-bubble p {
  color: #ffffff;
}

[data-theme="light"] .message-actions-bar {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .message-metrics-tag {
  color: #64748b;
}

[data-theme="light"] .msg-action-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}

[data-theme="light"] .msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .input-container {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #promptInput {
  color: #0f172a;
}

[data-theme="light"] .sidebar {
  background: #f8fafc;
  border-right-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-history-item {
  color: #475569;
}

[data-theme="light"] .chat-history-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

[data-theme="light"] .chat-history-item.active {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border-left-color: #0284c7;
}

[data-theme="light"] .sidebar-search input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

/* Desktop defaults for mobile-only controls */
.sidebar-backdrop {
  display: none;
}
.sidebar-close-btn {
  display: none;
}
.mobile-sidebar-apps {
  display: none;
}
.mobile-actions-wrapper {
  position: relative;
  display: none;
}

.mobile-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(18, 22, 34, 0.96);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  min-width: 190px;
  z-index: 1000;
  overflow: hidden;
  padding: 5px;
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}
.mobile-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
}
.mobile-menu-item.danger {
  color: var(--accent-rose);
}
.mobile-menu-item.danger i {
  color: var(--accent-rose);
}
.mobile-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.12);
}

/* ------------------------------------------------------------------------
   1. Ultra-Wide & Large Desktop Displays (>= 1440px)
   ------------------------------------------------------------------------ */
@media (min-width: 1440px) {
  .messages-list,
  .prompt-area {
    max-width: 1040px;
  }
  .welcome-hero {
    max-width: 780px;
  }
}

@media (min-width: 1800px) {
  .messages-list,
  .prompt-area {
    max-width: 1120px;
  }
  .welcome-hero {
    max-width: 840px;
  }
}

@media (max-width: 1440px) {
  .top-bar-center .model-selector-container {
    max-width: 220px;
  }
  .top-bar-center .model-dropdown {
    max-width: 150px;
  }
  .server-status .status-label {
    display: none;
  }
  #btnQuickRagToggle span {
    display: none;
  }
  #btnQuickRagToggle {
    padding: 6px 10px;
  }
}

/* ------------------------------------------------------------------------
   2. Small Laptops & Desktops (1024px to 1279px)
   ------------------------------------------------------------------------ */
@media (max-width: 1279px) {
  .top-bar-left .brand-sub {
    display: none;
  }
  .top-bar-center {
    max-width: 300px;
  }
  .top-bar-center .model-selector-container {
    max-width: 220px;
  }
  .server-status .status-label {
    display: none;
  }
  .server-status {
    padding: 0.3rem 0.5rem;
  }
  .universal-nav-tabs .nav-tab {
    padding: 5px 9px;
    font-size: 0.78rem;
  }
}

/* Responsive Universal Navigation Tabs: Collapse text to icon-only sooner */
@media (max-width: 1400px) {
  .universal-nav-tabs span {
    display: none !important;
  }
  .universal-nav-tabs .nav-tab {
    padding: 6px 9px !important;
    gap: 0 !important;
    justify-content: center !important;
  }
  .universal-nav-tabs .nav-tab-icon {
    width: 15px !important;
    height: 15px !important;
  }
}

@media (max-width: 1023px) {
  .universal-top-bar {
    padding: 0 12px;
    gap: 8px;
  }
  .universal-nav-tabs span {
    display: none;
  }
  .universal-nav-tabs .nav-tab {
    padding: 6px 8px;
  }
  .top-bar-center {
    max-width: 220px;
  }
  .top-bar-center .model-selector-container {
    max-width: 180px;
    padding: 0.3rem 0.5rem;
  }
  .top-bar-center .model-dropdown {
    max-width: 140px;
    font-size: 0.8rem;
  }
  #btnQuickRagToggle span {
    display: none;
  }
  #btnQuickRagToggle {
    padding: 6px 10px;
  }
  #btnExportChat,
  #btnClearChat {
    display: none;
  }
  .mobile-actions-wrapper {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 70vw;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    z-index: 200;
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.5);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 195;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .hero-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------------------
   4. Mobile Phones & Small Tablets (<= 768px)
   ------------------------------------------------------------------------ */
@media (max-width: 768px) {
  .app-body {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }

  /* Header Layout */
  .universal-top-bar {
    padding: 0 max(10px, env(safe-area-inset-left, 0px)) 0 max(10px, env(safe-area-inset-right, 0px));
    gap: 6px;
    height: 56px;
    min-height: 56px;
  }

  /* Left Header: Toggle + Compact Brand */
  .top-bar-left {
    gap: 8px;
  }
  .top-bar-left .brand-sub {
    display: none;
  }
  .top-bar-left .brand-name {
    font-size: 0.95rem;
  }
  .universal-nav-tabs {
    display: flex !important;
    margin-left: 2px !important;
    padding: 2px 2px !important;
    gap: 2px !important;
  }
  .universal-nav-tabs .nav-tab {
    padding: 4px 6px !important;
  }
  .universal-nav-tabs .nav-tab-icon {
    width: 13px !important;
    height: 13px !important;
  }

  .top-bar-center {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 220px;
    margin: 0 4px;
    overflow: hidden;
  }
  .top-bar-center .tier-selector-container {
    display: none; /* Tier is shown in the prompt strip instead */
  }
  .top-bar-center .model-selector-container {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    padding: 0.25rem 0.5rem;
    gap: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .top-bar-center .model-dropdown {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .top-bar-center #btnRefreshModels,
  .top-bar-center .server-status {
    display: none;
  }

  /* Right Header: RAG + Theme + Profile + Overflow */
  .top-bar-right {
    gap: 4px;
    flex-shrink: 0;
  }
  #btnQuickRagToggle {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  #btnQuickRagToggle span {
    display: none;
  }
  #btnSaveChatToDrive,
  #btnShareToChat,
  #btnExportChat,
  #btnClearChat {
    display: none; /* Available in mobile overflow menu */
  }
  .mobile-actions-wrapper {
    display: block;
  }
  .top-bar-divider {
    display: none;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .theme-toggle-btn {
    display: inline-flex !important;
    width: 32px;
    height: 32px;
    font-size: 13px;
    flex-shrink: 0;
  }
  #omniUserLabel {
    display: none;
  }
  .universal-profile-wrap .pill-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .user-profile-badge {
    padding: 3px;
    gap: 0;
  }
  .user-displayname {
    display: none;
  }
  .user-profile-badge button[onclick*="openOmniSettingsModal"] {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 86vw;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    z-index: 200;
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.7);
  }

  .sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .sidebar-header-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .mobile-sidebar-apps {
    display: flex;
    gap: 6px;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .mobile-app-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
    transition: var(--transition);
  }
  .mobile-app-link.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
  }

  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .sidebar-close-btn:hover,
  .sidebar-close-btn:active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
  }

  /* Mobile Backdrop Overlay */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 195;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .messages-container {
    padding: 10px 10px calc(85px + env(safe-area-inset-bottom, 0px));
  }
  .messages-list {
    gap: 1rem;
    width: 100%;
  }
  .message-row {
    gap: 8px;
  }
  .msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.85rem;
  }
  .msg-bubble-wrapper {
    max-width: calc(100% - 38px);
  }
  .message-bubble {
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
  }
  .message-actions-bar {
    flex-wrap: wrap;
    gap: 4px;
  }
  .msg-action-btn {
    padding: 3px 6px;
    font-size: 0.72rem;
  }

  /* Responsive Tables and Code Blocks */
  .message-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0.75rem 0;
  }
  .message-content pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
  }
  .code-block-wrapper {
    max-width: 100%;
    overflow: hidden;
  }

  /* Welcome Hero Card */
  .welcome-hero {
    padding: 1.5rem 0.75rem;
    max-width: 100%;
  }
  .welcome-hero h1 {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }
  .welcome-hero .hero-desc {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
  }
  .hero-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .feature-card {
    padding: 10px 12px;
  }
  .feature-card i {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }
  .feature-card h3 {
    font-size: 0.85rem;
  }
  .feature-card p {
    font-size: 0.72rem;
  }

  .prompt-starters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .prompt-starters::-webkit-scrollbar {
    display: none;
  }
  .starter-chip {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .prompt-area {
    padding: 0 max(8px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .prompt-box {
    padding: 6px 8px;
    border-radius: 18px;
    gap: 4px;
    align-items: flex-end;
  }
  .prompt-tools-left,
  .prompt-tools-right {
    gap: 3px;
  }
  .tool-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
  .prompt-input-wrapper {
    flex: 1;
    min-width: 0;
  }
  #promptInput {
    font-size: 16px;
    line-height: 1.4;
    padding: 5px 4px;
  }
  .btn-send,
  .btn-stop {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
  }
  .prompt-footer-note {
    display: none;
  }

  .knowledge-drawer {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    border-left: none;
  }
  .knowledge-drawer .drawer-header {
    padding: 0.9rem 1rem;
  }
  .knowledge-drawer #btnCloseDrawer {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .modal-dialog {
    width: min(94vw, 540px) !important;
    margin: 10px auto !important;
    padding: 0 !important;
    max-height: 88vh !important;
    border-radius: 14px !important;
  }
  .modal-header {
    padding: 12px 14px !important;
  }
  .modal-body {
    padding: 12px 14px !important;
    max-height: calc(88vh - 120px) !important;
  }
  .modal-footer {
    padding: 10px 14px !important;
  }
}

@media (max-width: 480px) {
  .top-bar-left .brand-name {
    display: none; /* Keep header clean: show iconic logo next to toggle */
  }
  .top-bar-left .brand-sub {
    display: none;
  }
  #btnQuickRagToggle {
    display: none;
  }
  .top-bar-center {
    max-width: 200px;
    flex: 1 1 auto;
  }
  .top-bar-center .model-dropdown {
    font-size: 0.74rem;
  }
  .hero-features {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .feature-card {
    padding: 8px 10px;
  }
  .feature-card h3 {
    font-size: 0.8rem;
  }
  .feature-card p {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  .msg-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  .msg-bubble-wrapper {
    max-width: calc(100% - 34px);
  }
  .message-bubble {
    padding: 0.7rem 0.85rem;
    font-size: 0.88rem;
  }

  .message-action-buttons {
    gap: 4px;
  }
  .msg-action-btn {
    padding: 2px 5px;
    font-size: 0.7rem;
  }
}

/* ------------------------------------------------------------------------
   6. Ultra-Narrow Devices (<= 360px)
   ------------------------------------------------------------------------ */
@media (max-width: 360px) {
  .universal-top-bar {
    padding: 0 6px;
    gap: 4px;
  }
  .top-bar-center {
    max-width: 135px;
  }
  .icon-btn,
  .theme-toggle-btn,
  #btnQuickRagToggle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .tool-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .btn-send,
  .btn-stop {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .hero-features {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------------
   7. Landscape Mode on Mobile Phones
   ------------------------------------------------------------------------ */
@media (max-height: 520px) and (orientation: landscape) {
  .universal-top-bar {
    height: 44px;
    min-height: 44px;
  }
  .app-body {
    height: calc(100vh - 44px);
    height: calc(100dvh - 44px);
  }
  .sidebar {
    top: 44px;
    height: calc(100vh - 44px);
    height: calc(100dvh - 44px);
  }
  .sidebar-backdrop {
    top: 44px;
  }
  .welcome-hero {
    padding: 0.5rem;
  }
  .welcome-hero .hero-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
  .welcome-hero h1 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
  }
  .welcome-hero .hero-desc {
    display: none;
  }
  .hero-features {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .messages-container {
    padding: 8px 8px 75px;
  }
  .modal-dialog {
    max-height: 94vh !important;
  }
  .prompt-starters {
    display: none; /* Too cramped in landscape phone mode */
  }
}

.tier-selector-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.tier-selector-container:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.tier-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.tier-dropdown option {
  background: #11141c;
  color: #f8fafc;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 999px;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.quota-badge:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: scale(1.05);
}

.quota-badge.zero {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

/* Tier Active Strip above Prompt Box */
.tier-active-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  margin-bottom: 6px;
}

.tier-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  color: #c7d2fe;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tier-pill-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.tier-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
  color: #fcd34d;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tier-credit-pill:hover {
  background: rgba(245, 158, 11, 0.22);
  transform: scale(1.03);
}

/* Admin Quotas Management Table */
.admin-quota-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.admin-quota-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 8px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-quota-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.quota-action-btn {
  padding: 2px 6px;
  font-size: 0.72rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 4px;
  color: #a5b4fc;
  cursor: pointer;
  transition: var(--transition);
}

.quota-action-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

.api-key-masked {
  -webkit-text-security: disc !important;
  text-security: disc !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SkyDrive Parity Action Buttons                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */
.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.primary-btn.sm {
  padding: 6px 14px;
  font-size: 12px;
}

.secondary-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.secondary-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.secondary-btn.sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Desktop Shell Integration (Electron)                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */
html.is-desktop-app .brand-logo,
body.is-desktop-app .brand-logo,
html.is-desktop-app .universal-nav-tabs,
body.is-desktop-app .universal-nav-tabs,
html.is-desktop-app #omniUserProfileWrap,
body.is-desktop-app #omniUserProfileWrap,
html.is-desktop-app #theme-toggle-btn,
body.is-desktop-app #theme-toggle-btn,
html.is-desktop-app .mobile-sidebar-apps,
body.is-desktop-app .mobile-sidebar-apps,
html.is-desktop-app .top-bar-divider,
body.is-desktop-app .top-bar-divider {
    display: none !important;
}

html.is-desktop-app .top-bar-left,
body.is-desktop-app .top-bar-left {
    padding-left: 0;
}

/* ========================================================================
   NDML File Card & Preview Modal
   ======================================================================== */
.ndml-file-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  max-width: 400px;
}

.ndml-file-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 12px;
}

.ndml-file-header i {
  font-size: 1.2rem;
  color: #3b82f6;
}

.ndml-file-actions {
  display: flex;
  gap: 8px;
}

.ndml-file-actions button {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-color);
  transition: all 0.2s ease;
}

.ndml-file-actions button:hover {
  background: var(--bg-hover);
  border-color: #3b82f6;
  color: #3b82f6;
}

.ndml-preview-body {
  background: #ffffff;
  color: #000000;
  padding: 30px;
  min-height: 50vh;
  overflow-y: auto;
  border-radius: 8px;
  margin: 10px;
}

.ndml-preview-body card, .ndml-preview-body .card { display: block; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 18px; margin: 14px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.ndml-preview-body card[title]::before, .ndml-preview-body .card[title]::before { content: attr(icon) " " attr(title); font-weight: 700; font-size: 1.05rem; display: block; margin-bottom: 6px; color: #0f172a; }
.ndml-preview-body note, .ndml-preview-body .note { display: block; background: #eff6ff; border-left: 4px solid #38bdf8; border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 14px 0; color: #1e40af; font-size: 10pt; line-height: 1.6; }
.ndml-preview-body warning, .ndml-preview-body .warning { display: block; background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 14px 0; color: #92400e; font-size: 10pt; line-height: 1.6; }
.ndml-preview-body subtitle, .ndml-preview-body .doc-subtitle { display: block; font-size: 13pt; color: #64748b; font-style: italic; margin-top: -6px; margin-bottom: 18px; line-height: 1.4; }
.ndml-preview-body grid, .ndml-preview-body .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.ndml-preview-body timeline, .ndml-preview-body .timeline { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; padding-left: 16px; border-left: 2px solid #38bdf8; }
.ndml-preview-body event, .ndml-preview-body .event { display: block; font-size: 10pt; color: #334155; line-height: 1.5; }
.ndml-preview-body event[year]::before, .ndml-preview-body .event[year]::before { content: attr(year) " — " attr(label); font-weight: 600; color: #0284c7; display: block; }

.ndml-modal-dialog {
  width: 90%;
  max-width: 1000px;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

/* Toggle switches (used in Settings and Modals) */

/* iOS-style toggle switch */
.agentic-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.agentic-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.agentic-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  transition: all 0.3s ease;
}

.agentic-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.agentic-switch input:checked + .agentic-slider {
  background: rgba(139, 92, 246, 0.5);
}

.agentic-switch input:checked + .agentic-slider::before {
  transform: translateX(14px);
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* ========================================================================
   Agentic Mode — Tool Activity Log (in chat bubbles)
   ======================================================================== */

.tool-activity-log {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tool-activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c4b5fd;
  user-select: none;
  transition: background 0.2s ease;
}

.tool-activity-header:hover {
  background: rgba(139, 92, 246, 0.08);
}

.tool-activity-header i:first-child {
  color: #a78bfa;
}

.tool-activity-chevron {
  margin-left: auto;
  font-size: 0.65rem;
  transition: transform 0.3s ease;
  color: #94a3b8;
}

.tool-activity-log.collapsed .tool-activity-chevron {
  transform: rotate(-90deg);
}

.tool-activity-log.collapsed .tool-activity-steps {
  display: none;
}

.tool-activity-steps {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-step {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid #6366f1;
  transition: border-color 0.3s ease;
}

.tool-step.success {
  border-left-color: #22c55e;
}

.tool-step.error {
  border-left-color: #f43f5e;
}

.tool-step.running {
  border-left-color: #a78bfa;
}

.tool-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.tool-step-header i {
  font-size: 0.75rem;
}

.tool-step.success .tool-step-header i {
  color: #22c55e;
}

.tool-step.error .tool-step-header i {
  color: #f43f5e;
}

.tool-step.running .tool-step-header i {
  color: #a78bfa;
}

.tool-step-name {
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

.tool-step-args {
  color: #94a3b8;
  font-size: 0.72rem;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.tool-step-result {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.4;
}

/* Light theme overrides */
[data-theme="light"] .tool-activity-log {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .tool-activity-header {
  color: #7c3aed;
}

[data-theme="light"] .tool-step {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .tool-step-name {
  color: #1e293b;
}

[data-theme="light"] .tool-step-result {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
}



[data-theme="light"] .agentic-slider {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .agentic-slider::before {
  background: #94a3b8;
}

@media (max-width: 768px) {
  .agentic-switch {
    width: 28px;
    height: 16px;
  }
  .agentic-slider::before {
    height: 12px;
    width: 12px;
  }
  .agentic-switch input:checked + .agentic-slider::before {
    transform: translateX(12px);
  }
}

/* Linked Files Indicator Strip */
.linked-files-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #c084fc;
}

.linked-files-strip .strip-link {
  margin-left: auto;
  background: none;
  border: none;
  color: #c084fc;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.78rem;
}

.linked-files-strip .strip-link:hover {
  color: #e9d5ff;
}

[data-theme="light"] .linked-files-strip {
  background: rgba(147, 51, 234, 0.07);
  border-color: rgba(147, 51, 234, 0.2);
  color: #7e22ce;
}

[data-theme="light"] .linked-files-strip .strip-link {
  color: #7e22ce;
}

.metric-turns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* Verbose Mode Tool Inspection */
.verbose-badge {
  font-size: 0.68rem;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-verbose-section {
  margin-top: 6px;
}

.tool-verbose-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.tool-verbose-json {
  margin: 2px 0 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-verbose-thought {
  margin: 4px 0 6px;
  padding: 6px 10px;
  background: rgba(139, 92, 246, 0.08);
  border-left: 2px solid #a78bfa;
  border-radius: 0 6px 6px 0;
  font-size: 0.74rem;
  color: #ddd6fe;
  font-style: italic;
  line-height: 1.4;
}

.tool-turn-pill {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
}

[data-theme="light"] .verbose-badge {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}

[data-theme="light"] .tool-verbose-label {
  color: #7c3aed;
}

[data-theme="light"] .tool-verbose-json {
  background: rgba(0, 0, 0, 0.04);
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tool-verbose-thought {
  background: rgba(124, 58, 237, 0.05);
  color: #5b21b6;
  border-left-color: #7c3aed;
}

[data-theme="light"] .tool-turn-pill {
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
}

/* SkyDrive File Picker Search Bar */
.drive-search-bar-wrap {
  width: 100%;
}
.drive-search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.drive-search-input-box:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  background: rgba(255, 255, 255, 0.06);
}
.drive-search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.88rem;
  color: #64748b;
  pointer-events: none;
}
.drive-search-input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  background: transparent;
  border: none;
  color: var(--text-main, #f8fafc);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}
.drive-search-input::placeholder {
  color: #64748b;
}
.drive-search-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: 0.15s ease;
}
.drive-search-clear-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}
.drive-browser-item-loc {
  font-size: 0.72rem;
  color: #64748b;
  margin-left: 6px;
  font-weight: 400;
}
[data-theme="light"] .drive-search-input-box {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .drive-search-input-box:focus-within {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
[data-theme="light"] .drive-search-input {
  color: #0f172a;
}
[data-theme="light"] .drive-search-clear-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}



