/* ============================================================
   Vetmanager AI — Design System
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --primary-xlight: #f0f0ff;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 320px;
  --chat-max-width: 720px;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.screen.hidden { display: none !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 10px 18px;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }

.btn-lg { font-size: 16px; padding: 13px 28px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}
.btn-link:hover { text-decoration: underline; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }

.btn-back {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  margin-top: 16px;
}
.btn-back:hover { color: var(--gray-700); }

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font);
}
.btn-retry:hover { background: var(--gray-100); }

/* ============================================================
   LANDING
   ============================================================ */
#landing-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0ff 0%, #e8f4ff 50%, #f0fff4 100%);
}

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(79,70,229,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(5,150,105,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.landing-content {
  position: relative;
  text-align: center;
  max-width: 680px;
  padding: 40px 24px;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.landing-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
}

.landing-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--gray-900);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  font-size: 18px;
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

.feature-chip {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  box-shadow: var(--shadow-sm);
}

.landing-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   AUTH
   ============================================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #f0f0ff 0%, #e8f4ff 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-card-wide { max-width: 600px; }

.auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo { margin-bottom: 16px; }
.auth-card-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 6px;
}
.auth-card-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-group input {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-group input::placeholder { color: var(--gray-400); }
.form-hint { font-size: 11px; color: var(--gray-400); }

.form-status {
  min-height: 20px;
  font-size: 13px;
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  padding: 0;
}
.form-status.is-error {
  color: var(--danger);
  background: var(--danger-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.form-status.is-success {
  color: var(--success);
  background: var(--success-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-500);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-screen { height: 100vh; display: flex; flex-direction: column; }

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  padding: 0 16px 8px;
}

.sidebar-heading {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  display: inline;
}

/* Visually hidden role label — present in textContent for e2e tests */
.msg-role-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.event-feed-list { padding: 0 8px; }

.event-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  cursor: default;
  transition: all 0.15s;
}
.event-card:hover { background: var(--primary-xlight); border-color: var(--primary-light); }

.event-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-card-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.event-card-text {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-skeleton {
  height: 72px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  margin: 0 8px 8px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.event-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--gray-400);
  font-size: 13px;
}

/* ============================================================
   MAIN CHAT
   ============================================================ */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--gray-50);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.chat-header-info { display: flex; align-items: center; gap: 12px; }

.chat-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.chat-header-name { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.chat-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-500);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-online { background: var(--success); }
.status-dot-busy { background: var(--warning); animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

.chat-header-actions { display: flex; gap: 4px; }

/* ============================================================
   CHAT WINDOW
   ============================================================ */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  flex: 1;
}
.chat-welcome-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 20px;
}
.chat-welcome h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 8px;
}
.chat-welcome p {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0 0 24px;
  max-width: 380px;
  line-height: 1.6;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 500px;
}
.quick-action-btn {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.quick-action-btn:hover {
  background: var(--primary-xlight);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ============================================================
   CHAT MESSAGES (Bubbles)
   ============================================================ */
.chat-message {
  display: flex;
  gap: 10px;
  max-width: var(--chat-max-width);
  animation: msg-appear 0.2s ease-out;
}
@keyframes msg-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-message.assistant { align-self: flex-start; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-message.user .msg-avatar { background: var(--primary); color: var(--white); }
.chat-message.assistant .msg-avatar { background: var(--gray-200); color: var(--gray-600); }

.msg-content { display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 44px); }
.chat-message.user .msg-content { align-items: flex-end; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-message.user .msg-bubble {
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.chat-message.assistant .msg-bubble {
  background: var(--white);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-bubble p { margin: 0 0 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 4px 0 8px 18px; padding: 0; }
.msg-bubble li { margin-bottom: 2px; }
.msg-bubble strong { font-weight: 600; }
.msg-bubble em { font-style: italic; }
.msg-bubble code {
  background: rgba(0,0,0,0.07);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'Menlo', 'Monaco', monospace;
}
.chat-message.user .msg-bubble code { background: rgba(255,255,255,0.2); }

.msg-time {
  font-size: 11px;
  color: var(--gray-400);
  padding: 0 4px;
}

.msg-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-message:hover .msg-actions { opacity: 1; }

.msg-action-btn {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  color: var(--gray-500);
  cursor: pointer;
  font-family: var(--font);
}
.msg-action-btn:hover { background: var(--gray-100); color: var(--gray-700); }

/* Attachments */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.msg-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--success-light);
  color: var(--success);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(5,150,105,0.2);
  transition: all 0.15s;
}
.msg-attachment-link:hover { background: #a7f3d0; }

/* ============================================================
   AGENT THINKING
   ============================================================ */
.agent-thinking {
  padding: 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.thinking-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: thinking-bounce 1.2s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.thinking-label {
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
}

.agent-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 4px;
}

.agent-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}
.agent-step-running {
  background: var(--primary-light);
  color: var(--primary);
  animation: step-pulse 1.5s infinite;
}
.agent-step-done {
  background: var(--success-light);
  color: var(--success);
}
.agent-step-error {
  background: var(--danger-light);
  color: var(--danger);
}
@keyframes step-pulse { 0%,100%{opacity:0.8} 50%{opacity:1} }

.agent-step::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.agent-step-running::before { animation: step-dot-pulse 1s infinite; }
@keyframes step-dot-pulse { 0%,100%{opacity:0.5} 50%{opacity:1} }

/* ============================================================
   CHAT STATUS BAR
   ============================================================ */
.chat-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 24px;
  min-height: 28px;
  font-size: 12px;
  color: var(--gray-400);
  flex-shrink: 0;
}
.chat-status-bar.is-error { color: var(--danger); }

/* ============================================================
   CHAT SUGGESTIONS
   ============================================================ */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 24px 8px;
  flex-shrink: 0;
}
.chat-suggestion-chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.chat-suggestion-chip:hover {
  background: var(--primary-xlight);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ============================================================
   CHAT INPUT
   ============================================================ */
.chat-input-area {
  padding: 12px 24px 16px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 8px 8px 8px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
  background: var(--white);
}

.chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px 0;
}
.chat-textarea::placeholder { color: var(--gray-400); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-send-btn:hover:not(:disabled) { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; }

.chat-input-hint {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
  padding: 0 4px;
}

/* ============================================================
   SCHEDULED PROMPT FORM
   ============================================================ */
.msg-repeat-form {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}
.msg-repeat-form input[type="number"] {
  width: 56px;
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
}
.msg-repeat-form select {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
}
.msg-repeat-form button {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
}
.msg-repeat-form button:hover { background: var(--gray-100); }

/* ============================================================
   MOBILE FAB & PANEL
   ============================================================ */
.chat-fab { display: none; }
.mobile-chat-panel { display: none; }

@media (max-width: 768px) {
  .app-sidebar { display: none; }

  .chat-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 24px;
    z-index: 1002;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
  }
  .chat-fab:hover { transform: scale(1.08); }

  .mobile-chat-panel {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: var(--white);
    display: none;
    flex-direction: column;
    overflow: hidden;
  }
  .mobile-chat-panel.is-open { display: flex; }

  .mobile-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .mobile-chat-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
  }
  .mobile-chat-title .chat-header-status { margin-top: 2px; }

  .mobile-chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-chat-panel .chat-input-area {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
