/* d'Anconi AI Design System */
/* ========================= */

/* CSS Variables */
:root {
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #222222;
  --bg-elevated: #2a2a2a;
  --bg-hover: #333333;
  --accent: #C78663;
  --accent-hover: #d4976f;
  --accent-dim: rgba(199, 134, 99, 0.15);
  --accent-border: rgba(199, 134, 99, 0.3);
  --text-primary: #e8e8e8;
  --text-secondary: #999999;
  --text-muted: #666666;
  --text-inverse: #131313;
  --border: #333333;
  --border-light: #444444;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Source Serif 4', Georgia, serif;
  --transition: 0.2s ease;
  --max-width: 1200px;
  --header-height: 64px;
  --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; }
h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
ul, ol { list-style: none; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; align-items: center; }
.gap-sm { gap: 8px; }
.gap { gap: 16px; }
.gap-lg { gap: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Header / Navbar */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo img { width: 36px; height: 36px; border-radius: 8px; }
.header-logo span { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover { color: var(--text-primary); }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-accent { border-color: var(--accent-border); }
.card-accent:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(199, 134, 99, 0.1); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-icon {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--error); }
.form-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.checkbox-group { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-error { background: rgba(248, 113, 113, 0.15); color: var(--error); }
.badge-info { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-free { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-premium { background: var(--accent-dim); color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-secondary); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* Toast / Notifications */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Hero Section */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-owl {
  width: 520px;
  height: 610px;
  margin: 0 auto;
  background: url('/assets/owl_logo.png') center/contain no-repeat;
  position: relative;
  z-index: 1;
}
.hero::before {
  display: none;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 { font-size: 3.5rem; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.25rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Features Grid */
.features { padding: 80px 0; }
.features h2 { text-align: center; margin-bottom: 48px; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card { text-align: center; }
.feature-card h4 { margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* Pricing Section */
.pricing { padding: 80px 0; }
.pricing h2 { text-align: center; margin-bottom: 12px; }
.pricing-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 800px; margin: 0 auto; }
.pricing-card { padding: 32px; position: relative; }
.pricing-card.featured { border-color: var(--accent); }
.pricing-card.featured::before {
  content: '7-DAY FREE TRIAL';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--text-inverse);
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.pricing-price { font-size: 3rem; font-weight: 700; margin: 16px 0 8px; }
.pricing-price span { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.pricing-features { margin: 24px 0; }
.pricing-features li { padding: 8px 0; font-size: 0.9rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: '\2713'; color: var(--accent); font-weight: 700; }
.pricing-features li.disabled { opacity: 0.4; }
.pricing-features li.disabled::before { content: '\2717'; color: var(--text-muted); }
.api-pricing { text-align: center; margin-top: 32px; padding: 24px; background: var(--bg-secondary); border-radius: var(--radius); border: 1px solid var(--border); }
.api-pricing h4 { margin-bottom: 12px; }
.api-pricing-row { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.api-price-item { font-size: 0.9rem; color: var(--text-secondary); }
.api-price-item strong { color: var(--accent); }

/* Downloads Section */
.downloads { padding: 80px 0; text-align: center; }
.downloads h2 { margin-bottom: 12px; }
.downloads p { color: var(--text-secondary); margin-bottom: 40px; }
.downloads-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 800px; margin: 0 auto; }
.download-card { padding: 24px; text-align: center; cursor: pointer; }
.download-card:hover { border-color: var(--accent); }
.download-icon { font-size: 2rem; margin-bottom: 12px; }
.download-card h4 { margin-bottom: 4px; }
.download-card p { font-size: 0.8rem; color: var(--text-muted); }

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text-secondary); }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-nav { padding: 0 12px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.sidebar-item.active { background: var(--accent-dim); color: var(--accent); }
.sidebar-item .icon { width: 20px; text-align: center; }
.sidebar-section { padding: 8px 16px; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 16px; }
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: calc(100vh - var(--header-height));
}
.main-content h2 { margin-bottom: 24px; }

/* Chat UI */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - var(--header-height) - 160px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 16px; }
.chat-message { display: flex; gap: 12px; max-width: 80%; }
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.5;
}
.chat-message.user .chat-bubble { background: var(--accent); color: var(--text-inverse); border-bottom-right-radius: 4px; }
.chat-message.assistant .chat-bubble { background: var(--bg-tertiary); border-bottom-left-radius: 4px; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.chat-input-wrap {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  resize: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-counter { font-size: 0.8rem; color: var(--text-muted); padding: 4px 0; }
.chat-counter.warning { color: var(--warning); }
.chat-counter.limit { color: var(--error); }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Upgrade Banner */
.upgrade-banner {
  background: linear-gradient(135deg, var(--accent-dim), rgba(199, 134, 99, 0.05));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.upgrade-banner p { color: var(--text-secondary); font-size: 0.9rem; }
.upgrade-banner strong { color: var(--accent); }

/* Burns Status */
.burn-status { padding: 20px; }
.burn-indicator { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.burn-dot { width: 12px; height: 12px; border-radius: 50%; }
.burn-dot.active { background: var(--success); animation: pulse 2s infinite; }
.burn-dot.idle { background: var(--text-muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.burn-progress { width: 100%; height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.burn-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 1s ease; }

/* Conversation Sidebar — from danconi_dashboard.py */
.conv-sidebar { border-top: 1px solid var(--border); overflow-y: auto; max-height: 300px; }
.conv-list { overflow-y: auto; max-height: 240px; }
.conv-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; cursor: pointer; font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--accent-dim); border-left: 3px solid var(--accent); }
.conv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.conv-delete {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; padding: 0 4px; opacity: 0; transition: opacity var(--transition);
}
.conv-item:hover .conv-delete { opacity: 1; }
.conv-delete:hover { color: var(--error); }

/* Tool Call Output — from danconi_dashboard.py */
.tool-output { margin-top: 8px; border-radius: 8px; overflow: hidden; }
.tool-header { cursor: pointer; user-select: none; }
.tool-header:hover { opacity: 0.8; }
.tool-result { margin: 0; }

/* Typing Dots Animation */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* File Attachments — from danconi_dashboard.py */
.chat-attachments { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: 20px; padding: 4px 10px; font-size: 0.8rem; color: var(--accent);
}
.attachment-chip button {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 1rem; padding: 0; margin-left: 2px;
}
.attachment-chip button:hover { color: var(--error); }

/* Star Rating — from desktop/index.html */
.star-rating { display: flex; gap: 4px; }
.star-rating .star { transition: color 0.15s, transform 0.15s; }
.star-rating .star:hover { transform: scale(1.2); }

/* Feedback Category Buttons */
.feedback-cat { transition: all var(--transition); }
.feedback-cat.active { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }

/* Ad Slots */
.ad-slot {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot.sidebar-ad { margin: 16px 12px; }
.premium .ad-slot { display: none; }

/* Voice Controls */
.voice-controls { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.voice-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.voice-btn:hover { transform: scale(1.1); }
.voice-btn.recording { background: var(--error); animation: pulse 1s infinite; }

/* Image Upload */
.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.image-upload-zone:hover { border-color: var(--accent); background: var(--accent-dim); }
.image-upload-zone.dragover { border-color: var(--accent); background: var(--accent-dim); }
.image-preview { max-width: 100%; border-radius: var(--radius); margin-top: 16px; }
.image-results { margin-top: 24px; }

/* API Key Display */
.api-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.api-key-value { font-family: 'Courier New', monospace; font-size: 0.85rem; color: var(--text-secondary); }
.api-key-actions { display: flex; gap: 8px; }

/* Billing Card */
.billing-plan {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}
.billing-current { flex: 1; padding: 32px; }
.billing-current h3 { display: flex; align-items: center; gap: 12px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Loading Spinner */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(19, 19, 19, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Empty State */
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* Responsive */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .downloads-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); position: fixed; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
}
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1rem; }
  .hero-owl { width: 280px; height: 340px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .downloads-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 16px; }
  .container { padding: 0 16px; }
  .main-content { padding: 16px; }
  .hero { padding: 100px 0 60px; }
  .billing-plan { flex-direction: column; }
  .chat-message { max-width: 90%; }
  .upgrade-banner { flex-direction: column; gap: 12px; text-align: center; }
  .modal { margin: 16px; max-height: 90vh; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .downloads-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* Page transitions */
.page-enter { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reduced-motion { animation: none !important; transition: none !important; }

/* ─────────────────────────────────────────────────────────────────────
   Agent Indicator System
   Pulsing owl badge that surfaces when a specialist agent is active.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --agent-thinking:    #4A90D9;
  --agent-researching: #9B59B6;
  --agent-generating:  #E67E22;
  --agent-analyzing:   #27AE60;
  --agent-security:    #E74C3C;
}

/* Pulse keyframes — one per agent color so the glow tint matches */
@keyframes agent-pulse-thinking {
  0%, 100% { opacity: 0.6; transform: scale(0.95); box-shadow: 0 0 6px 2px rgba(74,144,217,0.25); }
  50%       { opacity: 1;   transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(74,144,217,0.5);  }
}
@keyframes agent-pulse-researching {
  0%, 100% { opacity: 0.6; transform: scale(0.95); box-shadow: 0 0 6px 2px rgba(155,89,182,0.25); }
  50%       { opacity: 1;   transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(155,89,182,0.5);  }
}
@keyframes agent-pulse-generating {
  0%, 100% { opacity: 0.6; transform: scale(0.95); box-shadow: 0 0 6px 2px rgba(230,126,34,0.25); }
  50%       { opacity: 1;   transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(230,126,34,0.5);  }
}
@keyframes agent-pulse-analyzing {
  0%, 100% { opacity: 0.6; transform: scale(0.95); box-shadow: 0 0 6px 2px rgba(39,174,96,0.25); }
  50%       { opacity: 1;   transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(39,174,96,0.5);  }
}
@keyframes agent-pulse-security {
  0%, 100% { opacity: 0.6; transform: scale(0.95); box-shadow: 0 0 6px 2px rgba(231,76,60,0.25); }
  50%       { opacity: 1;   transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(231,76,60,0.5);  }
}
@keyframes agent-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
@keyframes agent-status-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Base badge — the mini owl circle */
.agent-indicator {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agent-indicator img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* Color mode variants */
.agent-thinking {
  background: rgba(74,144,217,0.18);
  border: 1px solid rgba(74,144,217,0.4);
  animation: agent-pulse-thinking 1.5s ease-in-out infinite;
}
.agent-researching {
  background: rgba(155,89,182,0.18);
  border: 1px solid rgba(155,89,182,0.4);
  animation: agent-pulse-researching 1.5s ease-in-out infinite;
}
.agent-generating {
  background: rgba(230,126,34,0.18);
  border: 1px solid rgba(230,126,34,0.4);
  animation: agent-pulse-generating 1.5s ease-in-out infinite;
}
.agent-analyzing {
  background: rgba(39,174,96,0.18);
  border: 1px solid rgba(39,174,96,0.4);
  animation: agent-pulse-analyzing 1.5s ease-in-out infinite;
}
.agent-security {
  background: rgba(231,76,60,0.18);
  border: 1px solid rgba(231,76,60,0.4);
  animation: agent-pulse-security 1.5s ease-in-out infinite;
}

/* ── Chat area status bar ── */
.agent-status-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 0 10px 0;
  position: relative;
  overflow: hidden;
  animation: agent-status-in 0.25s ease;
}
.agent-status-bar.active { display: flex; }

/* Thin color accent stripe on the left */
.agent-status-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--agent-active-color, var(--accent));
  transition: background 0.3s ease;
}

.agent-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.agent-status-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}
.agent-status-message {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-status-message strong { font-weight: 600; }

/* Animated ellipsis */
.agent-dots span {
  display: inline-block;
  animation: agent-dot-blink 1.2s ease-in-out infinite;
}
.agent-dots span:nth-child(2) { animation-delay: 0.2s; }
.agent-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .agent-indicator,
  .agent-dots span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
