/* ====================================================================
   IP Radar — Patent Landscaping Page Styles
   Follows MolForge theme system (theme.css variables)
   ==================================================================== */

/* ================================================================
   V2.0 HERO — Full-width gradient banner with centered search
   ================================================================ */
.ip-hero {
  background: linear-gradient(160deg, #0a0e27 0%, #1a1045 40%, #0d1b3e 70%, #0a0e27 100%);
  padding: 7rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ip-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.08) 0%, transparent 70%),
              radial-gradient(ellipse at 20% 80%, rgba(124,58,237,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.ip-hero-inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.ip-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--primary, #00d4ff);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.ip-hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.ip-hero-subtitle {
  color: rgba(255,255,255,0.65);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 2rem;
}

/* Search bar */
.ip-search-bar {
  display: flex;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ip-search-bar:focus-within {
  border-color: var(--primary, #00d4ff);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.15);
}
.ip-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}
.ip-search-icon {
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.ip-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  padding: 1rem 0;
}
.ip-search-input::placeholder {
  color: rgba(255,255,255,0.35);
}
.ip-search-btn {
  padding: 0 2rem;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.ip-search-btn:hover { opacity: 0.9; }

/* Quick pills */
.ip-quick-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.ip-pill {
  all: unset;
  cursor: pointer;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s;
}
.ip-pill:hover {
  border-color: var(--primary, #00d4ff);
  color: var(--primary, #00d4ff);
  background: rgba(0,212,255,0.08);
}

/* Feature cards */
.ip-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.ip-feature-card {
  /* Theme-aware: theme.css --card-bg resolves to dark-navy in dark mode,
     near-white in light mode. No more hardcoded dark-only colors. */
  background: var(--card-bg, rgba(20, 24, 50, 0.95));
  border: 1.5px solid var(--card-border, rgba(255,255,255,0.12));
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.15);
}
.ip-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 16px 40px -8px rgba(0,212,255,0.25);
}
.ip-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,58,237,0.12));
  border: 1px solid rgba(0,212,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.3rem;
  color: var(--primary, #00d4ff);
}
.ip-feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  -webkit-text-fill-color: var(--text-primary, #fff);
  margin-bottom: 0.6rem;
}
.ip-feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  -webkit-text-fill-color: var(--text-secondary, rgba(255,255,255,0.6));
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 768px) {
  .ip-hero { padding: 5rem 1rem 3rem; }
  .ip-search-bar { flex-direction: column; border-radius: 12px; }
  .ip-search-btn { padding: 0.9rem; border-radius: 0 0 12px 12px; }
  .ip-features-grid { grid-template-columns: 1fr; }
  .ip-quick-pills { gap: 0.4rem; }
  .ip-pill { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
}

/* Light theme overrides */
:root.light-theme .ip-hero {
  background: linear-gradient(160deg, #f0f4f8 0%, #e8edf5 40%, #f0f4f8 100%);
}
:root.light-theme .ip-hero-title { color: #1a1f3e; }
:root.light-theme .ip-hero-subtitle { color: rgba(0,0,0,0.55); }
:root.light-theme .ip-search-bar {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
}
:root.light-theme .ip-search-input { color: #1a1f3e; }
:root.light-theme .ip-search-input::placeholder { color: rgba(0,0,0,0.35); }
:root.light-theme .ip-search-icon { color: rgba(0,0,0,0.3); }
:root.light-theme .ip-pill {
  border-color: rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.5);
}
:root.light-theme .ip-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0,212,255,0.06);
}

/* ================================================================
   LEGACY — keep old styles for results section
   ================================================================ */

/* --- OLD Page Header (replaced by ip-hero) --- */
.ip-radar-hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  display: none; /* hidden — replaced */
}

.ip-radar-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.ip-radar-hero .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Search Panel --- */
.radar-search-panel {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.radar-search-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--gradient);
}

.radar-search-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.radar-search-form .form-group {
  flex: 1;
  min-width: 250px;
}

.radar-search-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.radar-search-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.radar-search-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.radar-search-form input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.btn-radar-search {
  padding: 0.75rem 2rem;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-radar-search:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-radar-search:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quick-examples {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.quick-examples span {
  margin-right: 0.5rem;
}

.quick-example-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  color: var(--accent-primary);
  font-size: 0.78rem;
  cursor: pointer;
  margin: 0.25rem 0.25rem 0.25rem 0;
  transition: all 0.2s;
}

.quick-example-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* --- Results Layout --- */
.radar-results {
  display: none;
}

.radar-results.active {
  display: block;
}

/* --- Executive Summary Card --- */
.exec-summary-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.exec-summary-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.exec-summary-card h3 i {
  margin-right: 0.5rem;
}

.exec-summary-text {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.92rem;
}

.fto-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: var(--accent-primary);
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --- Charts Row --- */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.chart-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.chart-card h4 i {
  color: var(--accent-primary);
  margin-right: 0.5rem;
}

.chart-container {
  position: relative;
  height: 280px;
}

/* --- White Spaces Section --- */
.white-spaces-section {
  margin-bottom: 2rem;
}

.white-spaces-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.white-spaces-section h3 i {
  color: #10b981;
  margin-right: 0.5rem;
}

.white-space-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.ws-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.3s, border-color 0.3s;
}

.ws-card:hover {
  transform: translateY(-3px);
  border-color: #10b981;
}

.ws-card-domain {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  margin-bottom: 0.75rem;
}

.ws-card-desc {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.ws-card-rationale {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-style: italic;
}

.ws-confidence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.confidence-bar {
  flex: 1;
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* --- Patent Table --- */
.patents-table-section {
  margin-bottom: 2rem;
}

.patents-table-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.patents-table-section h3 i {
  color: var(--accent-secondary);
  margin-right: 0.5rem;
}

.patent-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.patents-table-wrap {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.patents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.patents-table thead {
  background: rgba(0, 212, 255, 0.05);
}

.patents-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--card-border);
}

.patents-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  vertical-align: top;
}

.patents-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.03);
}

.patents-table tbody tr:last-child td {
  border-bottom: none;
}

.patent-id-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}

.patent-id-link:hover {
  text-decoration: underline;
}

.category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.category-badge[data-cat="Core Synthesis"] { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.category-badge[data-cat="Formulation"] { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.category-badge[data-cat="Polymorphism"] { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.category-badge[data-cat="Delivery Method"] { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.category-badge[data-cat="Combination Therapy"] { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.category-badge[data-cat="Biomarker/Diagnostic"] { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.category-badge[data-cat="Other"] { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

.relevance-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.relevance-bar-track {
  width: 50px;
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}

.relevance-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.relevance-bar-fill.high { background: #10b981; }
.relevance-bar-fill.medium { background: #f59e0b; }
.relevance-bar-fill.low { background: #ef4444; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.active { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-badge.expired { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }
.status-badge.expiring { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* --- Disclaimer --- */
.radar-disclaimer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  border-top: 1px solid var(--card-border);
  margin-top: 2rem;
}

.radar-disclaimer i {
  color: var(--accent-primary);
  margin-right: 0.3rem;
}

/* --- AI Thought Process Console (Glass Box) --- */
.ai-console-section {
  margin-bottom: 1.5rem;
}

.ai-console-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 20, 10, 0.6);
  border: 1px solid rgba(0, 255, 128, 0.2);
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 1rem;
  color: rgba(0, 255, 128, 0.8);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.ai-console-toggle:hover {
  background: rgba(0, 20, 10, 0.8);
  border-color: rgba(0, 255, 128, 0.4);
}

.ai-console-toggle.collapsed {
  border-radius: 8px;
}

.ai-console-toggle #ai-console-chevron {
  margin-left: auto;
  transition: transform 0.3s;
}

.ai-console-toggle.collapsed #ai-console-chevron {
  transform: rotate(-90deg);
}

.ai-console {
  background: rgba(0, 8, 4, 0.92);
  border: 1px solid rgba(0, 255, 128, 0.15);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 300px;
}

.ai-console.collapsed {
  max-height: 0;
  border-width: 0 1px 0 1px;
}

.ai-console-content {
  padding: 0.75rem 1rem;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
}

.ai-console-content::-webkit-scrollbar {
  width: 5px;
}

.ai-console-content::-webkit-scrollbar-track {
  background: transparent;
}

.ai-console-content::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 128, 0.2);
  border-radius: 3px;
}

.ai-console-line {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.15rem;
}

.ai-console-line .timestamp {
  color: rgba(0, 255, 128, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.ai-console-line .message {
  color: rgba(0, 255, 128, 0.85);
}

.ai-console-line.event-synonyms .message {
  color: rgba(0, 212, 255, 0.9);
}

.ai-console-line.event-error .message {
  color: rgba(255, 80, 80, 0.9);
}

.ai-console-line.event-done .message {
  color: rgba(0, 255, 128, 1);
  font-weight: 600;
}

/* Light theme overrides */
.light-theme .ai-console-toggle {
  background: rgba(240, 248, 242, 0.95);
  border-color: rgba(0, 128, 64, 0.25);
  color: rgba(0, 100, 50, 0.8);
}

.light-theme .ai-console {
  background: rgba(245, 250, 246, 0.98);
  border-color: rgba(0, 128, 64, 0.15);
}

.light-theme .ai-console-line .timestamp {
  color: rgba(0, 100, 50, 0.4);
}

.light-theme .ai-console-line .message {
  color: rgba(0, 80, 40, 0.85);
}

.light-theme .ai-console-line.event-synonyms .message {
  color: rgba(0, 120, 180, 0.9);
}

.light-theme .ai-console-line.event-error .message {
  color: rgba(200, 40, 40, 0.9);
}

/* --- Loading State --- */
.radar-loading {
  display: none;
  text-align: center;
  padding: 4rem 1rem;
}

.radar-loading.active {
  display: block;
}

.radar-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: radarSpin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes radarSpin {
  to { transform: rotate(360deg); }
}

.radar-loading-steps {
  list-style: none;
  padding: 0;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}

.radar-loading-steps li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.radar-loading-steps li i {
  width: 18px;
  text-align: center;
}

.radar-loading-steps li.done i { color: #10b981; }
.radar-loading-steps li.active i { color: var(--accent-primary); animation: radarSpin 1s linear infinite; }
.radar-loading-steps li.pending { opacity: 0.4; }

/* --- Empty State --- */
.radar-empty {
  display: none;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.radar-empty.active {
  display: block;
}

.radar-empty i {
  font-size: 3rem;
  color: var(--card-border);
  margin-bottom: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ip-radar-hero h1 { font-size: 1.5rem; }
  .radar-search-form { flex-direction: column; }
  .charts-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .patents-table-wrap { overflow-x: auto; }
  .patents-table { min-width: 700px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   SCOPING MODAL — Agentic query clarification overlay
   ================================================================ */
.scope-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: scopeFadeIn 0.25s ease;
}

.scope-modal-overlay.active {
  display: flex;
}

@keyframes scopeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scope-modal {
  position: relative;
  background: var(--surface, #141830);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.08);
  animation: scopeSlideUp 0.3s ease;
}

@keyframes scopeSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close button */
.scope-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.scope-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #fff);
  border-color: rgba(255, 255, 255, 0.2);
}

/* AI Avatar */
.scope-modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

/* Speech bubble */
.scope-modal-bubble {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.scope-modal-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(0, 212, 255, 0.12);
}

.scope-modal-bubble p {
  color: var(--text-primary, #e8eaed);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

/* Drug info badge row */
.scope-modal-drug-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 1rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 10px;
  font-size: 0.82rem;
}

.scope-drug-name {
  font-weight: 700;
  color: var(--secondary, #7c3aed);
}

.scope-drug-synonyms {
  color: var(--text-secondary, rgba(255,255,255,0.5));
  font-style: italic;
}

.scope-drug-count {
  margin-left: auto;
  font-weight: 700;
  color: var(--primary, #00d4ff);
  white-space: nowrap;
}

/* Filter cards grid */
.scope-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.scope-filter-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.scope-filter-card:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.1);
}

.scope-filter-card:active {
  transform: translateY(0);
}

.scope-filter-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary, #00d4ff);
  font-size: 0.9rem;
}

.scope-filter-text h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #e8eaed);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.scope-filter-text p {
  font-size: 0.75rem;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  margin: 0;
  line-height: 1.4;
}

/* Custom input */
.scope-custom-input-wrap {
  margin-bottom: 1.25rem;
}

.scope-custom-input-wrap label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scope-custom-row {
  display: flex;
  gap: 0.5rem;
}

.scope-custom-input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary, #e8eaed);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.scope-custom-input:focus {
  outline: none;
  border-color: var(--primary, #00d4ff);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.scope-custom-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.scope-custom-btn {
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.scope-custom-btn:hover {
  opacity: 0.85;
}

/* Search All button */
.scope-search-all {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scope-search-all-btn {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255,255,255,0.45));
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color 0.2s;
  font-family: inherit;
}

.scope-search-all-btn:hover {
  color: var(--primary, #00d4ff);
}

/* Loading overlay within modal */
.scope-modal-loading {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 48, 0.92);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
}

.scope-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--primary, #00d4ff);
  border-radius: 50%;
  animation: radarSpin 0.8s linear infinite;
}

.scope-modal-loading p {
  color: var(--text-secondary, rgba(255,255,255,0.6));
  font-size: 0.88rem;
  margin: 0;
}

/* Responsive: single column on mobile */
@media (max-width: 600px) {
  .scope-modal {
    padding: 2rem 1.25rem 1.5rem;
    border-radius: 16px;
    max-height: 95vh;
  }

  .scope-filters-grid {
    grid-template-columns: 1fr;
  }

  .scope-modal-drug-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .scope-drug-count {
    margin-left: 0;
  }
}

/* Light theme overrides for scoping modal */
:root.light-theme .scope-modal {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

:root.light-theme .scope-modal-bubble {
  background: rgba(0, 120, 200, 0.04);
  border-color: rgba(0, 120, 200, 0.12);
}

:root.light-theme .scope-modal-bubble::before {
  border-bottom-color: rgba(0, 120, 200, 0.12);
}

:root.light-theme .scope-modal-bubble p {
  color: #1a1f3e;
}

:root.light-theme .scope-filter-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

:root.light-theme .scope-filter-card:hover {
  background: rgba(0, 120, 200, 0.04);
  border-color: rgba(0, 120, 200, 0.25);
}

:root.light-theme .scope-filter-text h4 {
  color: #1a1f3e;
}

:root.light-theme .scope-custom-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1f3e;
}

:root.light-theme .scope-custom-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

:root.light-theme .scope-modal-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.4);
}

:root.light-theme .scope-modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.7);
}

:root.light-theme .scope-modal-loading {
  background: rgba(255, 255, 255, 0.92);
}

:root.light-theme .scope-modal-drug-info {
  background: rgba(124, 58, 237, 0.05);
  border-color: rgba(124, 58, 237, 0.12);
}

/* ================================================================
   DEEP SCAN — Premium async patent analysis
   ================================================================ */

/* --- CTA Section --- */
.deep-scan-cta {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

.deep-scan-card {
  position: relative;
  background: var(--card-bg, #1a1f3e);
  border-radius: 16px;
  padding: 2rem 2rem 1.75rem;
  border: 2px solid transparent;
  background-clip: padding-box;
  overflow: hidden;
}

.deep-scan-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed), #f59e0b, var(--primary, #00d4ff));
  background-size: 300% 300%;
  animation: deepScanBorder 4s ease infinite;
  z-index: -1;
}

@keyframes deepScanBorder {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.deep-scan-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--card-bg, #1a1f3e);
  z-index: -1;
}

.deep-scan-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.deep-scan-header i {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.deep-scan-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #e8eaed);
  margin: 0;
}

.deep-scan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  white-space: nowrap;
}

.deep-scan-desc {
  color: var(--text-secondary, rgba(255,255,255,0.6));
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.deep-scan-desc span {
  font-weight: 700;
  color: var(--primary, #00d4ff);
}

/* Directive textarea */
.deep-scan-directive {
  margin-bottom: 1.25rem;
}

.deep-scan-directive label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deep-scan-directive textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary, #e8eaed);
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.deep-scan-directive textarea:focus {
  outline: none;
  border-color: var(--primary, #00d4ff);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.deep-scan-directive textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* Actions row */
.deep-scan-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.deep-scan-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.deep-scan-launch-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.35);
}

.deep-scan-launch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.deep-scan-time {
  font-size: 0.82rem;
  color: var(--text-secondary, rgba(255,255,255,0.45));
}

.deep-scan-time i {
  margin-right: 0.3rem;
}

/* --- Status Panel --- */
.deep-scan-status {
  margin-bottom: 2rem;
}

.deep-scan-status-card {
  background: var(--card-bg, #1a1f3e);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 16px;
  padding: 2rem;
}

.deep-scan-status-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.deep-scan-status-header i {
  font-size: 1.3rem;
  color: var(--primary, #00d4ff);
}

.deep-scan-status-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #e8eaed);
  margin: 0;
}

/* Progress bar */
.deep-scan-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.deep-scan-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--card-border, rgba(255,255,255,0.08));
  border-radius: 4px;
  overflow: hidden;
}

.deep-scan-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  transition: width 0.5s ease;
  position: relative;
}

.deep-scan-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: deepScanShimmer 1.5s infinite;
}

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

.deep-scan-progress-pct {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary, #00d4ff);
  min-width: 40px;
  text-align: right;
}

/* Steps */
.deep-scan-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.deep-scan-steps li {
  padding: 0.45rem 0;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.deep-scan-steps li i {
  width: 18px;
  text-align: center;
}

.deep-scan-steps li.done { color: var(--text-primary, #e8eaed); }
.deep-scan-steps li.done i { color: #10b981; }
.deep-scan-steps li.active i { color: var(--primary, #00d4ff); }
.deep-scan-steps li.pending { opacity: 0.4; }

/* Status actions */
.deep-scan-status-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border, rgba(255,255,255,0.08));
}

.deep-scan-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.deep-scan-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.deep-scan-elapsed {
  font-size: 0.82rem;
  color: var(--text-secondary, rgba(255,255,255,0.45));
  margin-left: auto;
}

/* --- Results Section --- */
.deep-scan-results {
  margin-bottom: 2rem;
}

.deep-scan-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.deep-scan-results-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.deep-scan-results-title i {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--primary, #00d4ff), var(--secondary, #7c3aed));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.deep-scan-results-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #e8eaed);
  margin: 0;
}

.deep-scan-download-btns {
  display: flex;
  gap: 0.5rem;
}

.deep-scan-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.deep-scan-dl-btn:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--primary, #00d4ff);
}

/* Executive summary */
.deep-scan-exec-summary {
  background: var(--card-bg, #1a1f3e);
  border: 1px solid var(--card-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.deep-scan-exec-summary h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary, #00d4ff);
  margin-bottom: 0.75rem;
}

.deep-scan-exec-summary h4 i {
  margin-right: 0.5rem;
}

.deep-scan-exec-text {
  color: var(--text-primary, #e8eaed);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Stats grid */
.deep-scan-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.deep-scan-stat {
  background: var(--card-bg, #1a1f3e);
  border: 1px solid var(--card-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.deep-scan-stat:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary, #00d4ff);
}

.deep-scan-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient, linear-gradient(135deg, #00d4ff, #7c3aed));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.deep-scan-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Directive alignment */
.deep-scan-directive-result {
  background: var(--card-bg, #1a1f3e);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.deep-scan-directive-result h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary, #7c3aed);
  margin-bottom: 0.75rem;
}

.deep-scan-directive-result h4 i {
  margin-right: 0.5rem;
}

.deep-scan-directive-text {
  color: var(--text-primary, #e8eaed);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Risk table */
.deep-scan-risk-table-section {
  margin-bottom: 1.5rem;
}

.deep-scan-risk-table-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #e8eaed);
  margin-bottom: 1rem;
}

.deep-scan-risk-table-section h4 i {
  color: #f59e0b;
  margin-right: 0.5rem;
}

.deep-scan-risk-table-wrap {
  background: var(--card-bg, #1a1f3e);
  border: 1px solid var(--card-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  overflow: hidden;
}

/* --- Deep Scan Responsive --- */
@media (max-width: 768px) {
  .deep-scan-card { padding: 1.5rem; }
  .deep-scan-actions { flex-direction: column; align-items: flex-start; }
  .deep-scan-results-header { flex-direction: column; align-items: flex-start; }
  .deep-scan-download-btns { width: 100%; }
  .deep-scan-dl-btn { flex: 1; justify-content: center; }
  .deep-scan-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .deep-scan-risk-table-wrap { overflow-x: auto; }
}

@media (max-width: 480px) {
  .deep-scan-stats-grid { grid-template-columns: 1fr; }
}

/* --- Deep Scan Light Theme --- */
:root.light-theme .deep-scan-card::after {
  background: #fff;
}

:root.light-theme .deep-scan-header h3 {
  color: #1a1f3e;
}

:root.light-theme .deep-scan-desc {
  color: rgba(0, 0, 0, 0.55);
}

:root.light-theme .deep-scan-directive textarea {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1f3e;
}

:root.light-theme .deep-scan-directive textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

:root.light-theme .deep-scan-status-card {
  background: #fff;
  border-color: rgba(0, 120, 200, 0.15);
}

:root.light-theme .deep-scan-exec-summary,
:root.light-theme .deep-scan-stat,
:root.light-theme .deep-scan-risk-table-wrap {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}

:root.light-theme .deep-scan-directive-result {
  background: #fff;
  border-color: rgba(124, 58, 237, 0.12);
}


/* ────────────────────────────────────────────────────────────────────
   Research-agent intelligence report
   ──────────────────────────────────────────────────────────────────── */
.research-report {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-primary, #e8eaf0);
  padding: 1.25rem;
  line-height: 1.55;
}
.research-report-title {
  font-size: 1.5rem;
  margin: 0 0 .5rem;
  font-weight: 700;
}
.research-report-brief {
  color: var(--text-secondary, #9ca3af);
  font-size: .95rem;
  margin: 0 0 1rem;
}
.research-exec-summary {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: 0 0 1.25rem;
}
.research-exec-summary p {
  margin: 0 0 .6rem;
}
.research-exec-summary p:last-child { margin: 0; }
.research-section {
  margin: 1.5rem 0;
}
.research-section h3 {
  font-size: 1.05rem;
  margin: 0 0 .7rem;
  font-weight: 600;
  color: var(--cyan, #00d4ff);
}
.research-section ul {
  margin: 0;
  padding-left: 1.2rem;
}
.research-section ul li {
  margin-bottom: .3rem;
}
.research-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.research-table th,
.research-table td {
  padding: .4rem .6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}
.research-table th {
  font-weight: 600;
  color: var(--text-secondary, #9ca3af);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .04em;
}
.research-bucket {
  margin: .4rem 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: .4rem .7rem;
}
.research-bucket summary {
  cursor: pointer;
  font-weight: 600;
  padding: .2rem 0;
}
.research-bucket .bucket-commentary {
  color: var(--text-secondary, #9ca3af);
  font-size: .88rem;
  margin: .3rem 0 .6rem;
  font-style: italic;
}
.research-bucket .patent-item {
  padding: .35rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: .9rem;
}
.research-bucket .patent-item:first-of-type { border-top: none; }
.patent-quant,
.patent-technique {
  color: var(--purple, #a78bfa);
  font-style: italic;
  font-size: .85rem;
}

/* ─── Recent IP scans panel ─── (refresh 2026-04-27 — page-matching light theme) */
.recent-jobs-section {
  max-width: 1000px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
  /* Card sits between hero/feature-cards and search results — bg=white,
     subtle shadow + border so it floats cleanly on the light page background
     instead of clashing with a dark slate panel. */
}
.recent-jobs-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}
.recent-jobs-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem;
}
.recent-jobs-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .7rem;
  background: none;
  border: 0;
  color: #0f1830;
  font: 600 1.02rem 'Inter', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background-color .12s ease;
}
.recent-jobs-toggle:hover { background: rgba(0, 122, 204, 0.05); }
.recent-jobs-toggle .fa-history { color: #2563eb; font-size: 0.95em; }
.recent-jobs-toggle .toggle-chevron {
  margin-left: auto;
  transition: transform .18s ease;
  opacity: .55;
  color: #475569;
  font-size: 0.78em;
}
.recent-jobs-toggle.open .toggle-chevron { transform: rotate(180deg); }
.recent-jobs-count {
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 500;
}
.recent-jobs-refresh {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s ease;
  font-size: 0.85em;
}
.recent-jobs-refresh:hover { color: #2563eb; border-color: rgba(37, 99, 235, 0.4); background: #eff6ff; }
.recent-jobs-refresh.spinning .fa-rotate { animation: rj-spin .8s linear infinite; }
@keyframes rj-spin { to { transform: rotate(360deg); } }

.recent-jobs-body {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.recent-jobs-empty {
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.92rem;
}
.recent-jobs-empty a { font-weight: 600; }

.recent-jobs-list {
  display: flex;
  flex-direction: column;
}

.recent-job-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 1.25rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  align-items: center;
  background: #ffffff;
  transition: background-color .12s ease;
}
.recent-job-row:last-child { border-bottom: 0; }
.recent-job-row:hover { background: #f8fafc; }

.rj-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .32rem;
}
.rj-row1 { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.rj-brief {
  color: #1b2230;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 640px;
}
.rj-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: #64748b;
}
.rj-meta strong { color: #1b2230; font-weight: 600; }

.rj-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.rj-status-pill[data-status="done"]            { color: #047857; background: #d1fae5; border-color: #a7f3d0; }
.rj-status-pill[data-status="error"]           { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.rj-status-pill[data-status="executing"],
.rj-status-pill[data-status="planning"],
.rj-status-pill[data-status="synthesizing"],
.rj-status-pill[data-status="fto_scoring"],
.rj-status-pill[data-status="prior_art_scan"]  { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.rj-status-pill[data-status="pending"]         { color: #6d28d9; background: #ede9fe; border-color: #ddd6fe; }
.rj-status-pill[data-status="stuck"]           { color: #b45309; background: #fef3c7; border-color: #fde68a; }

.rj-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rj-btn {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #1b2230;
  font: 500 0.8rem 'Inter', system-ui, sans-serif;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: all .12s ease;
  white-space: nowrap;
}
.rj-btn:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.rj-btn[disabled] { opacity: .4; cursor: not-allowed; }
.rj-btn--primary {
  border-color: #2563eb;
  color: #ffffff;
  background: #2563eb;
}
.rj-btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}
.rj-btn--warn {
  border-color: #f59e0b;
  color: #ffffff;
  background: #f59e0b;
}
.rj-btn--warn:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
}

@media (max-width: 720px) {
  .recent-job-row { grid-template-columns: 1fr; }
  .rj-actions { justify-content: flex-start; }
  .rj-brief { -webkit-line-clamp: 3; }
}
