/* ==========================================================================
   ASTRA UI - BESPOKE GLASSMORPHISM STYLESHEET (Open Sans Regular Typography)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --font-serif: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'DM Mono', Consolas, 'Courier New', monospace;
  --primary-dark: #111827;
  --text-charcoal: #1e293b;
  --text-muted: #64748b;
  --glass-blur: 24px;
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-card-bg: rgba(255, 255, 255, 0.20);
  --glass-recessed: rgba(255, 255, 255, 0.22);
  --glass-squircle: rgba(255, 255, 255, 0.28);
  --gold-accent: #b48033;
  --red-accent: #e05252;
  --green-accent: #228b6d;

  /* Automatic Contrast Theme Variables */
  --theme-text-color: #1e293b;
  --theme-text-heading: #111827;
  --theme-text-muted: #64748b;
  --theme-text-subtle: rgba(30, 41, 59, 0.65);
  --theme-user-bubble-text: #1e293b;
  --theme-assistant-text: #111827;
}

/* Dark Background Automatic Contrast: Makes text white/light without altering glass physics */
[data-bg-theme="dark"] {
  --theme-text-color: #f8fafc;
  --theme-text-heading: #ffffff;
  --theme-text-muted: #cbd5e1;
  --theme-text-subtle: rgba(241, 245, 249, 0.85);
  --theme-user-bubble-text: #f8fafc;
  --theme-assistant-text: #f8fafc;
}

/* Smooth transition for text contrast changes */
.welcome-brand-title,
.welcome-hero-tagline,
.assistant-content,
.user-bubble,
.sidebar-brand-title,
.recents-header-title,
.upload-card-label,
.uploaded-docs-heading,
.empty-docs-text,
.composer-sub-disclaimer,
.popover-row-label,
.model-spec-label,
.rail-icon-btn,
#message {
  transition: color 0.35s ease;
}

[data-bg-theme="dark"] .welcome-brand-title,
[data-bg-theme="dark"] .sidebar-brand-title,
[data-bg-theme="dark"] .recents-header-title,
[data-bg-theme="dark"] .uploaded-docs-heading,
[data-bg-theme="dark"] .popover-row-label,
[data-bg-theme="dark"] .model-spec-label {
  color: var(--theme-text-heading) !important;
}

[data-bg-theme="dark"] .welcome-hero-tagline,
[data-bg-theme="dark"] .composer-sub-disclaimer,
[data-bg-theme="dark"] .empty-docs-text,
[data-bg-theme="dark"] .upload-card-sub,
[data-bg-theme="dark"] .meta-responded {
  color: var(--theme-text-subtle) !important;
}

[data-bg-theme="dark"] .assistant-content,
[data-bg-theme="dark"] .user-bubble,
[data-bg-theme="dark"] #message {
  color: var(--theme-text-color) !important;
}

[data-bg-theme="dark"] #message::placeholder {
  color: rgba(241, 245, 249, 0.65) !important;
}

[data-bg-theme="dark"] .rail-icon-btn,
[data-bg-theme="dark"] .icon-pill-btn,
[data-bg-theme="dark"] .capsule-squircle-btn,
[data-bg-theme="dark"] .capsule-mic-btn {
  color: var(--theme-text-color);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
}

button, input, textarea, a, select {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
}

button:focus,
button:focus-visible,
button:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

html, body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow-x: hidden !important;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  color: var(--text-charcoal);
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Universal Media Safeguard: Prevent images, canvas, videos, and SVGs from exceeding viewport */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Background Wallpaper (Matches Uploaded Artwork 100%) */
.astra-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('astra_bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Main Shell */
.astra-shell {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow-x: hidden !important;
  overflow-y: hidden;
  box-sizing: border-box;
  padding: 18px 20px;
  gap: 24px;
}

/* ==========================================================================
   COLLAPSED SIDEBAR GLASS RAIL (100% Matching Screenshot)
   ========================================================================== */

.sidebar-rail {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: calc(100vh - 36px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.16) 100%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  border: none;
  border-radius: 34px;
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.12), 0 8px 20px -6px rgba(0, 0, 0, 0.05), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  box-sizing: border-box;
  z-index: 20;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.rail-top-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sidebar-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 34px;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.03) 30%, transparent 60%);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.sidebar-rail.hidden {
  display: none !important;
}

.rail-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--theme-text-color, #1e293b);
  box-shadow: 0 2px 6px rgba(0, 20, 50, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.40);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
}

.rail-icon-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(10, 40, 80, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.60);
}

.rail-icon-btn.active {
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   FLOATING LEFT SIDEBAR CARD (100% Matching Screenshot)
   ========================================================================== */

.sidebar-card {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: calc(100vh - 36px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.09) 45%, rgba(255, 255, 255, 0.04) 75%, rgba(255, 255, 255, 0.16) 100%),
    radial-gradient(ellipse at 40% 10%, rgba(255, 255, 255, 0.24) 0%, transparent 60%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  border: none;
  border-radius: 34px;
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.14), 0 10px 24px -6px rgba(0, 0, 0, 0.05), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 13px;
  box-sizing: border-box;
  z-index: 20;
  position: relative;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.sidebar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 34px;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.03) 30%, transparent 60%);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.sidebar-card.closed {
  transform: translateX(calc(-100% - 30px));
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

/* Sidebar Top Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 4px;
  position: relative;
}

.icon-pill-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #222934;
  box-shadow: 0 2px 6px rgba(10, 25, 45, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.icon-pill-btn:hover {
  background: rgba(255, 255, 255, 0.36);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(10, 30, 60, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.icon-pill-btn.active {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.sidebar-brand-title {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 5.5px;
  color: #1e2530;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  text-transform: uppercase;
  margin: 0;
}

/* New Conversation Pill Button */
.new-conv-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24) 0%, rgba(220, 235, 245, 0.14) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 3px 10px -2px rgba(10, 25, 45, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  transition: all 0.2s ease;
}

.new-conv-pill:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.36) 0%, rgba(230, 242, 250, 0.22) 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px -2px rgba(10, 30, 60, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.green-plus-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-conv-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #222934;
}

/* Sidebar Section Headers */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-align: center;
  color: #334155;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Rounded Recents & Documents Cards - Glass Lens */
.recents-card-box,
.docs-card-box {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 20px;
  height: 98px;
  max-height: 100px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 3px rgba(10, 25, 50, 0.06), inset 0 -1px 1px rgba(255, 255, 255, 0.18);
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.recents-card-box::-webkit-scrollbar,
.docs-card-box::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.muted-box-msg {
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
  padding-top: 26px;
  font-style: italic;
}

/* Items inside Recents and Documents */
.conv-item,
.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: #1e293b;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  box-shadow: none;
}

.conv-item:hover,
.document-item:hover {
  background: rgba(255, 255, 255, 0.28);
}

.conv-item.active,
.document-item.active {
  background: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.conv-item span,
.document-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 14.5px;
  font-weight: 500;
}

.document-item small {
  display: none;
}

.conv-delete-btn,
.document-item button {
  color: #c53030;
  font-size: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  font-weight: 400;
  line-height: 1;
  font-family: inherit;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.conv-delete-btn:hover,
.document-item button:hover {
  opacity: 1;
  transform: scale(1.25);
}

/* Upload Files Dashed Card - Glassmorphism */
.upload-dashed-card {
  border: 1px dashed rgba(70, 90, 110, 0.35);
  border-radius: 22px;
  padding: 12px 8px;
  margin: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(225, 235, 240, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dashed-card:hover {
  background: rgba(230, 240, 245, 0.45);
  border-color: rgba(224, 82, 82, 0.7);
  transform: translateY(-1px);
}

.upload-red-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e05252;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  background: rgba(224, 82, 82, 0.08);
}

.upload-main-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #1e293b;
  text-align: center;
}

.upload-sub-text {
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
  text-align: center;
}

/* Sidebar Bottom Actions */
.sidebar-bottom-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Try Premium Pill - Glassmorphism */
.try-premium-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  background: linear-gradient(135deg, rgba(205, 210, 230, 0.55), rgba(190, 195, 220, 0.4));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03), inset 0 1px 2px rgba(255, 255, 255, 0.85);
  transition: all 0.2s ease;
}

.try-premium-pill:hover {
  background: linear-gradient(135deg, rgba(215, 220, 240, 0.75), rgba(200, 205, 230, 0.55));
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.try-premium-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #1e293b;
}

/* User Profile / Login Pill Bar - Glassmorphism */
.user-profile-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  width: 100%;
  height: 40px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0%, rgba(215, 230, 242, 0.12) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 3px 10px -2px rgba(10, 25, 45, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  color: #2b3342;
  transition: all 0.2s ease;
}

.user-profile-pill:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.35) 0%, rgba(225, 238, 248, 0.22) 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px -2px rgba(10, 30, 60, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.user-profile-name {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #1e293b;
  text-transform: uppercase;
}

/* ==========================================================================
   MAIN CENTRAL WORKSPACE & HERO (100% Matching Screenshot)
   ========================================================================== */

.astra-main {
  flex: 1;
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Top Mini Nav (Hidden to match 100% clean canvas in reference design) */
.top-nav-mini {
  display: none !important;
}

/* Top Right Navigation (Private Mode Toggle) */
.top-right-nav {
  position: absolute;
  top: 14px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-private-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24) 0%, rgba(220, 235, 245, 0.14) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: none;
  box-shadow: 0 4px 12px -2px rgba(15, 35, 65, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.50);
  color: #1e293b;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.top-private-pill:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.38) 0%, rgba(230, 242, 250, 0.24) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(15, 35, 65, 0.09), inset 0 1px 1px rgba(255, 255, 255, 0.70);
  box-shadow: 0 6px 18px rgba(20, 60, 100, 0.1), inset 0 1px 2px rgba(255, 255, 255, 1);
}

.top-private-pill.active {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.top-private-pill.active:hover {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   CENTRAL WORKSPACE CANVAS (Borderless, seamless wallpaper matching mockup)
   ========================================================================== */

.astra-center-stage {
  width: 100%;
  max-width: 880px;
  height: calc(100vh - 36px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  margin: auto;
  transition: padding 0.3s ease;
}

/* ==========================================================================
   1. WELCOME / INITIAL STATE: SEARCH BAR IN THE MIDDLE (Matches Mockup 100%)
   ========================================================================== */

.astra-center-stage.welcome-mode,
.astra-center-stage:has(#welcome:not(.hidden)) {
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 20px 16px;
}

.astra-center-stage.welcome-mode .welcome-greeting-container,
.astra-center-stage:has(#welcome:not(.hidden)) .welcome-greeting-container {
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 0 0 auto;
}

.astra-center-stage.welcome-mode .messages-stream,
.astra-center-stage:has(#welcome:not(.hidden)) .messages-stream {
  display: none !important;
}

.astra-center-stage.welcome-mode .composer-outer-form,
.astra-center-stage:not(.chat-active) .composer-outer-form {
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
  width: 100%;
  max-width: 560px;
  flex: 0 0 auto;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.astra-center-stage.welcome-mode .composer-disclaimer-text,
.astra-center-stage:not(.chat-active) .composer-disclaimer-text {
  display: none;
}

/* ==========================================================================
   2. ACTIVE CHAT STATE: GLASS CARD DITTO MATCHING USER SCREENSHOT
   ========================================================================== */

.astra-center-stage.chat-active {
  justify-content: space-between;
  align-items: center;
  padding: 34px 38px 24px 38px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.16) 42%, rgba(240, 248, 255, 0.12) 75%, rgba(255, 255, 255, 0.28) 100%),
    radial-gradient(ellipse at 40% 12%, rgba(255, 255, 255, 0.36) 0%, transparent 65%);
  backdrop-filter: blur(var(--glass-blur, 36px)) saturate(130%) brightness(103%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 36px)) saturate(130%) brightness(103%);
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 40px;
  box-shadow:
    0 32px 72px -16px rgba(15, 30, 60, 0.14),
    0 16px 36px -8px rgba(20, 45, 85, 0.07),
    0 4px 12px -2px rgba(255, 255, 255, 0.20),
    inset 0 2px 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1.5px 2px 0 rgba(255, 255, 255, 0.30);
  max-width: 860px;
  height: calc(100vh - 40px);
  margin: auto;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.astra-center-stage.chat-active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 40px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 35%, transparent 70%);
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

/* Outside-the-box layout when code editor is generated, exactly matching ChatGPT aesthetics */
.astra-center-stage.chat-active.has-code-view,
.astra-center-stage.chat-active:has(.code-editor-card) {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  max-width: 860px !important;
  padding: 20px 16px 16px 16px !important;
}

.astra-center-stage.chat-active.has-code-view .messages-stream,
.astra-center-stage.chat-active:has(.code-editor-card) .messages-stream {
  padding-right: 6px;
}

.astra-center-stage.chat-active.has-code-view .composer-outer-form,
.astra-center-stage.chat-active:has(.code-editor-card) .composer-outer-form {
  max-width: 820px;
}

.astra-center-stage.chat-active .welcome-greeting-container {
  display: none !important;
}

.astra-center-stage.chat-active .messages-stream {
  display: flex !important;
  flex: 1;
  min-height: 0;
  width: 100%;
  align-self: stretch;
}

.astra-center-stage.chat-active .composer-outer-form {
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
  width: 100%;
  max-width: 100%;
}

/* Welcome Homepage Hero (100% Matching Reference Screenshot) */
.welcome-greeting-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: auto 0;
  padding: 24px 20px;
  text-align: center;
  transition: opacity 0.25s ease;
  user-select: none;
}

.welcome-greeting-container.hidden {
  display: none !important;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.welcome-brand-title {
  font-family: var(--font-serif);
  font-size: clamp(52px, 8.5vw, 84px);
  font-weight: 400;
  letter-spacing: 6px;
  color: #1e293b;
  margin: 0;
  line-height: 1;
  text-transform: uppercase;
}

.welcome-brand-logo {
  height: 64px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Free Plan Upgrade Pill Button */
.welcome-upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 20px;
  background: rgba(220, 215, 205, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 2px 8px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  margin-top: 2px;
}

.welcome-upgrade-pill:hover {
  background: rgba(235, 228, 215, 0.75);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(180, 128, 51, 0.16);
}

.pill-plan-label {
  color: #57534e;
  font-weight: 500;
}

.pill-upgrade-accent {
  color: #b48033;
  font-weight: 700;
}

.welcome-hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 400;
  letter-spacing: 2.5px;
  color: rgba(30, 41, 59, 0.65);
  margin: 14px 0 0 0;
  text-transform: uppercase;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.astra-avatar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  user-select: none;
}

.astra-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

/* ==========================================================================
   MESSAGES STREAM (Conversational Exchange Matching Screenshot)
   ========================================================================== */

.messages-stream {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 18px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 175, 195, 0.45) transparent;
}

/* Messages start from top and flow naturally downward */

/* When welcome is active, hide messages-stream so welcome is perfectly centered */
.welcome-greeting-container:not(.hidden) ~ .messages-stream {
  display: none !important;
}

/* Ultra-smooth, elegant, non-glitching custom scrollbar */
.messages-stream::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.messages-stream::-webkit-scrollbar-track {
  background: transparent;
}

.messages-stream::-webkit-scrollbar-thumb {
  background: rgba(145, 175, 195, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease;
}

.messages-stream:hover::-webkit-scrollbar-thumb,
.messages-stream::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 140, 170, 0.65);
}

.message-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* User Message: Lavender Frosted Glass Rounded Box in Top-Right */
.message-card.user {
  align-items: flex-end;
  align-self: flex-end;
  margin-left: auto;
  max-width: 80%;
  min-width: 0;
  box-sizing: border-box;
}

.user-bubble {
  background: linear-gradient(145deg, rgba(165, 145, 220, 0.60) 0%, rgba(135, 115, 200, 0.48) 100%) !important;
  backdrop-filter: blur(20px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  border-radius: 18px;
  padding: 10px 24px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
  font-weight: 400;
  color: #1a1033;
  box-shadow:
    0 8px 20px -4px rgba(65, 50, 110, 0.16),
    0 2px 6px -1px rgba(45, 35, 80, 0.08),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.10) !important;
  word-break: break-word;
  overflow-wrap: anywhere !important;
  white-space: pre-wrap;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Dark background: flip to a lighter tonal surface so dark text stays legible */
[data-bg-theme="dark"] .user-bubble {
  background: linear-gradient(145deg, rgba(230, 220, 255, 0.22) 0%, rgba(200, 185, 255, 0.14) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f0ecff !important;
  box-shadow:
    0 8px 20px -4px rgba(0, 0, 0, 0.28),
    0 2px 6px -1px rgba(0, 0, 0, 0.16),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12) !important;
}

/* User Message bubble in Code View matching ChatGPT screenshot */
.astra-center-stage.has-code-view .message-card.user .user-bubble,
.astra-center-stage:has(.code-editor-card) .message-card.user .user-bubble {
  background: #1e3a5f !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 20px !important;
  padding: 11px 22px !important;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 16.5px !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22) !important;
}

/* Assistant Message: Left-aligned with A* Avatar & Open Sans Regular font */
.message-card.assistant {
  align-items: flex-start;
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.assistant-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* In Code View: Hide Astra avatar so code editor card spans full width like ChatGPT */
.astra-center-stage.has-code-view .message-card.assistant .assistant-row,
.astra-center-stage:has(.code-editor-card) .message-card.assistant .assistant-row {
  display: block !important;
  width: 100% !important;
}

.astra-center-stage.has-code-view .astra-avatar-logo,
.astra-center-stage:has(.code-editor-card) .astra-avatar-logo {
  display: none !important;
}

.assistant-body {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden;
  box-sizing: border-box;
}

.astra-center-stage.has-code-view .assistant-body,
.astra-center-stage:has(.code-editor-card) .assistant-body {
  width: 100% !important;
  max-width: 100% !important;
}

.assistant-content {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  color: #111827;
  font-weight: 400;
  word-break: break-word;
  overflow-wrap: anywhere !important;
  white-space: normal;
  letter-spacing: 0.1px;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.assistant-content p,
.assistant-content li,
.assistant-content blockquote,
.assistant-content h1,
.assistant-content h2,
.assistant-content h3,
.assistant-content h4,
.assistant-content h5,
.assistant-content h6 {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.assistant-content .assistant-p {
  margin-top: 0;
  margin-bottom: 15px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

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

.assistant-content .chat-break {
  display: block;
  content: "";
  margin-top: 6px;
}

.assistant-content ul.chat-list,
.assistant-content ol.chat-list {
  margin: 8px 0 16px 0;
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  list-style-position: outside;
}

.assistant-content ul.chat-list {
  list-style-type: disc;
}

.assistant-content ol.chat-list {
  list-style-type: decimal;
}

.assistant-content .chat-li {
  line-height: 1.55;
  margin-bottom: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.assistant-content .chat-subheading {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 18px 0 8px;
  color: inherit;
  line-height: 1.35;
}

.assistant-content .chat-subheading:first-child {
  margin-top: 0;
}

.astra-center-stage.has-code-view .assistant-content,
.astra-center-stage:has(.code-editor-card) .assistant-content {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 16.5px !important;
  line-height: 1.65 !important;
  font-weight: 400 !important;
  color: #0f172a !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.assistant-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: #78716c;
}

.meta-responded {
  color: #78716c;
  font-size: 14px;
}

.action-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  color: #111827;
  transform: scale(1.15);
}

/* ==========================================================================
   UNIFIED FLOATING COMPOSER CARD (100% Ditto Matching Reference Mockup)
   ========================================================================== */

.composer-outer-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

/* Outer Frosted Glass Card - matches user screenshot rounded card */
.composer-floating-card {
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.composer-floating-card:focus-within {
  background: transparent;
  box-shadow: none;
}

/* Active Document Tag (Small frosted chip on top of textbox) */
.active-doc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  font-size: 11px;
  font-weight: 500;
  color: #1e293b;
  margin-left: 6px;
  margin-bottom: 2px;
  width: fit-content;
  max-width: calc(100% - 28px);
  align-self: flex-start;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.active-doc-tag.hidden {
  display: none !important;
}

.active-doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  flex-shrink: 0;
}

.active-doc-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: #1e293b;
}

.remove-doc-tag-btn {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  transition: all 0.15s ease;
}

.remove-doc-tag-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

/* Recessed Pill - Optical glass cavity with recessed depth */
.composer-recessed-pill {
  width: 100%;
  background: linear-gradient(180deg, rgba(225, 238, 246, 0.30) 0%, rgba(200, 220, 235, 0.18) 100%);
  backdrop-filter: blur(24px) saturate(150%) brightness(102%);
  -webkit-backdrop-filter: blur(24px) saturate(150%) brightness(102%);
  border: none;
  border-radius: 30px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  box-sizing: border-box;
  box-shadow:
    inset 0 2px 5px rgba(10, 30, 60, 0.07),
    inset 0 1px 1px rgba(255, 255, 255, 0.40),
    0 6px 20px -4px rgba(10, 25, 50, 0.05);
  transition: all 0.22s ease;
}

.composer-recessed-pill:focus-within {
  background: linear-gradient(180deg, rgba(235, 244, 250, 0.40) 0%, rgba(210, 228, 242, 0.26) 100%);
  border: none;
  box-shadow:
    inset 0 2px 5px rgba(10, 30, 60, 0.09),
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 10px 28px -4px rgba(10, 30, 60, 0.09);
}

#message {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  color: #24303e;
  font-weight: 400;
  line-height: 26px;
  height: 26px;
  padding: 0 8px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#message::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#message::placeholder {
  color: rgba(62, 80, 98, 0.68);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.1px;
  line-height: 26px;
}

/* Squircles matching image: square with soft rounded corners inside pill */
.capsule-squircle-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(132, 160, 185, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #2d3a4b;
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.75), 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}

.capsule-squircle-btn:hover {
  background: rgba(132, 160, 185, 0.68);
  border-color: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.95), 0 4px 10px rgba(0, 0, 0, 0.06);
}

.capsule-squircle-btn.send-btn {
  background: rgba(125, 155, 215, 0.62);
  color: #1e293b;
  border-color: rgba(255, 255, 255, 0.65);
}

.capsule-squircle-btn.send-btn:hover {
  background: rgba(125, 155, 215, 0.85);
  color: #0f172a;
}

.capsule-squircle-btn:disabled,
.capsule-squircle-btn.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.composer-attach-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Bottom Disclaimer & Astracore Toggle Row (matching screenshot perfectly) */
.composer-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px 0 14px;
  width: 100%;
  box-sizing: border-box;
}

.composer-sub-disclaimer {
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: #475569;
  font-style: normal;
  user-select: none;
}

.model-spec-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.model-spec-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.model-spec-toggle-btn.detailed-active {
  background: rgba(195, 185, 235, 0.55);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 10px rgba(120, 110, 180, 0.15);
}

.model-spec-label {
  font-family: var(--font-serif);
  font-size: 15px;
  color: #1e293b;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.live-web-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-left: 2px;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  animation: astraPulseLive 2.2s infinite ease-in-out;
  transition: opacity 0.2s ease;
}

.live-web-dot.offline {
  background: #94a3b8;
  box-shadow: none;
  animation: none;
}

@keyframes astraPulseLive {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  60% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.engine-mode-tag {
  font-family: var(--font-serif);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.model-spec-toggle-btn.detailed-active .engine-mode-tag {
  background: #2563eb;
  color: #ffffff;
}

/* Attachment Dropdown Menu - Glassmorphism matching website aura */
.attach-dropdown {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  min-width: 250px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.55) 0%, rgba(230, 242, 252, 0.42) 100%);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border: none;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 24px 60px -12px rgba(15, 28, 55, 0.20), 0 8px 24px -4px rgba(0, 15, 35, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.70);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
  transform-origin: bottom left;
  animation: attachDropIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.attach-dropdown.hidden {
  display: none !important;
}

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

.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 20, 50, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.50);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.attach-menu-item:hover {
  background: rgba(255, 255, 255, 0.50);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20, 60, 100, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.70);
}

.attach-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.attach-menu-icon.doc-icon-bg {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.attach-menu-icon.voice-icon-bg {
  background: rgba(224, 82, 82, 0.08);
  border: 1px solid rgba(224, 82, 82, 0.2);
}

.attach-menu-info {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.attach-menu-info strong {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

.attach-menu-info small {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.2;
}

/* Standalone Mic Button */
.capsule-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: all 0.2s ease;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.capsule-mic-btn:hover {
  color: #0f172a;
  transform: scale(1.1);
}

/* Voice Search Pill - Matches Image 2 Reference media_1789449175823.png */
.voice-search-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 22px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
  border: 1px solid transparent;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.voice-search-pill.active {
  background: rgba(215, 125, 125, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(14px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(125%) !important;
  padding: 4px 10px 4px 12px !important;
  box-shadow: 0 3px 12px rgba(220, 38, 38, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  animation: voicePillPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes voicePillPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.voice-search-pill.active .capsule-mic-btn,
.voice-search-pill.active .composer-home-mic-btn {
  color: #3b1d22 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.voice-search-pill.active .capsule-mic-btn svg,
.voice-search-pill.active .composer-home-mic-btn svg {
  stroke: #3b1d22 !important;
  animation: micGentleBreathe 1.5s ease-in-out infinite alternate !important;
}

[data-bg-theme="dark"] .voice-search-pill.active {
  background: linear-gradient(135deg, rgba(235, 95, 95, 0.45) 0%, rgba(200, 70, 70, 0.35) 100%) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

[data-bg-theme="dark"] .voice-search-pill.active .capsule-mic-btn,
[data-bg-theme="dark"] .voice-search-pill.active .composer-home-mic-btn {
  color: #ffffff !important;
}

[data-bg-theme="dark"] .voice-search-pill.active .capsule-mic-btn svg,
[data-bg-theme="dark"] .voice-search-pill.active .composer-home-mic-btn svg {
  stroke: #ffffff !important;
}

[data-bg-theme="dark"] .voice-search-pill.active .wave-bar {
  background: #ffffff !important;
}

.voice-wave-container {
  display: flex !important;
  align-items: center !important;
  gap: 2.5px !important;
  height: 22px !important;
  padding: 0 2px !important;
  pointer-events: none;
}

.voice-wave-container.hidden {
  display: none !important;
}

.wave-bar {
  width: 2.2px;
  border-radius: 2px;
  background: #3b1d22;
  animation: wavePulse 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.25s; }
.wave-bar:nth-child(3) { height: 18px; animation-delay: 0.05s; }
.wave-bar:nth-child(4) { height: 10px; animation-delay: 0.35s; }
.wave-bar:nth-child(5) { height: 22px; animation-delay: 0.15s; }
.wave-bar:nth-child(6) { height: 14px; animation-delay: 0.3s; }
.wave-bar:nth-child(7) { height: 19px; animation-delay: 0.2s; }
.wave-bar:nth-child(8) { height: 8px; animation-delay: 0.4s; }
.wave-bar:nth-child(9) { height: 16px; animation-delay: 0.12s; }
.wave-bar:nth-child(10) { height: 11px; animation-delay: 0.28s; }
.wave-bar:nth-child(11) { height: 7px; animation-delay: 0.08s; }
.wave-bar:nth-child(12) { height: 14px; animation-delay: 0.22s; }

@keyframes wavePulse {
  0% { transform: scaleY(0.25); opacity: 0.55; }
  100% { transform: scaleY(1.3); opacity: 1; }
}

/* Model Specifier Label */
.model-spec-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #334155;
  user-select: none;
}

/* Composer Disclaimer & Model Row */
.composer-disclaimer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px 0 12px;
  width: 100%;
  box-sizing: border-box;
}

.composer-disclaimer-text {
  font-family: var(--font-serif);
  font-size: 13px;
  color: #52525b;
  font-style: italic;
}

.model-spec-label {
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: #3f3f46;
  letter-spacing: 0.3px;
}

/* Important / Emphasized words in Agent Responses: Refined Indigo Accent & Font-Weight */
.message-card.assistant .bubble-content strong,
.message-card.assistant .bubble-content b,
.message-card.assistant strong,
.message-card.assistant b,
.agent-important-word {
  font-weight: 700 !important;
  color: #1e1b4b !important;
}

[data-bg-theme="dark"] .message-card.assistant strong,
[data-bg-theme="dark"] .message-card.assistant b,
[data-bg-theme="dark"] .agent-important-word {
  color: #a5b4fc !important;
}

/* User messages preserve normal styling */
.message-card.user .bubble-content strong,
.message-card.user .bubble-content b,
.message-card.user strong,
.message-card.user b {
  font-weight: 700;
  color: inherit !important;
}

/* Chemistry Problem Answer - Badge hidden per user instruction */
.chemistry-badge,
.message-card.assistant.chemistry-response .chemistry-badge {
  display: none !important;
}

.chat-subheading {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  margin: 10px 0 4px;
  color: inherit;
}

.bubble-content h1, .bubble-content h2, .bubble-content h3 {
  font-family: var(--font-serif);
  margin: 14px 0 8px;
  color: #111827;
}

.bubble-content p {
  margin-bottom: 10px;
}

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

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

.bubble-content li {
  margin-bottom: 4px;
}

.bubble-content pre {
  background: rgba(30, 41, 59, 0.88);
  color: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 13px;
  margin: 10px 0;
}

.bubble-content code {
  background: rgba(145, 175, 195, 0.3);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12.5px;
}

.response-time-pill {
  font-size: 11px;
  color: #64748b;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Polished Thinking State Animation */
.assistant-content.thinking {
  color: #64748b;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  animation: thinkingPulse 1.4s ease-in-out infinite;
}

@keyframes thinkingPulse {
  0%, 100% {
    opacity: 0.55;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.14);
  padding: 4px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.source-chip.source-link:hover {
  background: #ffffff;
  border-color: #2563eb;
  color: #1d4ed8;
  transform: translateY(-1px);
}

[data-bg-theme="dark"] .source-chip {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

[data-bg-theme="dark"] .source-chip.source-link:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #60a5fa;
  color: #93c5fd;
}

/* ==========================================================================
   MODALS (Glassmorphic, Auth & Confirmations)
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  animation: modalFadeIn 0.2s ease;
}

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

.glass-modal-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: auto;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-brand-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #1e2530;
}

.modal-eyebrow {
  font-size: 10px;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 2px;
}

.modal-h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: #111827;
  margin-top: 4px;
}

.close-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748b;
  transition: all 0.15s ease;
}

.close-icon-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #111827;
}

.modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.modal-tab {
  flex: 1;
  padding: 7px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
}

.modal-tab.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.auth-modal-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 12px;
}

.auth-modal-form input {
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
  box-sizing: border-box;
}

.math-challenge-box {
  background: rgba(145, 175, 195, 0.2);
  border: 1px solid rgba(145, 175, 195, 0.4);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0 16px;
}

.math-challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.math-title {
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: 0.5px;
}

.refresh-math-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
}

.math-question-text {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  padding: 4px 0;
  letter-spacing: 1px;
}

.math-hint {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 6px;
}

.modal-primary-btn {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: #1e293b;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 4px;
}

.modal-primary-btn:hover {
  background: #0f172a;
}

.modal-secondary-btn {
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.modal-secondary-btn:hover {
  background: #f8fafc;
}

.modal-danger-btn {
  padding: 9px 16px;
  border-radius: 12px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

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

/* Password toggle & auth extra styles */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 40px !important;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  color: #475569;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.pwd-toggle-btn:hover {
  opacity: 0.8;
}

.auth-extra-row {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 8px;
}

.link-btn {
  background: none;
  border: none;
  color: #0284c7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.link-btn:hover {
  color: #0369a1;
}


.auth-sub-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 14px;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #b91c1c;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
}


/* Download Code Button */
.download-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.download-code-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.auth-status-msg {
  font-size: 13px;
  color: #475569;
  margin: 12px 0 16px;
  text-align: center;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  color: #fff;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS SYSTEM (320px, 375px, 390px, 412px, 430px, 768px, 860px)
   ========================================================================== */

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 85;
  transition: opacity 0.25s ease;
}

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

.mobile-nav-bar {
  display: none;
}

@media (max-width: 860px) {
  /* Shell & Workspace Bounds */
  .astra-shell {
    padding: 0 0 env(safe-area-inset-bottom, 0px) 0;
    gap: 0;
    height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    flex-direction: column;
  }

  /* Dedicated Mobile Glass Navigation Bar */
  .mobile-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%);
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    z-index: 70;
    flex-shrink: 0;
  }

  .mobile-nav-brand {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #111827;
  }

  [data-bg-theme="dark"] .mobile-nav-brand {
    color: #ffffff !important;
  }

  .mobile-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-nav-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(10, 25, 45, 0.05);
    transition: transform 0.15s ease, background 0.15s ease;
    padding: 0;
    touch-action: manipulation;
  }

  [data-bg-theme="dark"] .mobile-nav-icon-btn {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.14) !important;
  }

  .mobile-nav-icon-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.45);
  }

  .mobile-user-btn {
    position: relative;
  }

  .mobile-user-btn.logged-in::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  }

  /* Collapsed Rail is replaced by top mobile-nav-bar on mobile */
  .sidebar-rail {
    display: none !important;
  }

  /* Full Sidebar Drawer as Slide-Over Sheet */
  .sidebar-card {
    position: fixed !important;
    top: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: min(320px, calc(100vw - 20px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 28px !important;
    z-index: 100 !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38), 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .sidebar-card.closed {
    transform: translateX(calc(-100% - 30px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .sidebar-bottom-actions {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding-top: 10px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .recents-card-box,
  .docs-card-box {
    max-height: 84px !important;
    flex-shrink: 1 !important;
  }

  /* Main Workspace */
  .astra-main {
    flex: 1;
    width: 100%;
    height: calc(100% - 52px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Central Stage Canvas */
  .astra-center-stage {
    width: 100%;
    max-width: 100%;
    flex: 1;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .astra-center-stage.welcome-mode,
  .astra-center-stage:has(#welcome:not(.hidden)) {
    justify-content: center;
    align-items: center;
    padding: 16px 12px;
    gap: 18px;
  }

  .astra-center-stage.chat-active {
    padding: 8px 10px 8px 10px;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: 100%;
    max-width: 100%;
  }

  .astra-center-stage.chat-active::before {
    display: none !important;
  }

  /* Messages Stream */
  .messages-stream {
    padding: 4px 2px 10px 2px;
    gap: 12px;
    flex: 1;
    min-height: 0;
  }

  .message-card.user {
    max-width: 90%;
  }

  .user-bubble {
    font-size: 16.5px;
    line-height: 1.42;
    padding: 10px 16px;
    border-radius: 18px;
  }

  .assistant-row {
    gap: 8px;
  }

  .astra-avatar-logo {
    width: 28px;
    height: 28px;
  }

  .astra-logo-img {
    width: 26px;
    height: 26px;
  }

  .assistant-content {
    font-size: 18px;
    line-height: 1.48;
  }

  /* Floating Composer Card */
  .composer-outer-form {
    width: 100%;
    max-width: 100%;
    padding: 2px 0 0 0;
    margin-top: auto;
  }

  .composer-floating-card {
    width: 100%;
    max-width: 100%;
  }

  .composer-recessed-pill {
    border-radius: 26px;
    min-height: 52px;
    padding: 4px 6px;
    gap: 6px;
    background: linear-gradient(180deg, rgba(225, 238, 246, 0.45) 0%, rgba(200, 220, 235, 0.32) 100%);
    box-shadow: inset 0 1.5px 3px rgba(10, 30, 60, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 4px 14px rgba(0, 0, 0, 0.05);
  }

  #message {
    font-size: 17.5px;
    line-height: 24px;
    height: 26px;
    padding: 0 4px;
  }

  #message::placeholder {
    font-size: 17px;
    line-height: 24px;
  }

  .capsule-squircle-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    touch-action: manipulation;
  }

  .capsule-squircle-btn svg {
    width: 18px;
    height: 18px;
  }

  .composer-sub-row {
    padding: 4px 6px 0 6px;
  }

  .composer-sub-disclaimer {
    font-size: 11.5px;
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .model-spec-label {
    font-size: 12px;
  }

  /* Attachment Dropdown on Mobile */
  .attach-dropdown {
    min-width: 210px;
    max-width: calc(100vw - 28px);
    bottom: calc(100% + 8px);
    left: 0;
  }

  /* Deep Research & Reasoning widgets */
  .deep-research-badge-card {
    max-width: 100%;
    border-radius: 14px;
  }

  /* Modals: fit comfortably on touch devices */
  .modal {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .glass-modal-card {
    padding: 18px 16px !important;
    border-radius: 22px !important;
    max-width: min(420px, calc(100vw - 20px)) !important;
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
  }

  .modal-h2 {
    font-size: 19px !important;
  }

  .modal-tabs {
    margin-bottom: 12px !important;
  }

  .modal-tab {
    padding: 6px !important;
    font-size: 12.5px !important;
  }

  .auth-modal-form label {
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }

  .auth-modal-form input {
    padding: 8px 10px !important;
    font-size: 13px !important;
    margin-top: 3px !important;
  }

  .math-challenge-box {
    padding: 10px 12px !important;
    margin: 8px 0 12px !important;
    border-radius: 12px !important;
  }

  .math-question-text {
    font-size: 16px !important;
    padding: 2px 0 !important;
  }

  .modal-primary-btn,
  .modal-secondary-btn {
    padding: 10px 16px !important;
    font-size: 13.5px !important;
    border-radius: 14px !important;
  }
}

/* Extra small phones (320px - 380px) */
@media (max-width: 380px) {
  .welcome-brand-title {
    font-size: 28px !important;
    letter-spacing: 1.5px !important;
  }

  .welcome-hero-tagline {
    font-size: 11px !important;
    letter-spacing: 1px !important;
  }

  .capsule-squircle-btn,
  .composer-home-mic-btn,
  .composer-home-send-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 10px !important;
  }

  .capsule-squircle-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .composer-recessed-pill {
    padding: 4px 6px !important;
    gap: 4px !important;
    min-height: 48px !important;
  }

  #message {
    font-size: 15px !important;
    line-height: 22px !important;
  }

  #message::placeholder {
    font-size: 14px !important;
  }

  .composer-sub-disclaimer {
    display: none !important;
  }

  .message-card.user {
    max-width: 95% !important;
  }

  .user-bubble {
    font-size: 14.5px !important;
    padding: 8px 11px !important;
  }

  .assistant-content {
    font-size: 15.5px !important;
  }

  .model-engine-popover,
  .attach-dropdown {
    max-width: calc(100vw - 12px) !important;
  }
}

/* ==========================================================================
   DEEP RESEARCH PROCESS CARD & METHODOLOGY ACCORDION
   ========================================================================== */

.deep-research-badge-card {
  width: 100%;
  max-width: 720px;
  margin-bottom: 14px;
  background: rgba(235, 243, 250, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 35, 65, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.85);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.deep-research-badge-card:hover {
  background: rgba(235, 243, 250, 0.75);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(15, 35, 65, 0.07);
}

.deep-research-badge-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.deep-research-glow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 8px #0ea5e9, 0 0 14px rgba(14, 165, 233, 0.5);
  animation: pulseGlow 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 12px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.8);
  }
}

.deep-research-badge-title {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.3px;
}

.deep-research-badge-meta {
  font-family: var(--font-serif);
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}

.deep-research-chevron {
  margin-left: auto;
  font-size: 13px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.deep-research-details-box {
  padding: 10px 14px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInDown 0.2s ease-out;
}

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

.research-angles-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.angles-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
}

.angles-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.research-angle-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.research-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  border-left: 2px solid rgba(14, 165, 233, 0.25);
  padding-left: 12px;
  margin-left: 4px;
}

.research-step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}

.research-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
  margin-top: 4px;
  position: absolute;
  left: -16px;
}

.research-step-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.research-step-info strong {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
}

.research-step-info span {
  font-size: 11px;
  color: #64748b;
}

/* ==========================================================================
   DEEP RESEARCH DATA TABLES & CALLOUTS
   ========================================================================== */

.deep-research-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(15, 35, 65, 0.03);
}

.deep-research-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.deep-research-table th {
  background: rgba(220, 235, 248, 0.6);
  color: #1e293b;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.deep-research-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #334155;
}

.deep-research-table tr:last-child td {
  border-bottom: none;
}

.deep-research-table tr:hover td {
  background: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   INTERACTIVE 3D WEBGL VIEWPORT CARD
   ========================================================================== */

.interactive-3d-card {
  width: 100%;
  max-width: 740px;
  margin: 18px 0;
  background: #090e1a;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 24px rgba(56, 189, 248, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.interactive-3d-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 0 32px rgba(56, 189, 248, 0.14);
}

.interactive-3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.interactive-3d-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interactive-3d-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.interactive-3d-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.2px;
}

.interactive-3d-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn-3d {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ctrl-btn-3d:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.ctrl-btn-3d.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

.interactive-3d-viewport {
  position: relative;
  width: 100%;
  height: 360px;
  background: radial-gradient(circle at 50% 50%, #0d1527 0%, #050811 100%);
  overflow: hidden;
  cursor: grab;
}

.interactive-3d-viewport:active {
  cursor: grabbing;
}

.interactive-3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.interactive-3d-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 29, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10.5px;
  color: #94a3b8;
  pointer-events: none;
  white-space: nowrap;
}

.interactive-3d-desc {
  padding: 10px 16px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fullscreen-3d {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
}

.fullscreen-3d .interactive-3d-viewport {
  height: calc(100vh - 90px) !important;
}

/* ==========================================================================
   INTERACTIVE DATA CHART CARD (CHART.JS)
   ========================================================================== */

.interactive-chart-card {
  width: 100%;
  max-width: 740px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 35, 65, 0.05), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.interactive-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(235, 243, 250, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.interactive-chart-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interactive-chart-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.interactive-chart-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

.chart-download-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #475569;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-download-btn:hover {
  background: #ffffff;
  color: #0284c7;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.interactive-chart-body {
  position: relative;
  width: 100%;
  height: 320px;
  padding: 16px 20px;
}

/* ==========================================================================
   INTERACTIVE MERMAID DIAGRAM CARD
   ========================================================================== */

.interactive-mermaid-card {
  width: 100%;
  max-width: 740px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(15, 35, 65, 0.04);
  overflow: hidden;
}

.interactive-mermaid-header {
  padding: 10px 16px;
  background: rgba(241, 245, 249, 0.7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.interactive-mermaid-badge {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.interactive-mermaid-card .mermaid {
  padding: 18px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

/* ==========================================================================
   AI GENERATED ARTWORK & IMAGE CARD RESPONSIVENESS
   ========================================================================== */

.chat-image-card {
  width: 100%;
  max-width: 520px;
  margin: 16px 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.chat-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  cursor: pointer;
  background: #0b0f19;
}

.chat-image-preview {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-image-wrapper:hover .chat-image-preview {
  transform: scale(1.02);
}

.chat-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chat-image-wrapper:hover .chat-image-overlay {
  opacity: 1;
}

.chat-image-overlay-text {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.65);
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.chat-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.chat-image-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.chat-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-image-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chat-image-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   RESPONSIVE KATEX & MATH CONTAINERS
   ========================================================================== */

.math-block-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  margin: 12px 0 !important;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  text-align: center;
  scrollbar-width: thin;
}

.katex-display {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  padding: 4px 0 !important;
  margin: 6px 0 !important;
  scrollbar-width: thin;
}

.math-block-wrapper::-webkit-scrollbar,
.katex-display::-webkit-scrollbar {
  height: 4px;
}

.math-block-wrapper::-webkit-scrollbar-thumb,
.katex-display::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.katex {
  max-width: 100% !important;
  text-rendering: auto;
}

.math-fallback-chunk {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  vertical-align: middle;
}

@media screen and (max-width: 768px) {
  .math-block-wrapper {
    padding: 8px 10px !important;
    margin: 10px 0 !important;
    font-size: 0.95rem !important;
  }
  .math-block-wrapper .katex-display {
    margin: 2px 0 !important;
    font-size: 1.05em !important;
  }
}

@media screen and (max-width: 480px) {
  .math-block-wrapper {
    padding: 6px 8px !important;
    font-size: 0.88rem !important;
  }
  .math-block-wrapper .katex-display {
    font-size: 0.96em !important;
  }
}

/* ==========================================================================
   CODE BLOCK CARDS & INLINE CODE
   ========================================================================== */

.code-editor-card,
.code-block-card {
  width: 100%;
  max-width: 100%;
  margin: 16px 0;
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.code-editor-header,
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0e1422;
  padding: 9px 16px;
  background: #212121;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.code-editor-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-lang-icon {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: -0.5px;
}

.code-lang-title {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  color: #ececec;
  letter-spacing: 0.2px;
}

.code-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Multi-tab Code Project Bar */
.code-editor-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 68%;
}

.code-editor-tabs-bar::-webkit-scrollbar {
  display: none;
}

.code-editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 10px;
  color: #9ca3af;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  user-select: none;
}

.code-editor-tab:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}

.code-editor-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.code-editor-tab .tab-icon {
  font-size: 14px;
}

/* Enhanced Copy Code Button */
.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d1d5db;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.copy-code-btn.copied {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

/* Code Editor Tabs Bar */
.code-editor-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(10, 15, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  overflow-x: auto;
}

.code-editor-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: rgba(209, 213, 219, 0.65);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}

.code-editor-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.code-editor-tab.active {
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.35);
}

/* Tab Panels */
.code-tab-panel {
  width: 100%;
}

.code-tab-panel.hidden {
  display: none !important;
}

.code-editor-viewport {
  background: #171717;
  overflow-x: auto;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.code-editor-viewport::-webkit-scrollbar {
  height: 6px;
}

.code-editor-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.code-editor-pre,
.code-block-pre {
  margin: 0 !important;
  padding: 16px 20px !important;
  background: #171717 !important;
  color: #f3f4f6 !important;
  font-family: 'Consolas', 'Fira Code', 'DM Mono', Monaco, 'Courier New', monospace !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  tab-size: 4;
  white-space: pre !important;
  word-break: normal !important;
  word-wrap: normal !important;
  overflow-x: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-overflow-scrolling: touch;
}

.code-editor-code {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
}

.chat-inline-code {
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  background: rgba(56, 189, 248, 0.12);
  color: #0284c7;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

/* ==========================================================================
   TEMPORARY CHAT MODE: VERY SUBTLE ELEGANT GLASS TINT & GLOW
   ========================================================================== */

/* Very subtle glass overlay transition on shell */
.astra-shell {
  transition: filter 0.4s ease, background-color 0.4s ease;
}

body.temporary-chat-mode .astra-shell,
body.incognito-mode .astra-shell {
  /* Extremely subtle darkening of background/shell - elegant and barely noticeable */
  background-color: rgba(10, 20, 35, 0.07);
}

/* Subtle, elegant glass tint on floating center stage */
body.temporary-chat-mode .astra-center-stage.chat-active,
body.incognito-mode .astra-center-stage.chat-active {
  background:
    linear-gradient(135deg, rgba(240, 245, 255, 0.22) 0%, rgba(200, 215, 235, 0.08) 40%, rgba(180, 200, 225, 0.05) 70%, rgba(220, 235, 250, 0.14) 100%),
    radial-gradient(ellipse at 30% 10%, rgba(230, 240, 255, 0.20) 0%, transparent 60%) !important;
  box-shadow:
    0 32px 64px -16px rgba(5, 15, 30, 0.22),
    0 16px 32px -8px rgba(5, 15, 30, 0.12),
    0 4px 12px -2px rgba(5, 15, 30, 0.06),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Sidebar in Temporary Chat mode: subtle tint */
body.temporary-chat-mode .sidebar-card,
body.incognito-mode .sidebar-card,
body.temporary-chat-mode .sidebar-rail,
body.incognito-mode .sidebar-rail {
  background:
    linear-gradient(145deg, rgba(235, 242, 252, 0.22) 0%, rgba(210, 225, 245, 0.08) 45%, rgba(190, 210, 235, 0.04) 75%, rgba(220, 235, 250, 0.14) 100%) !important;
}

/* Recessed pill input in Temporary Chat mode: subtle deeper optical tint while preserving glass physics */
body.temporary-chat-mode .composer-recessed-pill,
body.incognito-mode .composer-recessed-pill {
  background: rgba(230, 238, 248, 0.28) !important;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

/* Floating indicator badge for Temporary Chat mode */
.temp-mode-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--theme-text-color, #334155);
  user-select: none;
  transition: all 0.3s ease;
}

/* Active Temporary Chat Toggle button state */
.disappearing-chat-btn.active,
.rail-icon-btn.disappearing-chat-btn.active {
  background: rgba(37, 99, 235, 0.22) !important;
  color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

/* ==========================================================================
   MODEL ENGINE POPOVER & TEMPORARY CHAT (100% Matching Screenshot)
   ========================================================================== */

.engine-toggle-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.model-engine-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 250px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(235, 245, 255, 0.88) 100%);
  backdrop-filter: blur(40px) saturate(200%) brightness(108%);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(108%);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 24px;
  padding: 16px 18px;
  box-shadow:
    0 28px 72px -12px rgba(18, 38, 68, 0.28),
    0 8px 24px -4px rgba(0, 15, 35, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.90);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  transform-origin: bottom right;
  animation: popoverFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

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

/* Dark mode: solid opaque background to prevent text behind from bleeding through */
[data-bg-theme="dark"] .model-engine-popover {
  background: linear-gradient(165deg, rgba(18, 26, 44, 0.96) 0%, rgba(12, 18, 32, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 28px 72px -12px rgba(0, 0, 0, 0.55), 0 8px 24px -4px rgba(0, 0, 0, 0.35) !important;
}

[data-bg-theme="dark"] .model-engine-popover .popover-row-label {
  color: #f1f5f9 !important;
}

.model-engine-popover.hidden {
  display: none !important;
}

.popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

.popover-option-row {
  cursor: pointer;
  padding: 3px 0;
  border-radius: 6px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.popover-option-row:hover {
  opacity: 0.8;
  transform: translateX(2px);
}

.popover-row-label {
  font-family: var(--font-serif);
  font-size: 19px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.25;
}

/* Blue checkmark matching screenshot */
.popover-check-icon {
  color: #2563eb;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.popover-check-icon.hidden {
  display: none !important;
}

/* Gold PREMIUM badge matching screenshot */
.popover-gold-badge {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  color: #c98a2c;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1;
}

/* Divider line between models and modes */
.popover-divider {
  border: none;
  height: 1px;
  background: rgba(60, 80, 110, 0.18);
  margin: 4px 0;
  width: 100%;
}

/* iOS Toggle Switch matching screenshot */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.ios-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #94a3b8;
  transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked + .ios-slider {
  background-color: #22c55e;
}

.ios-switch input:checked + .ios-slider:before {
  transform: translateX(20px);
}

/* Temporary / Incognito Mode: Dashed User Bubble — light background */
body.temporary-chat-mode .user-bubble,
.temporary-chat-mode .user-bubble,
.message-card.user.temporary-bubble .user-bubble {
  background: rgba(170, 155, 220, 0.65) !important;
  border: 1.5px dashed rgba(60, 50, 80, 0.50) !important;
  box-shadow: 0 4px 14px rgba(120, 110, 180, 0.12) !important;
  color: #1a1033 !important;
}

/* Also ensure temporary-chat-mode works with body.incognito-mode */
body.incognito-mode .user-bubble {
  background: rgba(170, 155, 220, 0.65) !important;
  border: 1.5px dashed rgba(60, 50, 80, 0.50) !important;
  box-shadow: 0 4px 14px rgba(120, 110, 180, 0.12) !important;
  color: #1a1033 !important;
}

/* Dark background variant: lighter tonal bubble + bright text */
[data-bg-theme="dark"] body.temporary-chat-mode .user-bubble,
[data-bg-theme="dark"] .temporary-chat-mode .user-bubble,
[data-bg-theme="dark"] .message-card.user.temporary-bubble .user-bubble,
[data-bg-theme="dark"] body.incognito-mode .user-bubble {
  background: rgba(200, 185, 255, 0.18) !important;
  border: 1.5px dashed rgba(200, 185, 255, 0.45) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
  color: #ede8ff !important;
}

/* ── Temporary Chat Banner (#tempChatBanner) ────────────────────────────────
   The banner is injected by JS inside #centerStage with position:absolute.
   Base styles are set via JS inline-style for initial layout.
   These rules override colour for each theme without touching position/size. */
#tempChatBanner {
  /* Light background default: dark translucent pill */
  background: rgba(50, 40, 80, 0.72) !important;
  backdrop-filter: blur(8px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f0ecff !important;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark background: flip to a light frosted pill with dark text */
[data-bg-theme="dark"] #tempChatBanner {
  background: rgba(240, 235, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  color: #ede8ff !important;
}

/* ==========================================================================
   HOMESCREEN TEXTBOX DITTO MATCHING REFERENCE IMAGE media_1789042221283.png
   - Only affects homescreen (.welcome-mode)
   - Chat screen (.chat-active) keeps its existing single-pill layout untouched
   ========================================================================== */

/* Outer frosted glass card container on homescreen */
.astra-center-stage.welcome-mode .composer-floating-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.10) 45%, rgba(255, 255, 255, 0.04) 75%, rgba(255, 255, 255, 0.16) 100%),
    radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(104%);
  border: none;
  border-radius: 32px;
  padding: 12px 14px 12px 14px;
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.14), 0 8px 20px -6px rgba(0, 0, 0, 0.06), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.65);
  gap: 12px;
  box-sizing: border-box;
}

.astra-center-stage.welcome-mode .composer-floating-card:focus-within {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.14) 45%, rgba(255, 255, 255, 0.06) 75%, rgba(255, 255, 255, 0.20) 100%),
    radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.30) 0%, transparent 60%);
  border: none;
  box-shadow: 0 28px 64px -12px rgba(0, 0, 0, 0.18), 0 10px 24px -6px rgba(0, 0, 0, 0.08), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.75);
}

/* Recessed top capsule input pill holding textarea on homescreen */
.astra-center-stage.welcome-mode .composer-recessed-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.10) 100%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(102%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(102%);
  border: none;
  border-radius: 26px;
  min-height: 56px;
  padding: 8px 18px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05), inset 0 1.5px 1px rgba(255, 255, 255, 0.60), 0 4px 14px -3px rgba(0, 0, 0, 0.04);
}

.astra-center-stage.welcome-mode .composer-recessed-pill:focus-within {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.16) 100%);
  border: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.07), inset 0 1.5px 1px rgba(255, 255, 255, 0.75), 0 8px 20px -3px rgba(0, 0, 0, 0.06);
}

/* Hide controls from the top recessed pill on homescreen so it is pure input */
.astra-center-stage.welcome-mode .composer-recessed-pill .composer-attach-wrapper,
.astra-center-stage.welcome-mode .composer-recessed-pill .voice-search-pill,
.astra-center-stage.welcome-mode .composer-recessed-pill #sendButton {
  display: none !important;
}

/* Homescreen input text styling */
.astra-center-stage.welcome-mode #message {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
  padding: 0;
  color: #1e293b;
}

.astra-center-stage.welcome-mode #message::placeholder {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: rgba(62, 80, 98, 0.65);
}

/* Bottom row inside the homescreen frosted card */
.astra-center-stage.welcome-mode .composer-sub-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  width: 100%;
  box-sizing: border-box;
}

/* Left controls container on homescreen (Paperclip squircle) */
.astra-center-stage.welcome-mode .composer-home-left-controls {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

/* Paperclip squircle button */
.astra-center-stage.welcome-mode .composer-home-left-controls .capsule-squircle-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%);
  border: none;
  box-shadow: inset 0 1.5px 1.5px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.06);
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.astra-center-stage.welcome-mode .composer-home-left-controls .capsule-squircle-btn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.20) 100%);
  transform: translateY(-1px);
}

/* Right controls container on homescreen (Astracore 3.1 + Microphone + Upward Arrow Squircle) */
.astra-center-stage.welcome-mode .composer-home-right-controls {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

/* Astracore 3.1 button in bottom row */
.astra-center-stage.welcome-mode .model-spec-toggle-btn {
  padding: 4px 6px;
  cursor: pointer;
}

.astra-center-stage.welcome-mode .model-spec-label {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #334155;
  letter-spacing: 0.3px;
}

/* Standalone microphone button beside send button on homescreen */
.composer-home-mic-btn,
.astra-center-stage.welcome-mode .composer-home-right-controls .composer-home-mic-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%);
  border: none;
  color: #1e293b;
  box-shadow: inset 0 1.5px 1.5px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-home-mic-btn:hover,
.astra-center-stage.welcome-mode .composer-home-right-controls .composer-home-mic-btn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.22) 100%);
  color: #0f172a;
  transform: translateY(-1px);
}

/* Upward send button squircle on homescreen */
.astra-center-stage.welcome-mode .composer-home-right-controls .capsule-squircle-btn.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.14) 100%);
  border: none;
  color: #1e293b;
  box-shadow: inset 0 1.5px 1.5px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.astra-center-stage.welcome-mode .composer-home-right-controls .capsule-squircle-btn.send-btn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.22) 100%);
  color: #0f172a;
  transform: translateY(-1px);
}

/* Hide duplicate homescreen-only controls when in chat-active mode */
.astra-center-stage.chat-active .composer-home-left-controls {
  display: none !important;
}

/* Hide homescreen-only mic + send from sub-row in chat-active mode */
.astra-center-stage.chat-active .composer-home-mic-btn,
.astra-center-stage.chat-active .composer-home-send-btn {
  display: none !important;
}

/* Hide disclaimer text in welcome mode */
.astra-center-stage.welcome-mode .composer-sub-disclaimer {
  display: none !important;
}

/* ==========================================================================
   IN-CONVERSATION CHAT CONTROLS: SYMMETRICAL CIRCULAR BUTTONS + ROUNDED INPUT
   Applies ONLY to current ongoing conversation screen (never touches homescreen)
   ========================================================================== */

/* Keep the rounded/pill-shaped text input container with perfectly balanced layout */
.astra-center-stage.chat-active .composer-recessed-pill {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 10px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.10) 100%) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(102%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) brightness(102%) !important;
  border: none !important;
  border-radius: 30px !important;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.05),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.60),
    0 6px 20px -4px rgba(0, 0, 0, 0.05) !important;
}

.astra-center-stage.chat-active .composer-recessed-pill:focus-within {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
  border: none !important;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.07),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.75),
    0 10px 28px -4px rgba(0, 0, 0, 0.08) !important;
}

/* Display voice mic beside send button in active chat */
.astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* Left attachment wrapper aligned and centered */
.astra-center-stage.chat-active .composer-attach-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Left Attachment Button: Optical glass circular lens */
.astra-center-stage.chat-active #composerAttachBtn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  box-shadow:
    0 4px 12px -2px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  align-self: center !important;
  color: #1e293b !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.astra-center-stage.chat-active #composerAttachBtn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.20) 100%) !important;
  transform: scale(1.05) !important;
  box-shadow:
    0 6px 16px -2px rgba(0, 0, 0, 0.12),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.85) !important;
}

/* Camera Button in Active Chat: Optical glass circular lens */
.astra-center-stage.chat-active #composerCameraBtn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  box-shadow:
    0 4px 12px -2px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  align-self: center !important;
  color: #1e293b !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.astra-center-stage.chat-active #composerCameraBtn:hover {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.12) 100%) !important;
  color: #10b981 !important;
  transform: scale(1.05) !important;
  box-shadow:
    0 6px 16px -2px rgba(16, 185, 129, 0.25),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.85) !important;
}

/* Camera button in top input pill on homescreen */
.astra-center-stage.welcome-mode .composer-recessed-pill #composerCameraBtn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.32) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #1e293b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  margin-right: 8px !important;
  transition: all 0.2s ease !important;
}

.astra-center-stage.welcome-mode .composer-recessed-pill #composerCameraBtn:hover {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.18) !important;
  transform: scale(1.05) !important;
}

/* Homescreen Camera Buttons in sub-row */
.astra-center-stage.welcome-mode .composer-home-left-controls .camera-btn,
.astra-center-stage.welcome-mode .composer-home-right-controls .camera-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
  border: none !important;
  box-shadow: inset 0 1.5px 1.5px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  color: #1e293b !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.astra-center-stage.welcome-mode .composer-home-left-controls .camera-btn:hover,
.astra-center-stage.welcome-mode .composer-home-right-controls .camera-btn:hover {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.12) 100%) !important;
  color: #10b981 !important;
  transform: translateY(-1px) !important;
}

/* Microphone Button beside Send in Active Chat: Optical glass circular lens */
.astra-center-stage.chat-active #composerMicBtn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  box-shadow:
    0 4px 12px -2px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  align-self: center !important;
  color: #1e293b !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.astra-center-stage.chat-active #composerMicBtn:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.20) 100%) !important;
  transform: scale(1.05) !important;
  box-shadow:
    0 6px 16px -2px rgba(0, 0, 0, 0.12),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.85) !important;
}

/* Right Send Button: Optical glass circular lens */
.astra-center-stage.chat-active #sendButton {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%) !important;
  box-shadow:
    0 4px 14px -2px rgba(0, 0, 0, 0.12),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  align-self: center !important;
  color: #1e293b !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.astra-center-stage.chat-active #sendButton:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.54) 0%, rgba(255, 255, 255, 0.24) 100%) !important;
  transform: scale(1.05) !important;
  box-shadow:
    0 6px 18px -2px rgba(0, 0, 0, 0.18),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.90) !important;
}

/* Precise icon centering inside circular buttons */
.astra-center-stage.chat-active #composerAttachBtn svg,
.astra-center-stage.chat-active #composerMicBtn svg,
.astra-center-stage.chat-active #sendButton svg {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  margin: auto !important;
  flex-shrink: 0 !important;
}

/* Center textarea between the buttons with equal visual spacing */
.astra-center-stage.chat-active #message {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 0 4px !important;
  margin: 0 !important;
  align-self: center !important;
}

/* ==========================================================================
   TIGHT, CLEAN EMOJI OPTICAL GLASS LENS
   Follows natural emoji shape with clean, consistent padding and soft refraction
   ========================================================================== */

.chat-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  font-style: normal;
  font-weight: normal;
  font-size: 0.88em;
  line-height: 1;
  vertical-align: 0.05em;
  padding: 3px 6px;
  margin: 0 2px;
  border-radius: 9999px;
  border: none !important;
  background: rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
  box-shadow:
    0 2px 6px rgba(10, 25, 50, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.50) !important;
  box-sizing: border-box;
  text-decoration: none;
  user-select: text;
}

body.incognito-mode .chat-emoji,
.incognito-mode .chat-emoji,
body.temporary-chat-mode .chat-emoji,
.temporary-chat-mode .chat-emoji {
  border: none !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}


/* ==========================================================================
   MOBILE BACKDROP & RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 18, 30, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 990;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  visibility: visible;
  pointer-events: auto;
}

.sidebar-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 1. Large Tablets & Small Laptops (<= 1024px) */
@media screen and (max-width: 1024px) {
  .astra-shell {
    padding: 12px;
    gap: 12px;
  }

  .astra-center-stage {
    padding: 18px 16px;
  }

  .composer-outer-form {
    max-width: 100%;
    width: 100%;
  }

  .welcome-prompts-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
  }
}

/* 2. Tablets & Mobile Devices (<= 768px) */
@media screen and (max-width: 768px) {
  html, body {
    overflow: hidden;
    height: 100dvh;
    width: 100vw;
  }

  .astra-shell {
    padding: 0 0 env(safe-area-inset-bottom, 0px) 0 !important;
    gap: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Floating drawer sidebar */
  .sidebar-card {
    position: fixed !important;
    top: 8px !important;
    left: 8px !important;
    bottom: 8px !important;
    width: min(320px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    z-index: 1000 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.38), 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .sidebar-card.closed {
    transform: translateX(calc(-100% - 30px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Sidebar bottom actions: login button always visible & scrollable */
  .sidebar-bottom-actions {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding-top: 10px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .recents-card-box,
  .docs-card-box {
    max-height: 84px !important;
    flex-shrink: 1 !important;
  }

  /* Rail is replaced by top mobile-nav-bar on mobile */
  .sidebar-rail {
    display: none !important;
  }

  /* Main container fits inside available viewport without overflowing */
  .astra-main {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - 52px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Full-width center stage */
  .astra-center-stage {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    border-radius: 0 !important;
    padding: 8px 10px !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .welcome-center-stage,
  .welcome-greeting-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 0 !important;
    gap: 8px !important;
  }

  .welcome-brand-title {
    font-size: clamp(34px, 8.5vw, 48px) !important;
    letter-spacing: 0.1em !important;
    line-height: 1.1 !important;
  }

  .welcome-hero-tagline {
    font-size: clamp(12px, 2.8vw, 15px) !important;
    letter-spacing: 2px !important;
  }

  .composer-outer-form {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2px 0 max(8px, env(safe-area-inset-bottom, 8px)) 0 !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  .composer-floating-card {
    padding: 8px 10px !important;
    border-radius: 24px !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .composer-recessed-pill {
    min-height: 48px !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
  }

  #message {
    font-size: 17px !important;
    line-height: 24px !important;
    height: 24px !important;
  }

  #message::placeholder {
    font-size: 17px !important;
    line-height: 24px !important;
  }

  .capsule-squircle-btn,
  .composer-home-mic-btn,
  .composer-home-send-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 13px !important;
    flex-shrink: 0 !important;
  }

  /* Mobile voice search pill */
  .voice-search-pill.active {
    padding: 2px 8px 2px 10px !important;
    gap: 4px !important;
    border-radius: 20px !important;
  }

  .voice-search-pill.active .capsule-mic-btn,
  .voice-search-pill.active .composer-home-mic-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .voice-wave-container {
    height: 18px !important;
    gap: 2px !important;
  }

  .wave-bar {
    width: 2px !important;
  }

  .welcome-prompts-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .messages-stream {
    padding: 6px 2px 14px !important;
    gap: 12px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .user-bubble {
    max-width: 88% !important;
    font-size: 16.5px !important;
    padding: 10px 14px !important;
  }

  .assistant-content {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }

  /* Responsive code blocks & editor cards */
  .code-editor-card,
  .code-block-card {
    border-radius: 10px !important;
    margin: 10px 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .code-editor-header,
  .code-block-header {
    padding: 8px 12px !important;
  }

  .code-editor-pre,
  .code-block-pre {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  /* Modal responsiveness on mobile */
  .modal {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .glass-modal-card {
    width: 100% !important;
    max-width: min(420px, calc(100vw - 20px)) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px 16px !important;
    border-radius: 22px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    box-sizing: border-box !important;
  }
}

/* 3. Small Mobile Phones (<= 480px) */
@media screen and (max-width: 480px) {
  .astra-shell {
    padding: 0 0 env(safe-area-inset-bottom, 0px) 0 !important;
  }

  .astra-center-stage {
    padding: 6px 8px 8px !important;
  }

  .sidebar-card {
    top: 6px !important;
    left: 6px !important;
    bottom: 6px !important;
    width: calc(100vw - 16px) !important;
    max-width: 310px !important;
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    border-radius: 22px !important;
  }

  .welcome-brand-title {
    font-size: 34px !important;
    letter-spacing: 2px !important;
  }

  .welcome-hero-tagline {
    font-size: 11.5px !important;
    letter-spacing: 1.5px !important;
  }

  .composer-floating-card {
    padding: 6px 8px !important;
    border-radius: 20px !important;
  }

  .composer-sub-row {
    padding: 2px 2px 0 2px !important;
    gap: 6px !important;
  }

  .composer-sub-disclaimer {
    display: none !important;
  }

  .model-spec-label {
    font-size: 13px !important;
  }

  .engine-mode-tag {
    display: none !important;
  }

  .capsule-squircle-btn,
  .composer-home-mic-btn,
  .composer-home-send-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px !important;
  }

  .user-bubble {
    max-width: 94% !important;
    font-size: 15.5px !important;
    padding: 9px 13px !important;
  }

  .assistant-content {
    font-size: 17px !important;
  }

  .astra-center-stage.has-code-view .assistant-content {
    font-size: 14.5px !important;
  }

  .code-editor-header,
  .code-block-header {
    padding: 6px 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .code-editor-actions {
    gap: 4px !important;
  }

  .copy-btn-label,
  .download-btn-label {
    display: none !important;
  }

  .copy-code-btn,
  .download-code-btn {
    font-size: 11px !important;
    padding: 3px 6px !important;
  }

  .model-engine-popover,
  .attach-dropdown {
    max-width: min(280px, calc(100vw - 20px)) !important;
  }

  /* Small Mobile voice search pill */
  .voice-search-pill.active {
    padding: 2px 6px 2px 8px !important;
    gap: 3px !important;
    border-radius: 18px !important;
  }

  .voice-search-pill.active .capsule-mic-btn,
  .voice-search-pill.active .composer-home-mic-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .voice-wave-container {
    height: 16px !important;
    gap: 1.5px !important;
  }

  .wave-bar {
    width: 1.8px !important;
  }
}

/* ==========================================================================
   RECORDING INDICATOR ANIMATION & ACTIVE MICROPHONE STYLES
   ========================================================================== */

.recording-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(255, 255, 255, 0.16) 100%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(115%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 20px;
  box-shadow: 0 8px 24px -4px rgba(239, 68, 68, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  animation: recBannerSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.recording-indicator.hidden {
  display: none !important;
}

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

.rec-pulse-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: recPulseRing 1.3s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes recPulseRing {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 9px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.rec-text {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: #991b1b;
  letter-spacing: 0.3px;
}

.rec-eq-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.rec-bar {
  width: 3.5px;
  height: 6px;
  background: #ef4444;
  border-radius: 2px;
  animation: recEqAnim 1s ease-in-out infinite;
}

.rec-bar:nth-child(1) { animation-delay: 0.1s; }
.rec-bar:nth-child(2) { animation-delay: 0.3s; }
.rec-bar:nth-child(3) { animation-delay: 0.2s; }
.rec-bar:nth-child(4) { animation-delay: 0.4s; }
.rec-bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes recEqAnim {
  0%, 100% { height: 5px; opacity: 0.5; }
  50% { height: 18px; opacity: 1; }
}

.rec-cancel-btn {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f1d1d;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rec-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #450a0a;
}

/* Smooth Active Voice State for Microphone Buttons - Elegant, No Selected Box */
.capsule-mic-btn,
#composerMicBtn,
#composerHomeMicBtn {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

.capsule-mic-btn:focus,
.capsule-mic-btn:focus-visible,
.capsule-mic-btn:active,
#composerMicBtn:focus,
#composerMicBtn:focus-visible,
#composerMicBtn:active,
#composerHomeMicBtn:focus,
#composerHomeMicBtn:focus-visible,
#composerHomeMicBtn:active {
  outline: none !important;
}

.capsule-mic-btn.recording,
#composerMicBtn.recording,
#composerHomeMicBtn.recording {
  color: #3b1d22 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
}

.capsule-mic-btn.recording svg,
#composerMicBtn.recording svg,
#composerHomeMicBtn.recording svg {
  stroke: #3b1d22 !important;
  animation: micGentleBreathe 1.6s ease-in-out infinite alternate !important;
}

[data-bg-theme="dark"] .capsule-mic-btn.recording svg,
[data-bg-theme="dark"] #composerMicBtn.recording svg,
[data-bg-theme="dark"] #composerHomeMicBtn.recording svg {
  stroke: #ffffff !important;
}

@keyframes micGentleBreathe {
  0% {
    opacity: 0.75;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* ==========================================================================
   SETTINGS & APPEARANCE MODAL (WCAG AA High Contrast Light & Dark Themes)
   ========================================================================== */

#settingsModal {
  background: rgba(15, 23, 42, 0.55);
}

.settings-modal-card {
  max-width: 480px;
  width: 90vw;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(120%) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(120%) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.16) !important;
  border-radius: 32px !important;
  box-shadow:
    0 32px 64px -12px rgba(15, 23, 42, 0.28),
    0 16px 32px -8px rgba(15, 23, 42, 0.14) !important;
  padding: 26px 28px !important;
  color: #0f172a !important;
  box-sizing: border-box;
}

#settingsModal .modal-brand-title {
  color: #0f172a !important;
  font-weight: 700;
}

#settingsModal .modal-eyebrow {
  color: #334155 !important;
  font-weight: 600;
}

#settingsModal .modal-h2 {
  color: #0f172a !important;
  font-weight: 700;
}

#settingsModal .modal-subtitle {
  color: #334155 !important;
  font-size: 15px;
  line-height: 1.45;
}

#settingsModal .close-icon-btn {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}

#settingsModal .close-icon-btn:hover {
  background: #e2e8f0 !important;
  color: #000000 !important;
  border-color: #475569 !important;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.settings-group-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-group-icon {
  font-size: 22px;
  line-height: 1;
  padding: 7px;
  border-radius: 12px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.settings-group-text {
  flex: 1;
}

.settings-group-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.settings-group-desc {
  font-size: 14.5px;
  color: #334155;
  margin-top: 3px;
  line-height: 1.42;
}

/* Glass Frost Slider (WCAG AA 3:1+ Control Contrast) */
.frost-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
}

.glass-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: #cbd5e1;
  border: 1px solid #64748b;
  outline: none;
  cursor: pointer;
}

.glass-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.glass-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  background: #1e293b;
}

.glass-range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.glass-range-slider::-moz-range-thumb:hover {
  transform: scale(1.12);
  background: #1e293b;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
}

.slider-val-badge {
  font-weight: 700;
  color: #ffffff;
  background: #0f172a;
  border: 1px solid #0f172a;
  padding: 2px 10px;
  border-radius: 10px;
}

/* Custom Background Upload Buttons */
.custom-bg-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-glass-btn {
  background: #0f172a;
  color: #ffffff;
  border: 1.5px solid #0f172a;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

.primary-glass-btn:hover {
  background: #1e293b;
  border-color: #1e293b;
  transform: translateY(-1px);
}

.secondary-glass-btn {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #475569;
}

.secondary-glass-btn:hover {
  background: #f1f5f9;
  color: #000000;
  border-color: #0f172a;
}

.settings-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.settings-btn:focus-visible,
.glass-range-slider:focus-visible,
#settingsModal .close-icon-btn:focus-visible {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
}

.custom-bg-status-msg {
  font-size: 13.5px;
  color: #334155;
  font-weight: 500;
  font-style: italic;
  margin-top: 4px;
}

/* Dark Theme Settings Contrast Overrides (WCAG AA >= 4.5:1 text, >= 3:1 controls) */
[data-bg-theme="dark"] .settings-modal-card {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1.5px solid rgba(148, 163, 184, 0.38) !important;
  color: #f8fafc !important;
}

[data-bg-theme="dark"] #settingsModal .modal-brand-title,
[data-bg-theme="dark"] #settingsModal .modal-h2,
[data-bg-theme="dark"] .settings-group-title {
  color: #f8fafc !important;
}

[data-bg-theme="dark"] #settingsModal .modal-eyebrow,
[data-bg-theme="dark"] #settingsModal .modal-subtitle,
[data-bg-theme="dark"] .settings-group-desc,
[data-bg-theme="dark"] .slider-labels,
[data-bg-theme="dark"] .custom-bg-status-msg {
  color: #cbd5e1 !important;
}

[data-bg-theme="dark"] #settingsModal .close-icon-btn {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #64748b !important;
}

[data-bg-theme="dark"] #settingsModal .close-icon-btn:hover {
  background: #334155 !important;
  color: #ffffff !important;
  border-color: #94a3b8 !important;
}

[data-bg-theme="dark"] .settings-group {
  background: #1e293b;
  border: 1px solid #475569;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-bg-theme="dark"] .settings-group-icon {
  background: #334155;
  border-color: #64748b;
  color: #f8fafc;
}

[data-bg-theme="dark"] .glass-range-slider {
  background: #334155;
  border-color: #94a3b8;
}

[data-bg-theme="dark"] .glass-range-slider::-webkit-slider-thumb {
  background: #f8fafc;
  border-color: #0f172a;
}

[data-bg-theme="dark"] .glass-range-slider::-moz-range-thumb {
  background: #f8fafc;
  border-color: #0f172a;
}

[data-bg-theme="dark"] .slider-val-badge {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}

[data-bg-theme="dark"] .primary-glass-btn {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}

[data-bg-theme="dark"] .primary-glass-btn:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
}

[data-bg-theme="dark"] .secondary-glass-btn {
  background: #0f172a;
  color: #f8fafc;
  border-color: #94a3b8;
}

[data-bg-theme="dark"] .secondary-glass-btn:hover {
  background: #334155;
  color: #ffffff;
  border-color: #f8fafc;
}

/* ==========================================================================
   VOICE RECORDING PILL ANIMATION (MATCHES IMAGE 2 REFERENCE)
   Guaranteed highest priority display in all stage modes (chat & homescreen)
   ========================================================================== */

.astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active,
.astra-center-stage.chat-active #voiceSearchPill.active,
.astra-center-stage #voiceSearchPill.active,
.astra-center-stage #composerHomeMicPill.active,
#voiceSearchPill.active,
#composerHomeMicPill.active,
.voice-search-pill.active {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(215, 125, 125, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(14px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(125%) !important;
  padding: 4px 10px 4px 12px !important;
  box-shadow: 0 3px 12px rgba(220, 38, 38, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
  border-radius: 22px !important;
  height: 38px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  animation: voicePillPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes voicePillPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active #composerMicBtn,
.astra-center-stage.chat-active #voiceSearchPill.active #composerMicBtn,
.astra-center-stage #voiceSearchPill.active #composerMicBtn,
.astra-center-stage #composerHomeMicPill.active #composerHomeMicBtn,
#voiceSearchPill.active #composerMicBtn,
#composerHomeMicPill.active #composerHomeMicBtn,
.voice-search-pill.active #composerMicBtn,
.voice-search-pill.active #composerHomeMicBtn,
.voice-search-pill.active .capsule-mic-btn,
.voice-search-pill.active .composer-home-mic-btn {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  border-radius: 0 !important;
  border: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #3b1d22 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
}

.astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active #composerMicBtn svg,
.astra-center-stage.chat-active #voiceSearchPill.active #composerMicBtn svg,
.astra-center-stage #voiceSearchPill.active #composerMicBtn svg,
.astra-center-stage #composerHomeMicPill.active #composerHomeMicBtn svg,
#voiceSearchPill.active #composerMicBtn svg,
#composerHomeMicPill.active #composerHomeMicBtn svg,
.voice-search-pill.active #composerMicBtn svg,
.voice-search-pill.active #composerHomeMicBtn svg,
.voice-search-pill.active .capsule-mic-btn svg,
.voice-search-pill.active .composer-home-mic-btn svg {
  stroke: #3b1d22 !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  animation: micGentleBreathe 1.5s ease-in-out infinite alternate !important;
}

.astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active .voice-wave-container,
.voice-search-pill.active .voice-wave-container {
  display: flex !important;
  align-items: center !important;
  gap: 2.5px !important;
  height: 20px !important;
  padding: 0 2px !important;
  pointer-events: none !important;
}

.voice-wave-container.hidden {
  display: none !important;
}

.voice-search-pill.active .wave-bar {
  width: 2.2px !important;
  border-radius: 2px !important;
  background: #3b1d22 !important;
  animation: wavePulse 0.8s ease-in-out infinite alternate !important;
}

@keyframes wavePulse {
  0% {
    height: 4px;
    opacity: 0.45;
  }
  50% {
    height: 18px;
    opacity: 1;
  }
  100% {
    height: 7px;
    opacity: 0.65;
  }
}

@keyframes micGentleBreathe {
  0% {
    transform: scale(0.92);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.voice-search-pill.active .wave-bar:nth-child(1) { animation-delay: 0.00s !important; height: 6px !important; }
.voice-search-pill.active .wave-bar:nth-child(2) { animation-delay: 0.15s !important; height: 12px !important; }
.voice-search-pill.active .wave-bar:nth-child(3) { animation-delay: 0.05s !important; height: 16px !important; }
.voice-search-pill.active .wave-bar:nth-child(4) { animation-delay: 0.25s !important; height: 10px !important; }
.voice-search-pill.active .wave-bar:nth-child(5) { animation-delay: 0.10s !important; height: 18px !important; }
.voice-search-pill.active .wave-bar:nth-child(6) { animation-delay: 0.30s !important; height: 14px !important; }
.voice-search-pill.active .wave-bar:nth-child(7) { animation-delay: 0.18s !important; height: 8px !important; }
.voice-search-pill.active .wave-bar:nth-child(8) { animation-delay: 0.22s !important; height: 15px !important; }
.voice-search-pill.active .wave-bar:nth-child(9) { animation-delay: 0.08s !important; height: 11px !important; }
.voice-search-pill.active .wave-bar:nth-child(10) { animation-delay: 0.28s !important; height: 17px !important; }
.voice-search-pill.active .wave-bar:nth-child(11) { animation-delay: 0.12s !important; height: 9px !important; }
.voice-search-pill.active .wave-bar:nth-child(12) { animation-delay: 0.20s !important; height: 13px !important; }

[data-bg-theme="dark"] .astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active,
[data-bg-theme="dark"] .voice-search-pill.active {
  background: linear-gradient(135deg, rgba(235, 95, 95, 0.45) 0%, rgba(200, 70, 70, 0.35) 100%) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

[data-bg-theme="dark"] .voice-search-pill.active #composerMicBtn,
[data-bg-theme="dark"] .voice-search-pill.active #composerHomeMicBtn,
[data-bg-theme="dark"] .voice-search-pill.active .capsule-mic-btn,
[data-bg-theme="dark"] .voice-search-pill.active .composer-home-mic-btn {
  color: #ffffff !important;
}

[data-bg-theme="dark"] .voice-search-pill.active #composerMicBtn svg,
[data-bg-theme="dark"] .voice-search-pill.active #composerHomeMicBtn svg,
[data-bg-theme="dark"] .voice-search-pill.active .capsule-mic-btn svg,
[data-bg-theme="dark"] .voice-search-pill.active .composer-home-mic-btn svg {
  stroke: #ffffff !important;
}

[data-bg-theme="dark"] .voice-search-pill.active .wave-bar {
  background: #ffffff !important;
}

@media screen and (max-width: 768px) {
  .astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active,
  .voice-search-pill.active {
    height: 34px !important;
    padding: 2px 8px 2px 10px !important;
    gap: 4px !important;
    border-radius: 18px !important;
  }

  .voice-wave-container {
    height: 18px !important;
    gap: 2px !important;
  }

  .voice-search-pill.active .wave-bar {
    width: 2px !important;
  }
}

@media screen and (max-width: 480px) {
  .astra-center-stage.chat-active .composer-recessed-pill .voice-search-pill.active,
  .voice-search-pill.active {
    height: 32px !important;
    padding: 2px 6px 2px 8px !important;
    gap: 3px !important;
    border-radius: 16px !important;
  }

  .voice-wave-container {
    height: 16px !important;
    gap: 1.5px !important;
  }

  .voice-search-pill.active .wave-bar {
    width: 1.8px !important;
  }
}

/* ==========================================================================
   CAMERA & MULTIMODAL IMAGE ATTACHMENT STYLES
   ========================================================================== */

/* Attached Image Preview Chip in Composer */
.composer-img-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 4px 10px 4px 4px;
  margin-bottom: 8px;
  max-width: 280px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  animation: chipFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-bg-theme="dark"] .composer-img-chip {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

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

.composer-img-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.composer-img-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--theme-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.remove-img-chip-btn {
  background: none;
  border: none;
  color: var(--theme-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-img-chip-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Camera Squircle Buttons */
.camera-btn {
  color: var(--theme-text-muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.camera-btn:hover {
  color: #10b981 !important;
  transform: translateY(-1px);
}

[data-bg-theme="dark"] .camera-btn:hover {
  color: #34d399 !important;
}

/* Camera Modal Card */
.camera-modal-card {
  max-width: 560px;
  width: 92%;
  border-radius: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

[data-bg-theme="dark"] .camera-modal-card {
  background: rgba(18, 24, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

.camera-viewfinder-wrapper {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.camera-stream-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-video,
.camera-captured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-overlay-scan {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.15);
}

.camera-overlay-scan::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  box-shadow: 0 0 12px #10b981;
  animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
  0% { top: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.camera-error-banner {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #f8fafc;
  z-index: 10;
}

.camera-error-banner p {
  font-size: 0.92rem;
  color: #cbd5e1;
  max-width: 320px;
  line-height: 1.4;
}

.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
}

.camera-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
  color: var(--theme-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-bg-theme="dark"] .camera-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.camera-icon-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.9);
}

[data-bg-theme="dark"] .camera-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.camera-shutter-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid #10b981;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

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

.shutter-inner-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #10b981;
  transition: all 0.15s ease;
}

.camera-shutter-btn:hover .shutter-inner-ring {
  background: #059669;
}

.camera-review-actions {
  display: flex;
  gap: 12px;
}

.camera-action-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.camera-action-btn.secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--theme-text-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bg-theme="dark"] .camera-action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}

.camera-action-btn.primary {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.camera-action-btn.primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* User Message Attached Image */
.user-msg-image-wrapper {
  margin-bottom: 10px;
  border-radius: 14px;
  overflow: hidden;
  max-width: 320px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-msg-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.user-msg-image:hover {
  transform: scale(1.02);
}

/* ==========================================================================
   INTERACTIVE SOLAR SYSTEM HUD & 3D CONTROLS
   ========================================================================== */

.solar-viewport-container {
  position: relative;
  width: 100%;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a1128 0%, #030712 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.solar-canvas-target {
  width: 100% !important;
  height: 100% !important;
  outline: none;
  cursor: grab;
}

.solar-canvas-target:active {
  cursor: grabbing;
}

/* Top Planet Selection Bar */
.solar-planets-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  z-index: 10;
  scrollbar-width: none;
}

.solar-planets-bar::-webkit-scrollbar {
  display: none;
}

.solar-planet-chip {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.solar-planet-chip:hover {
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.solar-planet-chip.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* Floating Scientific Fact HUD */
.solar-hud-card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  max-width: 310px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: #f8fafc;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: hudSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.solar-hud-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.solar-hud-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #94a3b8;
  margin-bottom: 3px;
}

.solar-hud-stat strong {
  color: #e2e8f0;
  font-weight: 500;
}

.solar-hud-desc {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Time / Speed Controls */
.solar-speed-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 4px;
  z-index: 10;
}

.solar-speed-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.solar-speed-btn:hover {
  color: #ffffff;
}

.solar-speed-btn.active {
  background: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* ==========================================================================
   DAILY TOKEN LIMITER & OUT-OF-TOKENS NOTIFICATIONS
   ========================================================================== */
.top-nav-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--theme-text-heading, #111827);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  user-select: none;
}

.token-quota-badge.low {
  border-color: rgba(245, 158, 11, 0.6);
  color: #b45309;
  background: rgba(254, 243, 199, 0.35);
}

.token-quota-badge.empty {
  border-color: rgba(225, 29, 72, 0.7);
  color: #e11d48;
  background: rgba(255, 228, 230, 0.45);
}

.token-badge-icon {
  font-size: 0.85rem;
}

/* Out of Tokens Glassmorphic Alert Card */
.out-of-tokens-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 16px auto;
  background: rgba(255, 241, 242, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(244, 63, 94, 0.5);
  border-radius: 18px;
  padding: 14px 20px;
  box-shadow: 0 10px 30px -5px rgba(225, 29, 72, 0.18);
  animation: slideDownFade 0.3s ease forwards;
  z-index: 10;
}

[data-bg-theme="dark"] .out-of-tokens-card {
  background: rgba(40, 15, 25, 0.82);
  border-color: rgba(244, 63, 94, 0.6);
}

.out-of-tokens-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.out-of-tokens-badge-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(225, 29, 72, 0.16);
  border-radius: 50%;
  color: #e11d48;
}

.out-of-tokens-details {
  flex: 1;
}

.out-of-tokens-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #be123c;
  margin-bottom: 2px;
}

[data-bg-theme="dark"] .out-of-tokens-title {
  color: #fda4af;
}

.out-of-tokens-msg {
  margin: 0;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
}

[data-bg-theme="dark"] .out-of-tokens-msg {
  color: #cbd5e1;
}

.out-of-tokens-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

/* Disabled Composer State when Out of Tokens */
.composer-floating-card.out-of-tokens {
  opacity: 0.72;
}

.composer-floating-card.out-of-tokens #sendButton {
  background: #94a3b8 !important;
  cursor: not-allowed;
  opacity: 0.55;
}

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



