 :root {
  /* Design Tokens (Contract) */
  --bg-primary: #0f1014;
  --bg-secondary: #1a1d24;
  --bg-tertiary: #222734;
  --bg-hover: #262c3a;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --text-muted: rgba(255, 255, 255, 0.4);

  --accent: #e07b39;
  --accent-hover: #c96b2f;
  --accent-soft: rgba(224, 123, 57, 0.12);
  --accent-green: #22c55e;
  --accent-red: #e74c3c;
  --accent-blue: #3b82f6;

  --border: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-medium: rgba(255, 255, 255, 0.18);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* Input/Interactive Elements */
  --input-bg: #2d2d2d;
  --input-border: #4a4a4a;
  --input-focus: #e07b39;         /* Orange accent on focus */

  /* Card & Surface Colors */
  --card-bg: #2d2d2d;
  --main-bg: #1e1e1e;
  --sidebar-bg: #2d2d2d;
  --sidebar-border: #404040;

  /* Shadows - Subtle for dark theme */
  --shadow-soft: 0px 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card: 0px 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-strong: 0px 8px 32px rgba(0, 0, 0, 0.5);

  /* Border Radius */
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-pill: 24px;

  /* Layout Constants */
  --max-chat-width: 768px;        /* Claude's centered content width */
  --sidebar-width: 260px;         /* Claude's sidebar width */
  --artifact-width: min(720px, 50vw);

  /* Spacing Scale */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 0.75rem;   /* 12px */
  --space-lg: 1rem;      /* 16px */
  --space-xl: 1.5rem;    /* 24px */
  --space-2xl: 2rem;     /* 32px */
  --app-vh: 100vh;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  /* Claude's font stack */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  position: relative;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT REGRESSION FIX: CSS GRID PREVENTS FILTER/ARTIFACT OVERLAP
   ═══════════════════════════════════════════════════════════════════════
   Grid columns: [Sidebar] [Main Content] [Property Panel] [Filter Panel]
   - No more position:fixed overlays that block content
   - Deterministic side-by-side layout on desktop
   - Graceful mobile behavior with auto-close
   ═══════════════════════════════════════════════════════════════════════ */

#app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(360px, 1fr);
  grid-template-areas: "nav console";
  height: 100vh;
  min-height: 100vh;
  isolation: isolate;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Grid positioning for each section */
.sidebar {
  grid-area: nav;
}

.main-pane {
  grid-area: console;
  min-width: 0;
}

.property-panel {
  grid-area: artifact;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR - CLAUDE STYLE
   ═══════════════════════════════════════════════════════════════════════ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 5;
  transition: width 0.2s ease, padding 0.2s ease;
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* Sidebar toggle button */
.sidebar-toggle {
  position: absolute;
  top: 20px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.toggle-icon {
  display: block;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
  width: 70px;
  padding: 1rem 0.75rem;
}

.sidebar.collapsed .vector-logo-text,
.sidebar.collapsed .brand-subtitle,
.sidebar.collapsed .section-label,
.sidebar.collapsed .case-item,
.sidebar.collapsed .conversation-empty-state,
.sidebar.collapsed .empty-state-text,
.sidebar.collapsed .empty-state-hint {
  display: none;
}

.sidebar.collapsed .vector-logo {
  justify-content: center;
}

.sidebar.collapsed .sidebar-section {
  align-items: center;
}

.sidebar.collapsed .conversation-list {
  width: 100%;
}

.sidebar.collapsed .primary-pill {
  font-size: 0;
  height: 44px;
  padding: 0;
  text-align: center;
  display: grid;
  place-items: center;
}

.sidebar.collapsed .primary-pill::before {
  content: "+";
  font-size: 20px;
  font-weight: 600;
}

.sidebar.collapsed .danger-pill {
  font-size: 0;
  height: 44px;
  padding: 0;
  text-align: center;
  display: grid;
  place-items: center;
}

.sidebar.collapsed .danger-pill::before {
  content: "🗑️";
  font-size: 16px;
  line-height: 1;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.vector-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vector-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}

.vector-logo-icon img {
  width: 24px;
  height: 24px;
}

.vector-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}

.brand-logo {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 15px;
  color: var(--text-primary);
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.6;
}

/* New Case Button */
.primary-pill {
  width: 100%;
  height: 48px;
  background: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: var(--radius-md);
  color: #ffffff;
  padding: 0 1rem;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.primary-pill:hover {
  background: #2563eb;
  border-color: rgba(59, 130, 246, 0.8);
}

/* Danger Button - Clear All Cases */
.danger-pill {
  width: 100%;
  height: 44px;
  background: rgba(231, 76, 60, 0.14);
  border: 1px solid rgba(231, 76, 60, 0.45);
  border-radius: var(--radius-md);
  color: #f5b7b1;
  padding: 0 1rem;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.danger-pill:hover {
  background: rgba(231, 76, 60, 0.22);
  border-color: rgba(231, 76, 60, 0.6);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 0.25rem 0.5rem;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Case list items */
.case-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.75rem 0.875rem;
  border-left: 2px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.case-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.case-item.active {
  background: rgba(224, 123, 57, 0.08);
  color: var(--text-primary);
  border-left-color: var(--accent);
}

.case-address {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-timestamp {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 3-dot menu button (ellipsis) */
.conversation-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.conversation-row:hover .conversation-menu-btn {
  opacity: 1;
  pointer-events: auto;
}

.conversation-menu-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

/* Dropdown menu - Light theme for contrast */
.conversation-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 4px;
  min-width: 160px;
  z-index: 10000;
  animation: menuFadeIn 0.15s ease;
}

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

.conversation-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.625rem 0.75rem;
  color: #111827;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.conversation-menu-item:hover {
  background: #f3f4f6;
}

.conversation-menu-item .menu-icon {
  font-size: 16px;
  opacity: 0.7;
}

.session-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.session-card.active {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.session-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.session-title {
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.session-subtext {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════
   MAIN PANE - CLAUDE STYLE
   ═══════════════════════════════════════════════════════════════════════ */

.main-pane {
  position: relative;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  flex: 1;
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Console Header */
.console-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Artifact column is always present; keep grid stable */
#app-shell.artifact-open {
  grid-template-columns: 260px minmax(420px, 1fr) minmax(420px, min(720px, 50vw));
  grid-template-areas: "nav console artifact";
  --max-chat-width: 100%;
}

#app-shell.artifact-open .main-pane {
  flex: 1 1 auto;
  max-width: none;
  min-width: 420px;
}

#app-shell.artifact-open .messages-frame {
  max-width: 100%;
  margin: 0;
}

#app-shell.artifact-open .chat-window {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-gradient {
  display: none; /* Claude doesn't use gradient overlays */
}

.chat-window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 24px;
}

/* ═══════════════════════════════════════════════════════════════════════
   HERO PANEL / WELCOME SCREEN - CLAUDE STYLE
   ═══════════════════════════════════════════════════════════════════════ */

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  transition: opacity 0.3s ease;
}

.hero-panel.hidden {
  display: none;
}

.hero-copy {
  max-width: 768px;
  width: 100%;
  padding: 2rem;
  animation: fadeInUp 0.6s ease;
}

.eyebrow {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;           /* 12px */
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  animation-delay: 0s;
}

/* Greeting Container with Emoji */
.hero-greeting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  animation-delay: 0.1s;
}

.greeting-emoji {
  font-size: 2.5rem;            /* 40px - larger and more visible */
  line-height: 1;
  display: inline-block;
}

.chat-hero-heading {
  font-size: 2.5rem;            /* 40px */
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.2;
}

.chat-hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;          /* 18px */
  line-height: 1.5;
  margin: 0 0 1.5rem 0;         /* Reduced from 2.5rem to match Claude's tighter spacing */
  animation-delay: 0.2s;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPOSER - DUAL MODE (Welcome & Chat)
   ═══════════════════════════════════════════════════════════════════════ */

/* Welcome Mode - Centered with greeting */
.composer.composer-welcome-mode {
  position: relative;
  width: 100%;
  max-width: 48rem;
  margin: 1.5rem auto 0;  /* Spacing from subtitle */
  padding: 0;
  background: transparent;
  border: none;
  animation: fadeInUp 0.6s ease both;
  animation-delay: 0.3s;
}

.composer.composer-welcome-mode .composer-inner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 0.75rem;
  padding: 0.5rem;
  transition: border-color 0.2s ease;
}

.composer.composer-welcome-mode .composer-inner:focus-within {
  border-color: var(--accent);
}

/* Chat Mode - Fixed at bottom (default/existing styling) */
.composer.composer-chat-mode {
  /* Existing fixed positioning */
}

/* Fade-in animation for welcome screen elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy > * {
  animation: fadeInUp 0.6s ease both;
}

.eyebrow {
  animation-delay: 0s;
}

.hero-greeting {
  animation-delay: 0.1s;
}

.chat-hero-subtitle {
  animation-delay: 0.2s;
}

.welcome-input-container {
  animation-delay: 0.3s;
}

/* Responsive Welcome Screen */
@media (max-width: 768px) {
  .chat-hero-heading {
    font-size: 1.75rem;         /* Smaller on mobile */
  }

  .greeting-emoji {
    font-size: 1.5rem;
  }

  .chat-hero-subtitle {
    font-size: 1rem;
  }

  .welcome-input-container {
    max-width: 100%;
    margin: 0 1rem;
  }
}

@media (max-width: 1024px) {
  .chat-hero-heading {
    font-size: 2rem;
  }
}

/* Messages Container */
.messages-shell {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 0;
  position: relative;
}

.messages-frame {
  position: relative;
  min-height: 100%;
  max-width: 100%;
  margin: 0;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
  padding-top: 2rem;
}

.message-row {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

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

.message-row.assistant {
  justify-content: flex-start;
}

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

/* Message Bubbles - Claude Style (Clean & Minimal) */
.message-bubble {
  max-width: 90%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

#app-shell.artifact-open .message-bubble {
  max-width: 100%;
}

.message-row.assistant .message-bubble {
  background: transparent;
  color: var(--text-primary);
  border: none;
  padding-left: 0;
}

.message-row.user .message-bubble {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  max-width: 80%;
}

/* System context message */
.system-context-message {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.system-context-message strong {
  color: var(--text-primary);
}

/* Action chips */
.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(224, 123, 57, 0.12);
  border: 1px solid rgba(224, 123, 57, 0.4);
  color: #f7c9a8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-chip:hover {
  background: rgba(224, 123, 57, 0.2);
  border-color: rgba(224, 123, 57, 0.6);
}

.artifact-link {
  color: var(--accent);
  text-decoration: none;
}

.artifact-link:hover {
  text-decoration: underline;
}

.deal-list-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 12px 14px;
}

.deal-list-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.deal-quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.deal-quick-item {
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.deal-quick-item:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.deal-quick-address {
  font-size: 14px;
  font-weight: 600;
}

.deal-quick-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Thinking Indicator - Claude Style */
.thinking-indicator {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  font-weight: 500;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.thinking-hidden {
  opacity: 0;
  pointer-events: none;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.thinking-text {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   INPUT AREA - CLAUDE STYLE
   ═══════════════════════════════════════════════════════════════════════ */

#chat-input-container {
  position: sticky;
  bottom: 0;
  padding: 1rem 2rem 1.5rem;
  background: var(--bg-primary);
  z-index: 3;
  flex: 0 0 auto;
}

/* Status Pill */
.omega-status-pill {
  margin: 0 auto 0.5rem auto;
  padding: 0.5rem 1rem;
  max-width: 60%;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.omega-status-visible {
  opacity: 1;
}

.vector-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s infinite;
}

/* Input Composer */
.composer-inner {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  transition: border-color 0.2s ease;
}

.composer-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(224, 123, 57, 0.35);
}

#console-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  resize: none;
  min-height: 50px;
  max-height: 200px;
  line-height: 1.5;
  font-family: inherit;
}

#console-input:focus {
  outline: none;
}

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

#console-input:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Send Button - Claude Orange */
#send-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: not-allowed;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

#send-button.enabled {
  cursor: pointer;
  background: var(--accent);
  color: white;
}

#send-button.enabled:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   INFO DRAWER
   ═══════════════════════════════════════════════════════════════════════ */

#info-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 320px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 6;
  border-left: 1px solid var(--border-subtle);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.drawer-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.context-section {
  padding: 1rem 1.25rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.drawer-hidden {
  transform: translateX(100%);
}

.drawer-visible {
  transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════════════════
   PROPERTY PANEL - RIGHT DRAWER OVERLAY
   ═══════════════════════════════════════════════════════════════════════ */

.property-panel-backdrop {
  display: none;
}

.property-panel-backdrop-visible {
  display: none;
}

.property-panel {
  position: relative;
  height: 100%;
  min-height: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-self: stretch;
  align-self: stretch;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: none;
  z-index: 6;
  display: flex;
  flex-direction: column;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease, height 0.2s ease;
  overflow: hidden;
}

/* Legacy classes for backwards compatibility */
.property-panel-hidden {
  display: none;
}

.property-panel-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.property-panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(18px, 2vw, 24px);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  min-height: 80px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.artifact-top-actions {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0.5rem clamp(18px, 2vw, 24px) 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

#app-shell.artifact-open .artifact-top-actions {
  display: flex;
}

#app-shell.artifact-open .property-panel-minimized .artifact-top-actions {
  display: none;
}

.artifact-action-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.artifact-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.property-panel-tabs {
  display: flex;
  gap: 8px;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem clamp(18px, 2vw, 24px) 0.75rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

/* Property Tabs - Claude Style with Orange Accent */
.property-tab {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 220px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.property-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.property-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.property-panel-back {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  margin-right: 0.75rem;
  display: none; /* Hidden by default, shown when history exists */
}

.property-panel-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.property-panel-close {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  margin-left: 0.75rem;
}

.property-panel-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.property-panel-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem clamp(18px, 2vw, 24px) 2rem;
  background: var(--bg-secondary);
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Decision spine */
.decision-spine {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.spine-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.spine-item.complete {
  color: #d1fae5;
  border-color: rgba(34, 197, 94, 0.4);
}

.spine-item.warning {
  color: #fbd6b0;
  border-color: rgba(224, 123, 57, 0.5);
}

.spine-item.incomplete {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
}

/* MAO section */
.mao-section {
  border: 1px solid rgba(224, 123, 57, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.02);
  margin: 16px 0;
}

.mao-section.pending {
  animation: mao-pulse 2s ease-in-out infinite;
}

.mao-label-primary {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}

.mao-label-secondary {
  font-size: 11px;
  color: rgba(224, 123, 57, 0.9);
  margin-top: 4px;
}

.mao-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 12px 0 8px;
}

.market-value-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.02);
  margin: 16px 0;
}

.market-value-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}

.market-value-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 12px 0 4px;
}

.mao-divider {
  height: 1px;
  border: none;
  background: var(--accent);
  margin: 12px 0;
}

.mao-assumptions {
  font-size: 12px;
  color: var(--text-secondary);
}

.mao-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mao-spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes mao-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mao-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(224, 123, 57, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(224, 123, 57, 0.12);
  }
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.metric-row:last-child {
  border-bottom: none;
}

.equity-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #4ade80 100%);
}

/* Strategy section */
.strategy-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.02);
}

.strategy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.strategy-type {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
}

.strategy-rationale {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  max-height: 3.8em;
  overflow: hidden;
}

.strategy-section.expanded .strategy-rationale {
  max-height: none;
}

/* Call-safe summary */
.call-safe-toggle {
  width: 100%;
  margin: 16px 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.call-safe-content.hidden {
  display: none;
}

.call-safe-content ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Comps */
.comps-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.02);
}

/* Follow-up text templates */
.follow-up-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.02);
}

.follow-up-header {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.follow-up-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.followup-template {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.followup-template:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.followup-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.followup-template-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.followup-template-actions {
  display: flex;
  gap: 8px;
}

.followup-copy-btn,
.followup-edit-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.followup-copy-btn:hover,
.followup-edit-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.followup-template-text {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.followup-template-input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  min-height: 80px;
}

.followup-template-input.hidden,
.followup-template-text.hidden {
  display: none;
}

.comps-header {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.comp-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.comp-item:last-child {
  border-bottom: none;
}

.comp-address {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.comp-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.comps-table-wrapper.hidden {
  display: none;
}

.comps-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.comps-table th,
.comps-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.comps-table th {
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.comps-table th.sort-active {
  color: var(--text-primary);
}

.comps-table th.sort-active::after {
  content: "^";
  font-size: 10px;
  margin-left: 6px;
  color: var(--accent);
}

.comps-table th.sort-active[data-sort-dir="desc"]::after {
  content: "v";
}

/* Artifact footer */
.artifact-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg-secondary);
  padding: 12px clamp(18px, 2vw, 24px) 0;
}

.artifact-footer-actions {
  display: flex;
  gap: 10px;
  padding: 12px 0;
}

.live-calls-btn,
.next-deal-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.live-calls-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Embedded Live Calls panel */
.live-calls-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: min(520px, calc(100% - 40px));
  height: 70vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1200;
}

.live-calls-panel.hidden {
  display: none;
}

.live-calls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.live-calls-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.live-calls-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-calls-icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.live-calls-icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.live-calls-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #0a0a0a;
}

@media (max-width: 960px) {
  .live-calls-panel {
    width: calc(100% - 24px);
    height: 60vh;
    bottom: 12px;
    right: 12px;
  }
}

/* Artifact link highlight */
.artifact-highlight {
  animation: artifact-glow 2s ease;
}

@keyframes artifact-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(224, 123, 57, 0.6);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(224, 123, 57, 0);
  }
}

.artifact-header-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.artifact-header-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-header-text p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.artifact-expand-btn {
  margin: 10px 1.5rem 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.artifact-expand-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.artifact-resume-island {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(760px, calc(100% - 56px));
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 29, 36, 0.96);
  color: var(--text-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.artifact-resume-island:hover {
  border-color: rgba(224, 123, 57, 0.8);
}

.artifact-resume-island.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}

.artifact-resume-title {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(224, 123, 57, 0.95);
  font-weight: 700;
}

.artifact-resume-summary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* Dynamic Live Listen Island */
.dynamic-live-island {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12050;
  width: var(--dynamic-island-width, 420px);
  max-width: calc(100vw - 32px);
  border-radius: 999px;
  background: rgba(14, 17, 25, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  will-change: left, top, transform;
  transition: width 0.22s ease, height 0.24s ease, border-radius 0.24s ease, opacity 0.24s ease, transform 0.24s ease;
}

.dynamic-live-island.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}

.dynamic-live-island-main {
  width: 100%;
  min-height: 56px;
  height: auto;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.dynamic-live-island.content-wrap .dynamic-live-island-main {
  padding-top: 10px;
  padding-bottom: 10px;
}

.dynamic-live-island.content-tall .dynamic-live-island-main {
  padding-top: 11px;
  padding-bottom: 11px;
}

.dynamic-live-island.dragging {
  transition: none;
}

.dynamic-live-island.dragging .dynamic-live-island-main {
  cursor: grabbing;
}

.dynamic-live-island-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.dynamic-live-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.8);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.dynamic-live-state-dot.awaiting {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.dynamic-live-state-dot.working {
  background: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.dynamic-live-state-dot.connected {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.dynamic-live-state-dot.ended {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.dynamic-live-state-text {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.82);
}

.dynamic-live-call-timer {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.dynamic-live-script-line {
  font-size: 13px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dynamic-live-island.content-wrap .dynamic-live-script-line {
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.dynamic-live-island.content-tall .dynamic-live-script-line {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.dynamic-live-island-expanded {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.24s ease, opacity 0.24s ease;
  padding: 0 16px;
}

.dynamic-live-island.expanded {
  border-radius: 20px;
}

.dynamic-live-island.dynamic-width-md {
  --dynamic-island-width: 540px;
}

.dynamic-live-island.dynamic-width-lg {
  --dynamic-island-width: 640px;
}

.dynamic-live-island.dynamic-width-xl {
  --dynamic-island-width: 760px;
}

.dynamic-live-island.expanded .dynamic-live-island-expanded {
  max-height: 160px;
  opacity: 1;
  pointer-events: auto;
  padding: 8px 16px 12px;
}

.dynamic-live-expanded-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dynamic-live-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.52);
  font-weight: 600;
}

.dynamic-live-value {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.dynamic-live-expanded-script-wrap {
  margin-top: 2px;
}

.dynamic-live-expanded-script {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  max-height: 96px;
  overflow: hidden;
}

.dynamic-live-expanded-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.dynamic-live-end-btn {
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dynamic-live-end-btn:hover {
  background: rgba(239, 68, 68, 0.22);
}

.property-panel-minimized {
  height: 80px;
  align-self: start;
  overflow: hidden;
}

.property-panel-minimized .property-panel-content,
.property-panel-minimized .property-panel-tabs {
  display: none;
}

.property-panel-minimized .artifact-expand-btn {
  position: absolute;
  right: 16px;
  bottom: 12px;
  margin: 0;
}

.property-panel.live-listen-active {
  box-shadow: 0 0 0 2px rgba(224, 123, 57, 0.6);
}

.property-stream-container {
  max-width: none;
  margin: 0;
}

.property-loading-indicator {
  margin: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}

.property-empty-state {
  padding: 2rem 2.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.property-empty-state h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 18px;
}

/* ═══════════════════════════════════════════════════════════════════════
   PROFESSIONAL PROPERTY ARTIFACT - ENTERPRISE DESIGN
   ═══════════════════════════════════════════════════════════════════════ */

/* Reset artifact content */
.property-panel-content {
  padding: 0 clamp(20px, 2.2vw, 26px) 20px;
  background: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Animation for section streaming */
@keyframes fadeInSection {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide all emoji/icon elements */
.section-icon,
.property-section-icon,
.insight-icon,
.status-indicator {
  display: none !important;
}

/* 1. PROPERTY HEADER */
.artifact-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #2d2d2d;
}

.property-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f5f5f5;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.property-subtitle {
  font-size: 1rem;
  color: #9ca3af;
  margin: 0 0 1.5rem 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.status-badge.status-skip {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.status-badge.status-review {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.status-badge.status-strong {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #86efac;
}

.status-text {
  /* Main status text */
}

.status-divider {
  color: #4b5563;
}

.status-score {
  opacity: 0.9;
}

/* 2. ARTIFACT SECTIONS */
.artifact-section {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #2d2d2d;
  opacity: 0;
  animation: fadeInSection 0.4s ease forwards;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f5f5f5;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-underline {
  width: 2rem;
  height: 2px;
  background: #e07b39;
}

.section-content {
  color: #d1d5db;
}

/* 3. ANALYSIS SECTION */
.analysis-text {
  font-size: 1rem;
  line-height: 1.7;
  color: #e5e7eb;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.analysis-details {
  background: #1a1a1a;
  border: 1px solid #2d2d2d;
  border-left: 3px solid #e07b39;
  border-radius: 0.375rem;
  padding: 1rem 1.25rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #2d2d2d;
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-row:first-child {
  padding-top: 0;
}

.detail-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
}

.detail-value {
  font-size: 0.875rem;
  color: #e5e7eb;
  text-align: right;
}

/* 4. FINANCIAL SUMMARY / METRICS */
.metric-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid #2d2d2d;
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  min-width: 0;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e5e7eb;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.metric-value.highlight {
  color: #86efac;
  font-size: 1.25rem;
}

.metric-value.status-negative {
  color: #fca5a5;
}

.metric-value.status-warning {
  color: #fcd34d;
}

.metric-value.status-positive {
  color: #86efac;
}

.metric-with-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex: 1;
  margin-left: 2rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #2d2d2d;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #4ade80 100%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.metric-percentage {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* 5. PROPERTY INFORMATION */
.property-address-full {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.property-location-full {
  font-size: 0.9375rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  margin-top: 0;
}

.property-county {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.25rem;
  margin-top: 0;
}

.property-specs {
  padding-top: 1rem;
  border-top: 1px solid #2d2d2d;
}

.spec-item {
  font-size: 0.875rem;
  color: #d1d5db;
}

/* Fallback for no data */
.no-data {
  font-size: 0.95rem;
  color: #6b7280;
  font-style: italic;
}

/* Analysis Section Specific Styles */
.insight-main {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #d1d5db;
  margin: 0 0 1.5rem 0;
}

.analysis-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 2px solid #e07b39;
  padding-left: 1rem;
  margin-top: 1rem;
}

/* Metric Value Group (for equity bar) */
.metric-value-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}

.metric-subtext {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: right;
}

.equity-bar-container {
  width: 200px;
  height: 6px;
  background: #2d2d2d;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.equity-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #4ade80 100%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

/* Timeline Status Classes */
.metric-value.status-urgent {
  color: #fca5a5;
  font-weight: 600;
}

.metric-value.status-active {
  color: #fcd34d;
}

.metric-value.status-scheduled {
  color: #86efac;
}

.metric-value.status-passed {
  color: #9ca3af;
}

/* Priority Badges */
.priority-badge {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0.25rem;
}

.priority-badge.priority-high {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #86efac;
}

.priority-badge.priority-medium {
  background: rgba(252, 211, 77, 0.1);
  border: 1px solid rgba(252, 211, 77, 0.2);
  color: #fcd34d;
}

.priority-badge.priority-low {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

/* Detail Row Type Variants */
.detail-row.warning .detail-value {
  color: #fca5a5;
}

.detail-row.urgent .detail-value {
  color: #fbbf24;
  font-weight: 600;
}

.detail-row.info .detail-value {
  color: #86efac;
}

.detail-row.recommendation .detail-value {
  color: #60a5fa;
}

/* Recommended Approach Section */
.recommended-approach {
  background: linear-gradient(135deg, #1a1a1a 0%, #1f1f1f 100%);
  border: 1px solid #2d2d2d;
}

.approach-subsection {
  margin-bottom: 2rem;
}

.approach-subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #2d2d2d;
}

.approach-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #e5e7eb;
  margin: 0;
}

/* Script Box */
.script-box {
  background: #0f0f0f;
  border: 1px solid #2d2d2d;
  border-left: 3px solid #e07b39;
  border-radius: 0.375rem;
  padding: 1rem 1.25rem;
}

.script-text {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #d1d5db;
  font-style: italic;
  margin: 0;
}

/* Talking Points List */
.talking-points-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.talking-points-list li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #e5e7eb;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.talking-points-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #e07b39;
  font-weight: bold;
  font-size: 1.25rem;
}

/* Avoid List */
.avoid-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.avoid-list li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #fca5a5;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.avoid-list li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  .artifact-header,
  .artifact-section {
    padding: 1.5rem 1.25rem;
  }

  .property-title {
    font-size: 1.25rem;
  }

  .equity-bar-container {
    width: 150px;
  }
}

/* Reopen Property Button */
.reopen-property-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.15s ease;
  z-index: 99;
}

.reopen-property-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - MOBILE & TABLET
   ═══════════════════════════════════════════════════════════════════════ */

/* Tablet and smaller devices */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
    --max-chat-width: 100%;
  }

  .chat-hero-heading {
    font-size: 32px;
  }

  .property-panel {
    width: 100%;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  #app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "console";
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 10;
    width: 280px;
  }

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

  .chat-hero-heading {
    font-size: 28px;
  }

  .hero-copy {
    padding: 1.5rem;
  }

  .chat-window {
    padding: 1rem 1rem 0;
  }

  #chat-input-container {
    padding: 0.75rem 1rem 1.25rem;
  }

  .composer-inner {
    padding: 0.625rem 0.625rem 0.625rem 0.875rem;
  }

  .message-bubble {
    max-width: 90%;
  }

  .property-panel {
    width: 100%;
  }

  .property-panel-content {
    padding: 1rem;
  }

  .property-data-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .property-data-label {
    min-width: 0;
  }

  .property-data-value {
    text-align: left;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .chat-hero-heading {
    font-size: 24px;
  }

  .sidebar {
    width: 260px;
  }

  #info-drawer {
    width: 100%;
  }
}

/* Contract Responsive Rules */
@media (max-width: 1279px) {
  #app-shell {
    grid-template-columns: 70px minmax(320px, 1fr);
    grid-template-areas: "nav console";
  }

  #app-shell.artifact-open {
    grid-template-columns: 70px minmax(320px, 1fr) minmax(0, 1fr);
    grid-template-areas: "nav console artifact";
  }

  .sidebar {
    width: 70px;
    padding: 1rem 0.5rem;
  }

  .sidebar .vector-logo-text,
  .sidebar .section-label,
  .sidebar .case-item,
  .sidebar .conversation-list {
    display: none;
  }

  .property-panel {
    height: 80px;
    align-self: start;
  }

  .property-panel-content,
  .property-panel-tabs {
    display: none;
  }

  .artifact-expand-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  #app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "console";
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 64px;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    padding: 0 12px;
    border-top: 1px solid var(--border);
    transform: none;
  }

  .sidebar-top,
  .sidebar-section {
    display: none;
  }

  .primary-pill,
  .danger-pill {
    height: 40px;
    font-size: 12px;
    width: auto;
    padding: 0 12px;
  }

  .property-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 64px;
    height: 55vh;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    z-index: 40;
  }

  .property-panel-minimized {
    height: 80px;
  }

  .artifact-resume-island {
    top: 54px;
    max-width: calc(100% - 24px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SPLIT-SCREEN RESPONSIVE BEHAVIOR
   ═══════════════════════════════════════════════════════════════════════ */

@media (min-width: 1025px) {
  #app-shell.artifact-open {
    --artifact-width: min(720px, 50vw);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #app-shell.artifact-open {
    --artifact-width: min(460px, 46vw);
  }

  #app-shell.artifact-open .main-pane {
    min-width: 320px;
  }
}

@media (max-width: 768px) {
  #app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "console";
  }

  #app-shell.artifact-open {
    grid-template-columns: 1fr;
  }

  #app-shell.artifact-open .main-pane {
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING - CLAUDE DARK THEME
   ═══════════════════════════════════════════════════════════════════════ */

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON - FILTER TOGGLE
   ═══════════════════════════════════════════════════════════════════════ */

.filter-toggle-fab {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.filter-toggle-fab:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(224, 123, 57, 0.4);
}

.filter-toggle-fab:active {
  transform: scale(0.95);
}

/* Keep FAB accessible when artifact panel is open */
#app-shell.artifact-open .filter-toggle-fab {
  display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════
   LIVE LISTEN BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

/* Global Live Listen Button - Floating Action Button */
.global-live-listen-btn {
  position: fixed;
  top: 90px; /* Below filter toggle button */
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4a9eff; /* Blue for live listen */
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  z-index: 149; /* Just below filter toggle */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.global-live-listen-btn:hover {
  background: #3a8eef;
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(74, 158, 255, 0.4);
}

.global-live-listen-btn:active {
  transform: scale(0.95);
}

/* Active state - listening */
.global-live-listen-btn.live-listen-active {
  background: #ef4444; /* Red when active/recording */
  animation: pulse 2s ease-in-out infinite;
}

.global-live-listen-btn.live-listen-active:hover {
  background: #dc2626;
}

/* Mode active - this button's mode is active */
.global-live-listen-btn.live-listen-mode-active {
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.3);
}

/* Property Live Listen Button - Inside property panel header */
.property-live-listen-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4a9eff;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.property-live-listen-btn:hover {
  background: #3a8eef;
  transform: scale(1.05);
}

.property-live-listen-btn:active {
  transform: scale(0.95);
}

/* Active state - listening */
.property-live-listen-btn.live-listen-active {
  background: #ef4444; /* Red when active/recording */
  animation: pulse 2s ease-in-out infinite;
}

.property-live-listen-btn.live-listen-active:hover {
  background: #dc2626;
}

/* Mode active - this button's mode is active */
.property-live-listen-btn.live-listen-mode-active {
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.3);
}

/* Pulse animation for active recording state */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Keep global live listen FAB accessible when artifact panel is open */
#app-shell.artifact-open .global-live-listen-btn {
  display: flex;
}

/* Artifact toggle button */
.artifact-toggle-btn {
  position: fixed;
  top: 160px; /* Below live listen button */
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #22c55e;
  color: #0f1d14;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  z-index: 148;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.artifact-toggle-btn:hover {
  background: #16a34a;
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.35);
}

.artifact-toggle-btn:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════════
   LIVE LISTEN TRANSCRIPT PANEL
   ═══════════════════════════════════════════════════════════════════════ */

.live-listen-transcript-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 450px;
  max-height: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
  z-index: 10002; /* ISSUE 2 FIX: Above everything (filter 10000, property 9999) */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease; /* Smooth docking + compact animation */
}

/* ISSUE 2 FIX: Smart dock behavior - when property drawer is open, dock to the left */
.live-listen-transcript-panel.live-listen-docked {
  right: calc(var(--drawer-offset, 720px) + 16px); /* Dynamic offset from JavaScript */
}

/* ISSUE 2 FIX: Compact mode when viewport too narrow */
.live-listen-transcript-panel.live-listen-compact {
  width: 360px;
  max-width: calc(100vw - var(--drawer-offset, 0px) - 80px);
}

.live-listen-transcript-panel.live-listen-compact .transcript-content {
  max-height: 200px; /* Shrink transcript list */
}

/* ISSUE 2 FIX: Mobile responsive - stack vertically on small screens */
@media (max-width: 768px) {
  .live-listen-transcript-panel.live-listen-docked {
    /* On mobile, property drawer is fullscreen, so move HUD to top */
    bottom: auto;
    top: 20px;
    right: 20px;
    width: calc(100vw - 40px);
    max-width: 400px;
  }

  .live-listen-transcript-panel.live-listen-compact {
    width: calc(100vw - 40px);
    max-width: 400px;
  }
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.transcript-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
}

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

.transcript-status {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(74, 158, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}

.transcript-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.transcript-close-btn:hover {
  background: var(--bg-hover);
}

.transcript-context {
  padding: var(--space-md);
  background: rgba(74, 158, 255, 0.1);
  border-bottom: 1px solid var(--border-subtle);
}

.context-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.context-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.context-details {
  font-size: 12px;
  color: var(--text-secondary);
}

.transcript-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  max-height: 300px;
  min-height: 150px;
}

.transcript-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: var(--space-xl);
  font-style: italic;
}

.transcript-entry {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.homeowner-speech {
  background: rgba(74, 158, 255, 0.1);
  border-left: 3px solid #4a9eff;
}

.speaker-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.speech-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.coaching-panel {
  padding: var(--space-md);
  background: rgba(34, 197, 94, 0.1);
  border-top: 1px solid var(--border-subtle);
  border-left: 3px solid #22c55e;
}

.coaching-panel.coaching-risk {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
}

.coaching-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #22c55e;
  margin-bottom: 6px;
}

.coaching-panel.coaching-risk .coaching-label {
  color: #ef4444;
}

.coaching-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   FILTER PANEL - DIRECT SEARCH MODE
   ═══════════════════════════════════════════════════════════════════════ */

/* Filter panel overlays the grid (console + artifact remain clickable) */
.filter-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 340px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 10001;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
}

#app-shell.filter-open {
  grid-template-columns: 260px minmax(360px, 1fr);
  grid-template-areas: "nav console";
}

#app-shell.filter-open .filter-panel {
  transform: translateX(0);
}

#app-shell.artifact-open.filter-open {
  grid-template-columns: 260px minmax(420px, 1fr) minmax(420px, min(720px, 50vw));
  grid-template-areas: "nav console artifact";
}

.filter-header {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.filter-header h3 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-header .btn-icon {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.filter-header .btn-icon:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}

.filter-header .btn-secondary {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.filter-header .btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-sections {
  flex: 1;
  overflow-y: auto;
}

.filter-group {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group label {
  font-weight: 400;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.checkbox-group label:hover {
  color: var(--text-primary);
}

.checkbox-group input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.filter-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.range-inputs span {
  color: var(--text-secondary);
  font-size: 12px;
}

.filter-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-primary);
}

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

.filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-primary);
}

.quick-filters {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-chip {
  padding: 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-chip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-chip.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.active-filters {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  min-height: 48px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-primary);
  background-opacity: 0.1;
  border: 1px solid var(--accent-primary);
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 500;
}

.filter-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.filter-actions .btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-actions .btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-actions .btn-primary:active {
  transform: translateY(0);
}

/* Toggle button when filter panel is collapsed */
.filter-toggle-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: all 0.2s;
}

.filter-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESULTS GRID PANEL - DIRECT SEARCH RESULTS
   ═══════════════════════════════════════════════════════════════════════ */

.results-panel {
  position: fixed;
  left: 280px; /* sidebar width */
  top: 60px;
  right: 0;
  height: calc(100vh - 60px);
  background: var(--bg-primary);
  overflow-y: auto;
  z-index: 50;
  transition: right 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Auto-fit results panel so it never covers artifact/filter surfaces */
#app-shell.filter-open .results-panel {
  right: 340px;
}

#app-shell.artifact-open .results-panel {
  right: min(720px, 50vw);
}

#app-shell.artifact-open.filter-open .results-panel {
  right: calc(min(720px, 50vw) + 340px);
}

.results-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.results-header {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.results-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.results-header .btn-icon {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.results-header .btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 24px;
}

.deal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.deal-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.deal-card .deal-score {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent-primary);
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.deal-card h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding-right: 70px; /* make room for score badge */
  line-height: 1.4;
}

.deal-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.deal-metrics span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deal-card.wholesale-mode .wholesale-primary-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deal-card.wholesale-mode .wholesale-primary-metrics span {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.deal-card.wholesale-mode .deal-ai-analysis-box {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 10px;
  background: linear-gradient(
    145deg,
    rgba(249, 115, 22, 0.14) 0%,
    rgba(249, 115, 22, 0.08) 50%,
    rgba(15, 23, 42, 0.35) 100%
  );
}

.deal-card.wholesale-mode .deal-ai-analysis-label {
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.deal-card.wholesale-mode .deal-ai-analysis-text {
  line-height: 1.35;
  white-space: normal;
  color: var(--text-primary);
}

.deal-card.wholesale-mode .deal-ai-analysis-meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.deal-card.wholesale-mode .deal-ai-confidence-tag {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deal-card.wholesale-mode .wholesale-secondary-metrics {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.deal-card.wholesale-mode.is-expanded .wholesale-secondary-metrics {
  display: flex;
}

.deal-card.wholesale-mode.is-expanded {
  border-color: var(--accent-primary);
}

.no-results {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.no-results p {
  margin: 0 0 20px 0;
  font-size: 16px;
}

.no-results button {
  padding: 10px 20px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.no-results button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Adjust main-pane when filter panel is open */
/* REMOVED OBSOLETE: Old flex-based margin push - now using grid */
/* #app-shell .main-pane { margin-right: ...; } */
/* Replaced by grid-template-columns in #app-shell.filter-open */

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE: Auto-close filters, overlay mode on small screens
   ═══════════════════════════════════════════════════════════════════════ */

/* Filter panel backdrop for mobile overlay mode */
.filter-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999; /* Under filter panel, above property panel */
  display: none;
}

#app-shell.filter-open .filter-panel-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile/Tablet (< 1280px): Filters overlay instead of side-by-side */
@media (max-width: 1279px) {
  /* On mobile, filters use position: fixed overlay */
  .filter-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 300px;
    z-index: 10001; /* ISSUE 1 FIX: Above backdrop (9999) */
    transform: translateX(100%); /* Start off-screen */
  }

  #app-shell.filter-open .filter-panel {
    transform: translateX(0); /* Slide in */
  }

  /* Reset grid on mobile - don't allocate column for filter */
  #app-shell.filter-open {
    grid-template-columns: 70px minmax(320px, 1fr);
    grid-template-areas: "nav console";
  }

  #app-shell.artifact-open.filter-open {
    grid-template-columns: 70px minmax(320px, 1fr) minmax(0, 1fr);
    grid-template-areas: "nav console artifact";
  }
}

/* Desktop (>= 1280px): Grid layout, no overlays */
@media (min-width: 1280px) {
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 1024px) {
  .filter-panel {
    width: 280px;
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS (for non-persistent errors)
   ═══════════════════════════════════════════════════════════════════════ */

.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  max-width: 400px;
  box-shadow: var(--shadow-strong);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10003; /* Above everything */
  animation: toast-slide-in 0.3s ease;
}

.toast-error {
  border-left-color: #e74c3c;
}

.toast-warning {
  border-left-color: #f39c12;
}

.toast-success {
  border-left-color: #2ecc71;
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast-fade-out {
  animation: toast-fade-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-fade-out {
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   APP MODAL (in-app confirm/alert)
   ═══════════════════════════════════════════════════════════════════════ */

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10004;
}

.app-modal-backdrop-visible {
  opacity: 1;
  pointer-events: auto;
}

.app-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10005;
}

.app-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.app-modal-card {
  width: min(420px, 90vw);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
  padding: 20px;
  color: var(--text-primary);
}

.app-modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.app-modal-message {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.app-modal-btn {
  border-radius: var(--radius-md);
  padding: 8px 14px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
}

.app-modal-confirm {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.app-modal-confirm.destructive {
  background: #e74c3c;
  border-color: #e74c3c;
}

.app-modal-cancel {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════
   LIVE LISTEN MIC BANNER
   ═══════════════════════════════════════════════════════════════════════ */

.live-listen-mic-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 13px;
}

.live-listen-mic-banner.banner-warning {
  border-color: rgba(231, 76, 60, 0.6);
  background: rgba(231, 76, 60, 0.15);
  color: #f5c6c6;
}

.mic-banner-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mic-spin 0.9s linear infinite;
}

.mic-banner-spinner.hidden {
  display: none;
}

@keyframes mic-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   CONVERSATION EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════ */

.conversation-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ========================================
   ARTIFACT MODE TOGGLE
   ======================================== */

.artifact-mode-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 3px;
  margin-right: 12px;
}

.mode-toggle-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.mode-toggle-btn.active {
  background: #f97316;
  color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* ========================================
   BASIC MODE ARTIFACT DESIGN
   Dark Theme + Orange Accents
   ======================================== */

.basic-mode-artifact {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.basic-mode-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.motivation-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.motivation-critical {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.motivation-high {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.motivation-medium {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.motivation-low {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Urgency Bar */
.urgency-bar-container {
  margin-bottom: 28px;
}

.urgency-bar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.urgency-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.urgency-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.urgency-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.urgency-bar-fill.critical {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.urgency-bar-fill.high {
  background: linear-gradient(90deg, #f97316, #ea580c);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
}

.urgency-bar-fill.medium {
  background: linear-gradient(90deg, #fb923c, #f97316);
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.4);
}

.urgency-bar-fill.low {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
  box-shadow: 0 0 6px rgba(156, 163, 175, 0.3);
}

.urgency-bar-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 8px;
  font-weight: 500;
}

/* Basic Metrics Grid */
.basic-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.basic-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.basic-metric:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.15);
}

.basic-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.basic-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #fb923c;
  line-height: 1.2;
}

.basic-metric-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.basic-metric-warning {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(251, 146, 60, 0.9);
}

/* AI Insight Section */
.basic-insight-section {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.basic-insight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fb923c;
  margin-bottom: 10px;
  font-weight: 600;
}

.basic-insight-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.basic-insight-meta-row {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.basic-insight-meta-row strong {
  color: rgba(251, 146, 60, 0.95);
  font-weight: 600;
}

.basic-insight-evidence,
.basic-insight-why {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.basic-insight-evidence strong,
.basic-insight-why strong {
  color: rgba(251, 146, 60, 0.95);
  font-weight: 600;
}

.basic-psych-section {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.basic-psych-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(147, 197, 253, 0.95);
  font-weight: 600;
}

.basic-psych-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.basic-psych-confidence-tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confidence-high {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.16);
}

.confidence-medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.16);
}

.confidence-low {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.16);
}

.basic-psych-summary {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.basic-psych-evidence,
.basic-psych-tone {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.basic-psych-tone strong {
  color: rgba(147, 197, 253, 0.95);
  font-weight: 600;
}

/* Owner Section */
.basic-owner-section {
  margin-bottom: 20px;
}

.basic-owner-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.basic-owner-list {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
}

.basic-owner-empty {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Phones Section */
.basic-phones-section {
  margin-bottom: 24px;
}

.basic-phones-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.basic-phones-list {
  font-size: 16px;
  font-weight: 500;
  color: #fb923c;
}

.basic-phone-link {
  color: #fb923c;
  text-decoration: none;
  transition: color 0.2s ease;
}

.basic-phone-link:hover {
  color: #f97316;
  text-decoration: underline;
}

.basic-phones-empty {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Footer */
.basic-mode-footer {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.basic-next-deal-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.basic-next-deal-btn:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.basic-next-deal-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.basic-next-deal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile layout hardening (iPhone overflow + safe-area fixes) */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }

  #app-shell,
  #app-shell.filter-open,
  #app-shell.artifact-open,
  #app-shell.artifact-open.filter-open {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "console" !important;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip !important;
  }

  .main-pane,
  #app-shell.artifact-open .main-pane {
    min-width: 0 !important;
    max-width: 100vw;
    overflow-x: clip;
  }

  body,
  #app-shell,
  .main-pane {
    height: 100dvh;
    min-height: 100dvh;
  }

  @supports not (height: 100dvh) {
    body,
    #app-shell,
    .main-pane {
      height: var(--app-vh);
      min-height: var(--app-vh);
    }
  }

  .chat-window,
  .messages-shell,
  .messages-frame,
  .messages {
    min-width: 0;
    max-width: 100%;
  }

  body,
  #app-shell,
  .main-pane,
  .chat-window,
  .messages-shell {
    touch-action: pan-y pinch-zoom;
  }

  .console-header {
    padding: 0 14px;
  }

  .composer.composer-welcome-mode {
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 12px calc(env(safe-area-inset-bottom, 0px) + 86px);
    background: var(--bg-primary);
    border: none;
    animation: none;
  }

  .composer.composer-welcome-mode .composer-inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
  }

  .messages-shell {
    overflow-x: hidden;
  }

  .messages {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  }

  .message-row,
  .message-bubble,
  .message-bubble * {
    min-width: 0;
    max-width: 100%;
  }

  .message-row.user .message-bubble,
  .message-row.assistant .message-bubble {
    max-width: 100%;
  }

  .message-bubble {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-bubble pre,
  .message-bubble code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    height: auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
    overflow: hidden;
  }

  .sidebar > *,
  .sidebar > a {
    width: 100%;
    min-width: 0;
  }

  .sidebar > .danger-pill {
    display: none;
  }

  .sidebar > .primary-pill,
  .sidebar a .primary-pill {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    padding: 0 10px;
    font-size: 12px;
  }

  .sidebar > .primary-pill,
  .sidebar a .primary-pill {
    margin-top: 0 !important;
  }

  #chat-input-container {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
  }

  body.mobile-keyboard-active .sidebar {
    display: none;
  }

  body.mobile-keyboard-active #chat-input-container {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }

  body.mobile-keyboard-active .messages {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  }

  body.mobile-keyboard-active .dynamic-live-island {
    display: none;
  }

  #console-input {
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .dynamic-live-island {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    max-width: calc(100vw - 20px);
  }

  .dynamic-live-island:not(.hidden) {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .property-panel {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    height: 56vh;
    max-height: 70vh;
  }

  .property-panel-header {
    min-height: auto;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .artifact-header-actions {
    margin-left: auto;
    gap: 6px;
  }

  .artifact-mode-toggle {
    margin-right: 0;
  }

  .mode-toggle-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .property-panel-tabs {
    padding: 8px 12px;
  }

  .property-panel-content {
    padding: 0 12px 12px;
  }

  .live-listen-transcript-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }

  .results-panel {
    left: 0;
    top: 48px;
    right: 0;
    height: calc(100vh - 48px);
  }

  #app-shell.filter-open .results-panel,
  #app-shell.artifact-open .results-panel,
  #app-shell.artifact-open.filter-open .results-panel {
    right: 0;
  }

  .filter-panel {
    width: min(320px, calc(100vw - 24px));
  }

  .filter-toggle-fab,
  .global-live-listen-btn,
  .artifact-toggle-btn {
    right: 12px;
  }

  .filter-toggle-fab {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
  }

  .global-live-listen-btn {
    top: calc(env(safe-area-inset-top, 0px) + 80px);
  }

  .artifact-toggle-btn {
    top: calc(env(safe-area-inset-top, 0px) + 148px);
  }
}


.basic-mode-footer {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.basic-next-deal-btn {
  flex: 1;
  padding: 14px 28px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.basic-next-deal-btn:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.basic-next-deal-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.basic-next-deal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
