/* ============================================================
   Google Gemini (Lumi Design System) - 100% Authentic Stylesheet
   ============================================================ */

:root {
  --bg-base: #0f0f0f;
  --bg-surface: #1f1f1f;
  --bg-surface-high: #28292a;
  --bg-surface-highest: #333537;
  --bg-capsule: #1e1f20;
  --bg-glass: rgba(15, 15, 15, 0.85);
  
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-muted: #8e918f;
  --text-inverse: #0f0f0f;
  
  --accent-blue: #8ab4f8;
  --accent-purple: #c58af9;
  --accent-pink: #f28b82;
  --accent-cyan: #78d9ec;
  --accent-gold: #fdd663;
  
  --brand-gradient: linear-gradient(135deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
  --brand-gradient-subtle: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(155, 114, 203, 0.15), rgba(217, 101, 112, 0.15));
  --brand-gradient-glow: radial-gradient(circle, rgba(138, 180, 248, 0.25) 0%, transparent 70%);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-active: rgba(138, 180, 248, 0.5);

  --radius-capsule: 32px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --shadow-dropdown: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-floating: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 24px rgba(138, 180, 248, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.2, 0, 0, 1);
  --transition-smooth: 0.25s cubic-bezier(0.2, 0, 0, 1);
  --transition-drawer: 0.32s cubic-bezier(0.2, 0, 0, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg-base: #f8fafd;
  --bg-surface: #ffffff;
  --bg-surface-high: #f0f4f9;
  --bg-surface-highest: #e3e8ef;
  --bg-capsule: #f0f4f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #747775;
  --text-inverse: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-active: rgba(26, 115, 232, 0.5);

  --shadow-dropdown: 0 12px 36px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-floating: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Google Sans Flex', 'Google Sans', 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   0. Interactive Ambient Nebula Background (Mouse Parallax)
   ============================================================ */
.ambient-nebula-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.nebula-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.orb-blue {
  top: -10%;
  left: 20%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #1a73e8 0%, transparent 70%);
  transform: translate3d(calc(var(--mouse-x, 0px) * 0.4), calc(var(--mouse-y, 0px) * 0.4), 0);
  animation: nebulaBreathe 16s ease-in-out infinite alternate;
}

.orb-purple {
  top: 40%;
  right: -10%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #9334e6 0%, transparent 70%);
  transform: translate3d(calc(var(--mouse-x, 0px) * -0.5), calc(var(--mouse-y, 0px) * -0.5), 0);
  animation: nebulaBreathe 20s ease-in-out infinite alternate -4s;
}

.orb-pink {
  bottom: -20%;
  left: 30%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #ea4335 0%, transparent 70%);
  transform: translate3d(calc(var(--mouse-x, 0px) * 0.3), calc(var(--mouse-y, 0px) * 0.3), 0);
  animation: nebulaBreathe 24s ease-in-out infinite alternate -8s;
}

@keyframes nebulaBreathe {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(0.95); }
}

/* ============================================================
   1. Family SSO Auth Lock Screen
   ============================================================ */
.auth-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 15, 15, 0.94);
  backdrop-filter: blur(32px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-floating);
  text-align: center;
  animation: authScaleIn 0.3s cubic-bezier(0.2, 0, 0, 1);
}

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

.auth-logo {
  margin-bottom: 20px;
}

.gemini-sparkle-spin {
  filter: drop-shadow(0 0 16px rgba(155, 114, 203, 0.4));
  animation: sparklePulse 3s ease-in-out infinite;
}

@keyframes sparklePulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(15deg); }
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.family-members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.member-card {
  background: var(--bg-surface-high);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.member-card:hover {
  background: var(--bg-surface-highest);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.member-card.selected {
  background: rgba(138, 180, 248, 0.12);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.member-card-avatar {
  font-size: 28px;
  margin-bottom: 6px;
}

.member-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.member-card-role {
  font-size: 12px;
  color: var(--text-muted);
}

.selected-member-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-high);
  border: 1px solid var(--border-medium);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  height: 48px;
  background: var(--bg-surface-high);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.auth-btn {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  background: var(--brand-gradient);
  border: none;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

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

.auth-btn.secondary {
  background: var(--bg-surface-highest);
  color: var(--text-primary);
}

.auth-error {
  color: #ff8a80;
  font-size: 13px;
  margin-top: 8px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 13px;
  cursor: pointer;
  margin-top: 16px;
}

/* ============================================================
   2. Main Application Layout & Streamlined Sidebar
   ============================================================ */
.app-layout {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* A. Streamlined Sidebar */
.app-sidebar {
  width: 280px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-drawer), transform var(--transition-drawer);
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 14px 10px 14px;
}

.sidebar-action-pill {
  width: 100%;
  height: 44px;
  background: #1e1f20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-action-pill:hover {
  background: #282a2c;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.sidebar-action-pill:active {
  transform: scale(0.98);
}

.sidebar-action-pill .sparkle-icon {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.sidebar-action-row {
  width: 100%;
  height: 40px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-action-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.sidebar-action-row:active {
  transform: scale(0.98);
}

.sidebar-action-row .search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.sidebar-action-row:hover .search-icon {
  color: var(--accent-blue);
}

.sidebar-history-section {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

.sidebar-history-section::-webkit-scrollbar {
  width: 5px;
}

.sidebar-history-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px 6px 12px;
  display: block;
}

.history-group-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 12px 4px 12px;
}

.history-item {
  width: 100%;
  height: 36px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.history-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.history-item.active {
  background: rgba(138, 180, 248, 0.12);
  color: var(--accent-blue);
  font-weight: 500;
}

.history-actions-trigger {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: opacity var(--transition-fast);
}

.history-item:hover .history-actions-trigger {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-high);
}

.user-avatar {
  font-size: 20px;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tier-badge {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 500;
}

/* Mobile Sidebar Backdrop */
.sidebar-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.sidebar-mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   3. Top Bar Navigation
   ============================================================ */
.main-content-layout {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-title {
  font-size: 18px;
  font-weight: 500;
  color: #e6e6e6;
  letter-spacing: -0.2px;
  user-select: none;
}

/* Model Dropdown Trigger */
.model-picker-container {
  position: relative;
}

.model-picker-btn {
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.model-picker-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.model-dropdown-menu {
  position: absolute;
  top: 44px;
  left: 0;
  width: 290px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-dropdown);
  z-index: 200;
  animation: menuIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

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

.model-option {
  width: 100%;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.model-option:hover {
  background: var(--bg-surface-high);
}

.model-option.selected {
  background: rgba(138, 180, 248, 0.12);
}

.option-content {
  display: flex;
  flex-direction: column;
}

.option-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.option-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.check-icon {
  color: var(--accent-blue);
  font-weight: 700;
  opacity: 0;
}

.model-option.selected .check-icon {
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.dropdown-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

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

.toggle-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Switch Toggle UI */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-surface-highest);
  transition: .2s;
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip-btn {
  height: 34px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: rgba(138, 180, 248, 0.18);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(138, 180, 248, 0.25);
}

/* ============================================================
   4. Dual-Pane Body & Centered vs Docked Omnibar Layout
   ============================================================ */
.dual-pane-body {
  flex: 1;
  display: flex;
  height: calc(100% - 56px);
  overflow: hidden;
  position: relative;
}

.chat-conversation-pane {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: flex var(--transition-drawer);
}

/* When Canvas is open */
.main-content-layout.with-canvas .chat-conversation-pane {
  flex: 0 0 45%;
  border-right: 1px solid var(--border-subtle);
}

.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.chat-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.chat-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Initial Centered Empty State */
.chat-conversation-pane.is-initial-empty {
  justify-content: center;
}

.chat-conversation-pane.is-initial-empty .chat-scroll-area {
  flex: 0 0 auto;
  margin-top: auto;
}

.chat-conversation-pane.is-initial-empty .welcome-hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px 24px 20px;
  text-align: center;
}

.chat-conversation-pane.is-initial-empty .input-dock-wrapper {
  flex: 0 0 auto;
  margin-bottom: auto;
  margin-top: 0;
  padding: 0 20px;
}

/* Docked State (with messages) */
.chat-conversation-pane:not(.is-initial-empty) .welcome-hero-container {
  display: none !important;
}

.chat-conversation-pane:not(.is-initial-empty) .chat-scroll-area {
  flex: 1;
}

.chat-conversation-pane:not(.is-initial-empty) .input-dock-wrapper {
  position: sticky;
  bottom: 0;
  padding: 0 20px 20px 20px;
  margin-top: auto;
  flex: none;
}

/* Welcome Hero Screen */
.welcome-sparkle {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px rgba(155, 114, 203, 0.4));
  animation: sparkleFloat 3s ease-in-out infinite alternate;
}

@keyframes sparkleFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-6px) scale(1.04); }
}

.welcome-title {
  font-size: 38px;
  font-weight: 500;
  color: #e3e3e3;
  letter-spacing: -0.5px;
  user-select: none;
}

/* Messages Stream */
.messages-container {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 840px;
  margin: 0 auto;
  width: 100%;
}

.message-row {
  display: flex;
  gap: 14px;
  width: 100%;
  animation: messageFadeUp 0.25s cubic-bezier(0.2, 0, 0, 1);
}

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

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-high);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message-body {
  max-width: 82%;
  display: flex;
  flex-direction: column;
}

.message-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.65;
  box-shadow: var(--shadow-floating);
  overflow-wrap: break-word;
}

.message-row.user .message-bubble {
  background: var(--bg-surface-high);
  border-radius: 20px 20px 4px 20px;
}

/* Extended Thinking Box */
.thinking-box {
  background: rgba(138, 180, 248, 0.06);
  border: 1px solid rgba(138, 180, 248, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
}

.thinking-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
  animation: pulse 1.5s infinite;
  display: inline-block;
  margin-right: 6px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.thinking-content {
  padding: 0 14px 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  border-top: 1px dashed rgba(138, 180, 248, 0.15);
  margin-top: 4px;
  padding-top: 8px;
}

/* Multimodal Media Cards */
.generated-image-card {
  position: relative;
  display: inline-block;
  margin: 12px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-floating);
  border: 1px solid var(--border-subtle);
  background: #000;
}

.gemini-generated-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.gemini-generated-img:hover {
  transform: scale(1.015);
}

.image-overlay-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.generated-image-card:hover .image-overlay-actions {
  opacity: 1;
}

.generated-video-card {
  margin: 14px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-floating);
}

.gemini-generated-video {
  width: 100%;
  max-height: 480px;
  display: block;
}

/* ============================================================
   5. Capsule Input Omnibar Dock
   ============================================================ */
.input-dock-wrapper {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.input-dock-capsule {
  width: 100%;
  background: #1e1f20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 10px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.input-dock-capsule:focus-within {
  border-color: rgba(138, 180, 248, 0.45);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(138, 180, 248, 0.25);
}

/* Active Mode Pill */
.active-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(138, 180, 248, 0.12);
  border: 1px solid rgba(138, 180, 248, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-blue);
  margin-bottom: 8px;
  align-self: flex-start;
  animation: pillIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes pillIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.mode-close-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 14px;
  cursor: pointer;
  margin-left: 4px;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
}

.tools-btn-wrapper {
  position: relative;
}

.tools-trigger-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tools-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: rotate(90deg);
}

.tools-popover-menu {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-dropdown);
  z-index: 200;
  animation: menuIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.tool-menu-item {
  width: 100%;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.tool-menu-item:hover {
  background: var(--bg-surface-high);
}

.tool-icon {
  font-size: 20px;
}

.tool-info {
  display: flex;
  flex-direction: column;
}

.tool-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.tool-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.prompt-textarea {
  flex: 1;
  background: none;
  border: none;
  color: #e3e3e3;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  max-height: 180px;
  outline: none;
  padding: 6px 0;
  line-height: 24px;
}

.prompt-textarea::placeholder {
  color: #8e918f;
}

.input-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.icon-btn-round:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.send-btn-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8ab4f8;
  border: none;
  color: #131314;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.send-btn-round:hover {
  opacity: 0.92;
  transform: scale(1.05);
}

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

.disclaimer-text {
  font-size: 12px;
  color: #8e918f;
  margin-top: 10px;
  text-align: center;
  user-select: none;
}

/* ============================================================
   6. Canvas Workspace Split Panel
   ============================================================ */
.canvas-workspace-panel {
  display: none;
  width: 55%;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition-drawer);
}

.canvas-workspace-panel.open {
  display: flex;
  animation: slideLeft 0.3s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.canvas-workspace-panel.maximized {
  position: absolute;
  inset: 0;
  width: 100% !important;
  z-index: 150;
}

.canvas-header {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-high);
}

.canvas-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  padding: 2px 6px;
  border-radius: 4px;
}

.canvas-title:focus {
  background: var(--bg-surface-highest);
}

.canvas-lang-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(138, 180, 248, 0.15);
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 4px;
}

.canvas-tab-group {
  display: flex;
  background: var(--bg-surface-highest);
  padding: 3px;
  border-radius: var(--radius-full);
}

.canvas-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.canvas-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.canvas-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn-sm:hover {
  background: var(--bg-surface-highest);
  color: var(--text-primary);
}

.canvas-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.canvas-editor-container {
  width: 100%;
  height: 100%;
  display: flex;
  background: #0f111a;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.canvas-line-numbers {
  width: 44px;
  padding: 16px 8px;
  text-align: right;
  color: #4a5568;
  font-size: 13px;
  line-height: 20px;
  user-select: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.canvas-code-textarea {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  padding: 16px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 20px;
  outline: none;
  resize: none;
  white-space: pre;
  overflow: auto;
}

.canvas-preview-container {
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.canvas-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.canvas-ai-action-bar {
  padding: 8px 14px;
  background: var(--bg-surface-high);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.ai-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.canvas-ai-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.canvas-ai-chip:hover {
  background: var(--bg-surface-highest);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

/* ============================================================
   7. Modals & Settings
   ============================================================ */
.modal-backdrop, .lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-dialog {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-dropdown);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-row strong {
  display: block;
  font-size: 14px;
}

.setting-row p {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-danger-sm {
  background: rgba(234, 67, 53, 0.15);
  border: 1px solid rgba(234, 67, 53, 0.3);
  color: #ff8a80;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Helpers */
.hidden {
  display: none !important;
}

.mobile-only {
  display: none;
}

/* ============================================================
   8. Multi-Device Responsive & Mobile Optimizations
   ============================================================ */
@media (max-width: 768px) {
  .mobile-only {
    display: flex;
  }
  
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-topbar {
    height: 52px;
    padding: 0 12px;
  }

  .welcome-title {
    font-size: 26px;
  }

  .input-dock-wrapper {
    padding: 0 12px 14px 12px !important;
  }

  .input-dock-capsule {
    padding: 8px 12px;
    border-radius: 26px;
  }

  .prompt-textarea {
    font-size: 15px;
    line-height: 22px;
  }

  .message-body {
    max-width: 92%;
  }

  .message-bubble {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* ============================================================
   Search Modal Dialog (Instant Filter & Jump)
   ============================================================ */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: fadeIn 0.2s ease-out;
}

.search-modal-container {
  width: 92%;
  max-width: 560px;
  background: #1e1f20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.search-modal-icon {
  color: var(--accent-blue);
  flex-shrink: 0;
}

#search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
}

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

.search-close-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.search-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.search-modal-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.search-empty-hint {
  text-align: center;
  padding: 32px 16px;
  font-size: 14px;
  color: var(--text-tertiary);
}
