/* ============================================
   PACE Pattern Styles
   Conversational storefront with Cormorant guide
   ============================================ */

/* PACE 1.0.1 Demo Tagline (in header) */
.demo-tagline {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* CSS Variables */
:root {
  /* Existing variables from main styles */
  --color-primary: #667eea;
  --color-primary-dark: #5568d3;
  --color-primary-light: #f3f4ff;
  --color-secondary: #764ba2;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-bg: #f8fafc;
  --color-bg-secondary: #f1f5f9;
  --color-bg-hover: #e2e8f0;
  --color-border: #e2e8f0;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 1rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1.5rem;

  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Base Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Use Space Grotesk for headings and important UI */
h1, h2, h3, h4, h5, h6,
.brand-name,
.sidebar-section h3,
.legal-header h1,
.product-name,
.cormorant-avatar + .chat-header-text h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============================================
   Icon Sidebar (ForageCast Style)
   ============================================ */

.icon-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin: 0 auto;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.icon-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-primary);
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.icon-btn.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
}

.icon-logo {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.5);
  color: var(--color-primary);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.icon-logo:hover {
  background: rgba(102, 126, 234, 0.2);
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.4);
}

/* ============================================
   Layout Grid
   ============================================ */

.app-container {
  margin-left: 64px;
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  grid-template-rows: 64px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

.header {
  grid-column: 1 / -1;
  grid-row: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle pattern overlay */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Header Brand */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.brand-name {
  font-size: 1.875rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: all 0.2s;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-name:hover {
  transform: translateY(-1px);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.brand-separator {
  font-size: 1.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
}

.brand-tagline {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

/* DevEx 2.0 Badge */
.devex-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.devex-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.3);
}

.devex-badge:active {
  transform: translateY(0);
}

.devex-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.devex-badge:hover .devex-label {
  color: white;
}

.devex-version {
  font-size: 0.75rem;
  font-weight: 700;
  color: #667eea; /* Purple accent */
  padding: 0.125rem 0.375rem;
  background: rgba(102, 126, 234, 0.15);
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.devex-badge:hover .devex-version {
  background: rgba(102, 126, 234, 0.25);
  color: #8b9aff;
}

.brand-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.brand-title-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-ecosystem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
  padding-left: 0.125rem;
}

.brand-ecosystem i {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile: Hide ecosystem text on very small screens */
@media (max-width: 480px) {
  .brand-ecosystem {
    display: none;
  }
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  background: white;
}

.chat-container {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  overflow: hidden;
}

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-radius: var(--radius-sm);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.sidebar-section h3 i {
  font-size: 1rem;
  color: var(--color-primary);
}

.sidebar-product {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.sidebar-product:hover {
  background: var(--color-bg-hover);
}

.sidebar-product.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.product-name {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  min-width: 0; /* Required for text-overflow to work */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-tagline {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 2rem;
}

.product-price {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  transition: all 0.2s ease;
  display: inline-block;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Free products: Green pill */
.product-price-free {
  background: #dcfce7;
  color: #166534;
}

/* Paid products: Purple pill */
.product-price-paid {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Hover effects */
.sidebar-product:hover .product-price-free {
  background: #bbf7d0;
}

.sidebar-product:hover .product-price-paid {
  background: rgba(102, 126, 234, 0.2);
}

/* Active product state */
.sidebar-product.active .product-price-free {
  background: #22c55e;
  color: white;
}

.sidebar-product.active .product-price-paid {
  background: var(--color-primary);
  color: white;
}

/* Product View Button - Hover-to-Reveal (Absolute Positioned) */
.product-view-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
}

/* Show button on product row hover */
.sidebar-product:hover .product-view-btn {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* Button hover effect */
.product-view-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-50%) translateX(0) scale(1.1);
}

/* Active product: button always visible */
.sidebar-product.active .product-view-btn {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

.sidebar-filters {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.sidebar-filters h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.sidebar-filters label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.sidebar-filters label:hover {
  color: var(--color-primary);
}

.sidebar-filters input[type="radio"] {
  cursor: pointer;
}

/* ============================================
   Chat Styles
   ============================================ */

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cormorant-avatar {
  font-size: 3rem;
  line-height: 1;
}

.chat-header-text h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

.chat-header-text .subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0 0;
}

.expand-btn {
  margin-left: auto;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-text-muted);
}

.expand-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
  transform: scale(1.05);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

/* Friendly Error Message */
.friendly-error {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.friendly-error-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.friendly-error-header i {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.friendly-error-header strong {
  font-size: 1rem;
  font-weight: 600;
}

.friendly-error-message {
  color: var(--color-text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.friendly-error-action {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.friendly-error-action:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message-user,
.message-assistant {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  align-items: flex-end;
}

.message-user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  max-width: 80%;
  line-height: 1.6;
}

.message-assistant .message-content {
  background: var(--color-bg-secondary);
  padding: 1rem 1.25rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  max-width: 90%;
  line-height: 1.6;
  color: var(--color-text);
}

.message-content p {
  margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
}

.message-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Monaco', 'Courier New', monospace;
}

.message-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.used-products {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.used-products .label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.product-chip {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.product-chip:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.timestamp {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.message-user .timestamp {
  text-align: right;
}

/* ============================================
   Quick Prompts (Empty State)
   ============================================ */

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.prompt-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.prompt-card i {
  font-size: 2rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.prompt-card-text h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.prompt-card-text p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ============================================
   Chat Input
   ============================================ */

.chat-input-container {
  padding: 1.5rem 0 0 0;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Powered by Claude Badge */
.powered-by-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.powered-by-badge i {
  font-size: 0.875rem;
}

.chat-input {
  position: relative;
  width: 100%;
  overflow: hidden; /* Prevent scrollbars from absolute positioned buttons */
}

.chat-input textarea {
  width: 100%;
  resize: none;
  border: 2px solid var(--color-border);
  border-radius: 1.5rem; /* More rounded for modern look */
  padding: 1rem 1.25rem;
  padding-right: 9.5rem; /* Make room for contact + voice + send buttons */
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  min-height: 55px; /* Ensure buttons always fit */
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll */
  transition: all 0.2s;
  box-sizing: border-box;
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input textarea::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Action buttons container (voice + send) */
.chat-input-actions {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  gap: 0.375rem;
  align-items: center;
  z-index: 1;
}

/* Contact button */
.contact-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.625rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
  transform: scale(1.05);
}

.contact-btn i {
  font-size: 1.25rem;
}

/* Voice button */
.voice-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.625rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
  transform: scale(1.05);
}

.voice-btn i {
  font-size: 1.25rem;
}

/* Send button - Icon only, circle on hover (hover-to-reveal pattern) */
.send-btn {
  background: transparent; /* No background by default */
  color: var(--color-primary);
  border: none;
  border-radius: 50%; /* Perfect circle */
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  background: var(--color-primary); /* Purple circle appears on hover */
  color: white;
  transform: scale(1.1); /* Slightly more prominent scale */
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.send-btn i {
  font-size: 1.125rem;
}

.chat-input button i {
  font-size: 1.25rem;
}

/* Context Indicator */
.context-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.context-indicator i {
  font-size: 0.875rem;
}

/* ============================================
   Typing Indicator
   ============================================ */

.typing-indicator {
  display: flex;
  gap: 0.375rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-secondary);
  border-radius: 1rem 1rem 1rem 0.25rem;
  width: fit-content;
}

.typing-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ============================================
   Message Actions
   ============================================ */

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.action-btn.github {
  border-color: #24292e;
  color: #24292e;
}

.action-btn.github:hover {
  background: #24292e;
  color: white;
}

.action-btn.stripe {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.action-btn.stripe:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 64px;
    left: -240px;
    bottom: 0;
    width: 240px;
    background: white;
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
  }

  .sidebar.open ~ .sidebar-overlay {
    display: block;
  }

  .chat-container {
    padding: 1rem;
  }

  .chat-header {
    padding-bottom: 1rem;
  }

  .cormorant-avatar {
    font-size: 2rem;
  }

  .chat-header-text h2 {
    font-size: 1.25rem;
  }

  .messages {
    padding: 1rem 0;
  }

  .message-user .message-content,
  .message-assistant .message-content {
    max-width: 100%;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .prompt-card {
    padding: 1rem;
  }

  .prompt-card i {
    font-size: 1.5rem;
  }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.messages::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Legal View
   ============================================ */

.legal-view {
  margin-left: 64px;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

.legal-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.legal-header {
  margin-bottom: 2rem;
}

.legal-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--color-text);
}

.legal-header .subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.legal-content {
  flex: 1;
  display: flex;
  gap: 2rem;
  overflow: hidden;
}

.legal-nav {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.legal-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.legal-tab.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.legal-tab i {
  font-size: 1.125rem;
}

.legal-document {
  flex: 1;
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.prose {
  max-width: none;
  line-height: 1.7;
}

.prose h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: var(--color-text);
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  color: var(--color-text);
}

.prose p {
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

.prose ul, .prose ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  color: var(--color-text);
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose strong {
  font-weight: 600;
  color: var(--color-text);
}

.prose a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.prose a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Code blocks (inline and fenced) */
.prose code {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 500;
}

.prose pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Blockquotes (callouts) */
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-light);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text);
}

.prose blockquote p {
  margin: 0;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.prose thead {
  background: var(--color-primary-light);
}

.prose th {
  color: var(--color-primary);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: var(--color-bg-secondary);
}

/* Horizontal rule */
.prose hr {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 2rem 0;
}

/* Improved list spacing */
.prose ul, .prose ol {
  margin: 1rem 0 1.5rem 0;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Emoji list items (special styling for icon lists) */
.prose li:has(> strong:first-child) {
  list-style: none;
  margin-left: -1.5rem;
  padding-left: 0;
}

.inline-link {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.inline-link:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   Expandable Executive Summary Header
   ============================================ */

.executive-summary-header-bar {
  border-bottom: 1px solid var(--color-border);
  background: white;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus mode - purple glow when expanded */
.executive-summary-header-bar.is-focused {
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  border-bottom-color: rgba(102, 126, 234, 0.2);
}

/* Focus overlay - dims everything below summary */
.executive-summary-focus-overlay {
  position: fixed;
  top: 60px; /* Below header */
  left: 64px; /* After dark sidebar */
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 5; /* Below summary (z-index: 10), above chat */
  cursor: pointer;
}

/* ============================================
   Toast Notification
   ============================================ */

.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  cursor: pointer;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  color: white;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
  font-size: 0.9375rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.toast-content i {
  font-size: 1.5rem;
}

/* ============================================
   Chat Expand/Focus Mode
   ============================================ */

.chat-expand-focus-overlay {
  position: fixed;
  top: 60px; /* Below header */
  left: 64px; /* After dark sidebar */
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 15; /* Below expanded chat, above everything else */
  cursor: pointer;
}

.chat-container.is-expanded {
  position: fixed;
  top: 60px; /* Below header */
  left: 64px; /* After dark sidebar */
  right: 0;
  bottom: 0;
  max-width: none;
  margin: 0;
  padding: 2rem 4rem;
  background: white;
  z-index: 20; /* Above overlay */
  box-shadow: var(--shadow-xl);
  border-radius: 0; /* Full screen, no border radius */
}

/* Expand button in chat header */
.expand-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.chat-header:hover .expand-btn {
  opacity: 1;
}

.expand-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.is-expanded .expand-btn {
  opacity: 1; /* Always visible when expanded */
}

.executive-summary-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.executive-summary-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.executive-summary-header-left i {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.executive-summary-header-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Info icon tooltip */
.executive-summary-info-icon {
  font-size: 0.875rem !important;
  opacity: 0.5;
  cursor: help;
  color: var(--color-text-muted) !important;
  transition: opacity 0.2s ease;
}

.executive-summary-info-icon:hover {
  opacity: 1;
  color: var(--color-primary) !important;
}

.executive-summary-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
}

.executive-summary-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reset-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.reset-chat-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.reset-chat-btn i {
  font-size: 1rem;
}

.summary-expand-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-primary);
  transition: all 0.2s;
  border-radius: 4px;
}

.summary-expand-btn:hover {
  background: var(--color-primary-light);
  transform: scale(1.05);
}

.executive-summary-expanded {
  padding: 1.5rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.summary-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-card h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-card h4 i {
  font-size: 0.875rem;
  color: var(--color-primary);
}

.summary-card-recommendation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
}

.summary-card-recommendation h4 {
  color: rgba(255, 255, 255, 0.9);
}

.summary-card-recommendation h4 i {
  color: white;
}

.learned-items-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.learned-item-compact {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.learned-item-compact i {
  color: var(--color-primary);
  font-size: 0.875rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.learned-item-compact strong {
  font-weight: 600;
  color: var(--color-text);
}

.learned-empty-compact {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.popular-items-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popular-item-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.popular-item-compact:hover {
  background: var(--color-primary-light);
  transform: translateX(2px);
}

.popular-icon {
  font-size: 1.125rem;
  margin-right: 0.5rem;
}

.popular-label {
  font-size: 0.8125rem;
  font-weight: 500;
  flex: 1;
}

.popular-views {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
}

.recommendation-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recommendation-product-compact {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.recommendation-reasoning-compact {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.recommendation-empty-compact {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  margin: 0;
}

/* ============================================
   Quick Prompts Sidebar (Right Column)
   ============================================ */

.quick-prompts-sidebar {
  grid-column: 3;
  grid-row: 2;
  background: white;
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quick-prompts-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-prompts-sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-prompts-sidebar-header h3 i {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.quick-prompts-sidebar-header p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.quick-prompts-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-prompt-card-sidebar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.quick-prompt-card-sidebar:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.quick-prompt-card-sidebar i {
  font-size: 2rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.quick-prompt-card-text-sidebar h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.quick-prompt-card-text-sidebar p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.quick-prompts-sidebar-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.quick-prompts-sidebar-hint i {
  font-size: 1rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Remove old executive summary styles */
.executive-summary-header {
  display: none;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-primary);
}

.executive-summary-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.executive-summary-header i {
  color: var(--color-primary);
  font-size: 1.25rem;
}

.collapse-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-muted);
  transition: all 0.2s;
  border-radius: 4px;
}

.collapse-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.summary-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-section h4 i {
  font-size: 0.875rem;
}

.learned-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.learned-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.5;
}

.learned-item i {
  color: var(--color-primary);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.learned-item strong {
  font-weight: 600;
  color: var(--color-text);
}

.learned-empty {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

.popular-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popular-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}

.popular-item:hover {
  background: var(--color-primary-light);
  transform: translateX(2px);
}

.popular-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.popular-item-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.popular-item-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.popular-item-views {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
}

.recommendation-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recommendation-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendation-card h4 i {
  font-size: 1rem;
}

.recommendation-product {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.recommendation-reasoning {
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.recommendation-empty {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  text-align: center;
}

/* Mobile: Hide Quick Prompts Sidebar on small screens */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 240px 1fr;
  }

  .quick-prompts-sidebar {
    display: none;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .executive-summary-header-content {
    padding: 0.75rem 1rem;
  }

  .executive-summary-header-title {
    font-size: 0.875rem;
  }

  .reset-chat-btn span {
    display: none;
  }

  .executive-summary-badge {
    display: none;
  }
}

/* ============================================
   Dynamic Contextual Pills
   ============================================ */

.contextual-pills-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.contextual-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Primary Pills (catalog, AI solutions, patterns) */
.pill-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

.pill-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Accent Pills (latest, featured) */
.pill-accent {
  background: #10b981;
  color: white;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.pill-accent:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

/* Secondary Pills (why cormorant) */
.pill-secondary {
  background: var(--color-secondary);
  color: white;
  box-shadow: 0 1px 3px rgba(118, 75, 162, 0.3);
}

.pill-secondary:hover {
  background: #6b3fa0;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(118, 75, 162, 0.4);
}

/* Outlined Pills (mcp, free, blueprints) */
.pill-outlined {
  background: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.pill-outlined:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* Subtle Pills (what's popular, browsing) */
.pill-subtle {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid transparent;
}

.pill-subtle:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
  transform: translateY(-1px);
}

/* More Pills (special styling) */
.pill-more {
  font-style: italic;
  opacity: 0.8;
}

.pill-more:hover {
  opacity: 1;
}

/* Contact Pill (maroon, permanent) */
.pill-contact {
  background: #8b2635;
  color: white;
  border: 1px solid #8b2635;
}

.pill-contact:hover {
  background: #6d1d2a;
  border-color: #6d1d2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 38, 53, 0.4);
}

.pill-contact i {
  color: white;
}

/* Pill Dropdown (Grok-style) */
.pill-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 0.5rem); /* Open upward */
  left: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 240px;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-section {
  padding: 0.5rem 0;
}

.dropdown-section:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.dropdown-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.5rem 1rem 0.25rem 1rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.dropdown-item i {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.dropdown-item:hover i {
  color: var(--color-primary);
}

/* Mobile Pills */
@media (max-width: 768px) {
  .contextual-pills-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contextual-pills {
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .pill {
    flex-shrink: 0;
  }
}

/* ============================================
   Product Detail Side Panel (Slide-In)
   ============================================ */

.product-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.product-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 100%;
  background: white;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  overflow: hidden;
}

/* Mobile: Full-width panel */
@media (max-width: 768px) {
  .product-detail-panel {
    width: 100%;
    left: 0;
  }
}

/* Document-First Styling */

/* Minimal header bar */
.document-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
  background: white;
}

.document-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.panel-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  color: var(--color-text-muted);
}

.panel-close-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.panel-close-btn i {
  font-size: 1.25rem;
}

/* Document body - reading optimized */
.document-body {
  flex: 1;
  overflow-y: auto;
  padding: 3rem;
  max-width: 65ch; /* Optimal reading width */
  margin: 0 auto;
  width: 100%;
}

/* Product title in document */
.product-doc-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--color-text);
  line-height: 1.3;
}

.product-doc-tagline {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

/* Metadata line (category · price · refund) */
.product-doc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.meta-item {
  text-transform: capitalize;
}

.meta-separator {
  color: var(--color-border);
}

.meta-refund {
  color: var(--color-success);
}

/* Document divider */
.document-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.panel-close-btn:active {
  transform: scale(0.95);
}

/* ============================================
   Inactivity Prompt Banner
   ============================================ */

.inactivity-banner {
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inactivity-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.inactivity-banner-content > i {
  font-size: 1.5rem;
  color: #d97706;
  flex-shrink: 0;
}

.inactivity-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.inactivity-banner-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #92400e;
}

.inactivity-banner-text span {
  font-size: 0.875rem;
  color: #78350f;
}

.inactivity-banner-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #d97706;
  transition: all 0.2s;
  border-radius: 4px;
  flex-shrink: 0;
}

.inactivity-banner-close:hover {
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.inactivity-banner-close i {
  font-size: 1.125rem;
}
