/* ==========================================================================
   AETHER // COMPONENTS
   ========================================================================== */

/* 1. Top Brand Pill (Minimal Ambient Watermark) */
.top-brand-header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 10px;
  z-index: 20;
  pointer-events: none;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 12px;
  background: rgba(18, 18, 30, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* 2. Expansive Chat Stream */
.console-stream {
  width: 100%;
  max-width: 860px;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 140px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0 auto;
  z-index: 10;
}

.chat-row {
  display: flex;
  animation: slideUp 0.4s var(--ease-fluid) forwards;
  opacity: 0;
  transform: translateY(10px);
}

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

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

.chat-bubble {
  max-width: 85%;
  font-size: 1.15rem;
  line-height: 1.85;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.chat-row.agent .chat-bubble {
  color: var(--text-primary);
  background: rgba(22, 23, 38, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 28px;
  border-radius: 26px;
  border-top-right-radius: 8px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chat-row.user .chat-bubble {
  color: var(--text-primary);
  text-align: right;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(14, 165, 233, 0.18));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 18px 26px;
  border-radius: 26px;
  border-top-left-radius: 8px;
  box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.25);
}

/* ==========================================================================
   3. FLOATING DOCK (العريضة العائمة في الطرف السفلي)
   ========================================================================== */
.floating-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1240px;
  min-height: 72px;
  background: rgba(14, 15, 26, 0.76);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: 
    0 24px 60px -10px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  gap: 16px;
  z-index: 100;
  transition: all 0.3s var(--ease-fluid);
}

.dock-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  min-width: 160px;
}

/* Right Side: User Account Icon (الطرف الأيمن من الشريط) */
.dock-slot.dock-right {
  justify-content: flex-start; /* in RTL this is right side */
}

/* Left Side: Agent meta & Audio (الطرف الأيسر من الشريط) */
.dock-slot.dock-left {
  justify-content: flex-end; /* in RTL this is left side */
}

/* User Account Button */
.user-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-fluid);
  font-family: var(--font-sans);
}

.user-account-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.user-account-btn:active {
  transform: translateY(0);
}

.user-avatar-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(14, 165, 233, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.user-avatar-ring.initial {
  background: #ffffff;
  color: #0b0c14;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-avatar-ring .user-icon {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
}

.user-handle {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.user-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  margin-right: 2px;
}

/* Center: Chat Dialog Bar (يتوسطها مربع الحوار بمساحة لا تزيد عن ٥٠٪ من عرض الشريط) */
.dock-center-chat {
  flex: 0 1 50%;
  width: 50%;
  max-width: 50%;
  display: flex;
  justify-content: center;
  position: relative;
}

.chat-input-bezel {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 8px 14px 8px 68px; /* Extra left padding for Sphere character */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.3s var(--ease-fluid);
}

.chat-input-bezel:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 
    0 0 0 1px rgba(139, 92, 246, 0.5),
    0 0 24px rgba(139, 92, 246, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.chat-input-bezel textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  padding: 8px 4px;
  direction: rtl;
}

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

.chat-input-bezel .send-button {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease-fluid), box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.chat-input-bezel .send-button:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.55);
}

.chat-input-bezel .send-button:active {
  transform: scale(0.94);
}

/* Cute 3D Sphere Character sitting on the left side of the chat bar */
.sphere-perch {
  position: absolute;
  left: -10px;
  bottom: -6px;
  width: 74px;
  height: 74px;
  z-index: 15;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sphere-perch:hover {
  transform: scale(1.08) translateY(-4px);
}

.sphere-perch canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Brand Logo on Right Side of Dock (شعار العرّاب على الطرف الأيمن) */
.brand-dock-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  user-select: none;
}

.avatar-ring.brand-emblem-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 
    0 0 16px rgba(255, 215, 0, 0.25),
    0 0 24px rgba(14, 165, 233, 0.2);
  transition: transform 0.25s var(--ease-fluid), box-shadow 0.25s var(--ease-fluid);
  flex-shrink: 0;
}

.brand-dock-profile:hover .avatar-ring.brand-emblem-ring {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 
    0 0 24px rgba(255, 215, 0, 0.45),
    0 0 32px rgba(14, 165, 233, 0.35);
}

.brand-dock-profile .avatar-ring.brand-emblem-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-dock-meta {
  display: flex;
  flex-direction: column;
}

.brand-name-arrab {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #ffd700 85%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.brand-dock-meta .status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: #10b981;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.brand-dock-meta .status-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

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

/* Agent Meta & Audio on Left (Legacy support) */
.agent-dock-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-ring.mini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  filter: grayscale(0.4);
  transition: filter 0.2s;
}

.agent-dock-profile:hover .avatar-ring.mini {
  filter: grayscale(0);
}

.avatar-ring.mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-dock-meta {
  display: flex;
  flex-direction: column;
}

.agent-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

.agent-dock-meta .status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.agent-dock-meta .status-indicator .dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.audio-toggle {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-toggle:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}

.audio-icon {
  width: 20px;
  height: 20px;
}

/* Widgets */
.agent-widget {
  margin-top: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 24px;
}

.widget-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.widget-item {
  margin-bottom: 16px;
}

.widget-item h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.widget-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.widget-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.widget-btn {
  padding: 12px 20px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.widget-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.widget-btn.primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.widget-btn.primary:hover {
  background: #e0e0e0;
}

@media (max-width: 768px) {
  .stage-3d-wrapper { padding: 0; }
  .tactical-console { border-radius: 0; height: 100vh; max-height: 100vh; border: none; transform: none !important; }
  .console-header { padding: 24px; }
  .console-stream { padding: 0 24px; }
  .console-input-area { padding: 24px; }
}

/* 5. Aether Pulse Loader & Markdown formatting */
.aether-pulse-loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.aether-pulse-loader span {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: inline-block;
  animation: aetherPulse 1.4s infinite ease-in-out both;
}

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

@keyframes aetherPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.25; }
  40% { transform: scale(1.0); opacity: 1; background: #ffffff; }
}

.chat-bubble p {
  margin: 0 0 12px 0;
}

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

.chat-bubble pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.9rem;
  margin: 12px 0;
  color: #e2e8f0;
}

.chat-bubble code {
  font-family: var(--font-mono, monospace);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
}

.chat-bubble pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.chat-bubble ul, .chat-bubble ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.chat-bubble li {
  margin-bottom: 6px;
}

/* ==========================================================================
   6. HEADER ACTIONS & AUTH BADGE
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-header-slot {
  display: flex;
  align-items: center;
}

.auth-nav-btn {
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease-fluid);
}

.auth-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.user-profile-badge {
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px 4px 6px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease-fluid);
}

.user-profile-badge:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar-initial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-handle {
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

.user-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Profile Popover (Floats above user account icon on the left) */
.profile-popover {
  position: fixed;
  bottom: 106px;
  left: max(24px, calc((100vw - 1240px) / 2 + 18px));
  right: auto;
  width: 300px;
  background: rgba(18, 19, 32, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 18px;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s var(--ease-fluid);
}

.profile-popover.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.profile-popover-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--accent-border);
  margin-bottom: 14px;
}

.profile-popover-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.profile-popover-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-popover-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.profile-popover-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-popover-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-popover-item .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.profile-popover-item .val {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.profile-popover-item .status-active {
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.profile-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-action-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-monolith);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-action-btn.danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   7. INTERACTIVE ONBOARDING CHIPS & STEPS
   ========================================================================== */
.onboarding-step-wrapper {
  margin-top: 14px;
}

.onboarding-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.onboarding-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease-fluid);
  text-align: left;
}

.onboarding-chip .chip-icon {
  font-size: 0.95rem;
}

.onboarding-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.onboarding-chip:active {
  transform: scale(0.98);
}

/* ==========================================================================
   8. SOVEREIGN DOSSIER CARD
   ========================================================================== */
.sovereign-dossier-card {
  margin-top: 18px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.dossier-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dossier-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

.dossier-card-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dossier-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dossier-status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.dossier-status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d178;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dossier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--surface-monolith);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.dossier-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dossier-cell .cell-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.dossier-cell .cell-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.dossier-cell .cell-value.font-mono {
  font-family: var(--font-mono);
  color: #60a5fa;
  font-size: 0.78rem;
}

.dossier-cta-banner {
  padding-top: 14px;
  border-top: 1px solid var(--accent-border);
}

.dossier-cta-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.dossier-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dossier-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s var(--ease-fluid);
}

.dossier-btn.primary {
  background: #ffffff;
  color: #000000;
  border: none;
}

.dossier-btn.primary:hover {
  background: #eaeaea;
  transform: translateY(-1px);
}

.dossier-btn.secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
}

.dossier-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   9. AUTH MODAL (SIGN IN / SIGN UP) - FIXED OVERLAY & DEFAULT HIDDEN
   ========================================================================== */
.auth-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-fluid), visibility 0.25s;
}

.auth-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.auth-modal,
.auth-modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 440px;
  background: rgba(12, 13, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.95), 0 0 40px rgba(139, 92, 246, 0.2);
  padding: 32px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-fluid), transform 0.25s var(--ease-fluid), visibility 0.25s;
}

.auth-modal.active,
.auth-modal-overlay.active .auth-modal-card {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

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

.auth-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.auth-modal-title-group h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-modal-subtitle,
.auth-modal-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-close-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.15s;
}

.auth-close-btn:hover {
  color: var(--text-primary);
}

/* Tabs */
.auth-tab-bar {
  display: flex;
  background: var(--surface-monolith);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-group input {
  width: 100%;
  background: var(--surface-monolith);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

.auth-feedback {
  font-size: 0.8rem;
  min-height: 18px;
}

.auth-feedback.error {
  color: #f87171;
}

.auth-feedback.success {
  color: #34d178;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s var(--ease-fluid);
  margin-top: 4px;
}

.auth-submit-btn.primary {
  background: #ffffff;
  color: #000000;
  border: none;
}

.auth-submit-btn.primary:hover:not(:disabled) {
  background: #eaeaea;
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success Confirmation Banner */
.auth-success-banner {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 18px 20px;
}

.auth-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: #34d178;
  letter-spacing: 0.05em;
}

.auth-success-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d178;
  box-shadow: 0 0 6px rgba(52, 209, 120, 0.6);
}

@media (max-width: 768px) {
  .floating-dock {
    width: calc(100% - 24px);
    bottom: 14px;
    padding: 6px 12px;
    gap: 8px;
    min-height: 64px;
  }
  
  .dock-slot {
    min-width: auto;
  }

  .dock-center-chat {
    flex: 1 1 auto;
    max-width: 65%;
  }

  .brand-dock-meta,
  .agent-dock-meta {
    display: none;
  }

  .user-handle {
    display: none;
  }

  .sphere-perch {
    width: 58px;
    height: 58px;
    left: -6px;
    bottom: -4px;
  }

  .chat-input-bezel {
    padding-left: 54px;
  }

  .profile-popover {
    left: 12px;
    right: auto;
    bottom: 84px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 600px) {
  .dossier-grid {
    grid-template-columns: 1fr;
  }
  .auth-modal,
  .auth-modal-card {
    padding: 24px;
    width: 94%;
  }
  .profile-popover {
    left: 12px;
    right: auto;
    width: calc(100vw - 24px);
  }
}


