/* CTI-to-Hunt — professional security-tool UI with dark mode */
:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-table-header: #f1f5f9;
  --bg-table-zebra: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-light: #ccfbf1;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --kql-bg: #1e293b;
  --kql-text: #e2e8f0;
  --chip-bg: #e0f2fe;
  --chip-text: #0369a1;
  --confidence-high: #16a34a;
  --confidence-medium: #ca8a04;
  --confidence-low: #dc2626;
  --complexity-simple: #16a34a;
  --complexity-moderate: #ca8a04;
  --complexity-complex: #dc2626;
  --safety-safe: #16a34a;
  --safety-medium: #ca8a04;
  --safety-dangerous: #dc2626;
  --atomic-bg: #1e1e2e;
  --atomic-text: #cdd6f4;
}

/* Dark mode */
html.dark {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-table-header: #334155;
  --bg-table-zebra: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-light: rgba(20, 184, 166, 0.2);
  --error-bg: #450a0a;
  --error-text: #fca5a5;
  --kql-bg: #0f172a;
  --kql-text: #e2e8f0;
  --chip-bg: #1e3a5f;
  --chip-text: #7dd3fc;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-page);
  margin: 0;
  min-height: 100vh;
}

/* App Layout with Sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-section-title span:not(.sidebar-icon),
.sidebar.collapsed .sidebar-list,
.sidebar.collapsed .sidebar-stats,
.sidebar.collapsed .stat-highlight,
.sidebar.collapsed .action-label {
  display: none;
}

.sidebar.collapsed .sidebar-section {
  padding: 0.5rem;
}

.sidebar.collapsed .sidebar-section-title {
  justify-content: center;
  padding: 0.5rem;
}

.sidebar.collapsed .sidebar-action-btn {
  padding: 0.5rem;
  justify-content: center;
}

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

.sidebar-toggle {
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}

.sidebar-toggle:hover {
  background: var(--bg-table-zebra);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.sidebar-icon {
  font-size: 1rem;
}

/* Sidebar Stats */
.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-table-zebra);
  border-radius: var(--radius-sm);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-highlight {
  padding: 0.5rem;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.stat-highlight-label {
  color: var(--text-muted);
}

.stat-highlight-value {
  font-weight: 600;
  color: var(--accent);
  margin-left: 0.25rem;
}

/* Sidebar Lists */
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.sidebar-list-item {
  padding: 0.5rem 0.75rem;
  margin: 0 -0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-list-item:hover {
  background: var(--bg-table-zebra);
}

.sidebar-list-item.active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  margin-left: -3px;
}

.sidebar-list-item.active .sidebar-item-title {
  color: var(--accent);
}

.sidebar-item-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Sidebar Tags (for compact lists) */
.sidebar-list-compact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-tag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.sidebar-tag {
  font-size: 0.75rem;
  font-family: "Consolas", "Monaco", monospace;
  padding: 0.15rem 0.4rem;
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.sidebar-tag.mitre-link:hover {
  text-decoration: underline;
}

.sidebar-tag-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-table-zebra);
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
}

/* Sidebar Actions */
.sidebar-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.sidebar-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-table-zebra);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-action-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

html:not(.dark) .sidebar-action-btn .theme-icon-dark,
html.dark .sidebar-action-btn .theme-icon-light {
  display: none;
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  padding: 2rem 1.5rem;
  overflow-x: hidden;
}

/* Legacy .app class for backwards compatibility */
.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Responsive sidebar */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }
  
  .sidebar.expanded {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* Header */
.page-header {
  margin-bottom: 2rem;
  padding: 1.75rem 1.5rem 1.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.header-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.btn-theme-toggle {
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  background: var(--bg-table-zebra);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-theme-toggle:hover {
  background: var(--border);
}

html:not(.dark) .theme-icon-dark,
html.dark .theme-icon-light {
  display: none;
}

.header-title {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.header-tagline {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 52ch;
}

.header-tagline strong {
  color: var(--text);
  font-weight: 600;
}

/* Input card */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.input-card .form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.input-card input[type="url"] {
  flex: 1;
  min-width: 280px;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-card input[type="url"]::placeholder {
  color: var(--text-muted);
}

.input-card input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input-card .btn-run {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.input-card .btn-run:hover {
  background: var(--accent-hover);
}

.input-card .btn-run:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.clear-cache-row {
  margin: 1rem 0 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn-clear-cache {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}

.btn-clear-cache:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-clear-cache:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.clear-cache-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Error message */
.error-box {
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

html.dark .error-box {
  border-color: #7f1d1d;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.tab-badge-error {
  background: #ef4444 !important;
  color: #fff !important;
  font-weight: 700;
}

/* Cached result notice */
.cache-notice {
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: var(--bg-table-zebra);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* History notice */
.history-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.history-notice-icon {
  font-size: 1.125rem;
}

.history-notice-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.history-notice-link:hover {
  color: var(--accent-hover);
}

/* Export toolbar */
.export-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.export-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-export {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-export:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
}

.btn-export:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Result sections */
.result {
  margin-top: 0.5rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--bg-table-zebra);
  color: var(--text);
}

.tab-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-light);
}

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

.tab-btn.active:hover {
  background: var(--accent-hover);
}

.tab-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.tab-label {
  font-weight: 600;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

.tab-btn:not(.active) .tab-badge {
  background: var(--bg-table-header);
  color: var(--text-muted);
}

/* Tab Panels */
.tabs-content {
  min-height: 300px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

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

/* Responsive tabs */
@media (max-width: 640px) {
  .tabs-nav {
    flex-direction: column;
    gap: 0.25rem;
  }

  .tab-btn {
    justify-content: flex-start;
    padding: 0.6rem 1rem;
  }
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

/* Table wrapper for horizontal scroll */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tables */
.result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  font-size: 0.875rem;
}

.result-table th,
.result-table td {
  border: 1px solid var(--border);
}

.result-table thead {
  background: var(--bg-table-header);
}

.result-table th {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.result-table td {
  padding: 0.6rem 0.75rem;
  color: var(--text);
  vertical-align: top;
}

.result-table tbody tr:nth-child(even) {
  background: var(--bg-table-zebra);
}

.result-table tbody tr:hover {
  background: var(--accent-light);
}

/* Column widths for entries table */
.entries-table .col-num { width: 30px; text-align: center; }
.entries-table .col-mitre { min-width: 120px; }
.entries-table .col-chain { min-width: 150px; }
.entries-table .col-artifacts { min-width: 150px; }
.entries-table .col-evidence { min-width: 80px; }
.entries-table .col-refs { min-width: 150px; }

/* Confidence badges */
.confidence-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 9999px;
}

.confidence-high {
  background: rgba(22, 163, 74, 0.15);
  color: var(--confidence-high);
}

.confidence-medium {
  background: rgba(202, 138, 4, 0.15);
  color: var(--confidence-medium);
}

.confidence-low {
  background: rgba(220, 38, 38, 0.15);
  color: var(--confidence-low);
}

/* Complexity badges */
.complexity-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

.complexity-simple {
  background: rgba(22, 163, 74, 0.15);
  color: var(--complexity-simple);
}

.complexity-moderate {
  background: rgba(202, 138, 4, 0.15);
  color: var(--complexity-moderate);
}

.complexity-complex {
  background: rgba(220, 38, 38, 0.15);
  color: var(--complexity-complex);
}

/* Execution chain */
.exec-chain {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.8125rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-table-header);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Artifact chips */
.artifact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.artifact-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-family: "Consolas", "Monaco", monospace;
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 9999px;
  white-space: nowrap;
}

/* Evidence expandable */
.evidence-details {
  font-size: 0.8125rem;
}

.evidence-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
}

.evidence-details summary:hover {
  text-decoration: underline;
}

.evidence-text {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem;
  background: var(--bg-table-zebra);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Reference links */
.ref-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

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

/* KQL entry blocks */
.kql-entry-block {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.kql-entry-block:last-child {
  margin-bottom: 0;
}

.kql-entry-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kql-entry-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.kql-entry-meta {
  margin: 0 0 0.4rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.kql-entry-meta strong {
  color: var(--text);
}

/* KQL query container */
.kql-query-container {
  margin: 1rem 0;
}

.kql-query-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kql-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.btn-copy {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-copy:hover {
  background: var(--accent-light);
}

/* KQL code block */
.kql-block {
  font-family: "Consolas", "Monaco", "Ubuntu Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 1rem;
  margin: 0;
  background: var(--kql-bg);
  color: var(--kql-text);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.kql-empty {
  color: var(--text-muted);
}

/* KQL metadata grid */
.kql-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.kql-meta-item {
  padding: 0.6rem;
  background: var(--bg-table-zebra);
  border-radius: var(--radius-sm);
}

.kql-meta-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kql-meta-value {
  font-size: 0.8125rem;
  color: var(--text);
}

/* False positive notes */
.fp-notes {
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(202, 138, 4, 0.1);
  border-left: 3px solid var(--confidence-medium);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.fp-notes-label {
  font-weight: 600;
  color: var(--confidence-medium);
}

.fp-notes-text {
  color: var(--text);
  margin-left: 0.25rem;
}

/* Pivots section */
.pivots-section {
  margin-top: 1rem;
}

.pivots-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.pivots-list {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.pivots-list li {
  margin-bottom: 0.25rem;
  color: var(--text);
}

/* Key-value table (legacy) */
.result-table.kv-table th {
  width: 160px;
  text-transform: none;
  font-weight: 600;
  color: var(--text);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(4px);
}

html.dark .loading-overlay {
  background: rgba(15, 23, 42, 0.92);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-content {
  text-align: center;
  padding: 2rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem auto;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.9s linear infinite;
}

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

.loading-text {
  margin: 0 0 0.35rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.loading-subtext {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Footer */
.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.page-footer .footer-product {
  margin: 0 0 0.5rem 0;
  color: var(--text-muted);
}

.page-footer .footer-copyright {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
  .app {
    padding: 1.25rem 1rem;
  }

  .input-card .form {
    flex-direction: column;
    align-items: stretch;
  }

  .input-card input[type="url"] {
    min-width: 0;
  }

  .result-table {
    font-size: 0.8125rem;
  }

  .result-table th,
  .result-table td {
    padding: 0.5rem;
  }

  .kql-meta-grid {
    grid-template-columns: 1fr;
  }

  .kql-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .complexity-badge {
    margin-left: 0;
  }
}

/* Form options (checkbox row) */
.form-options {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.checkbox-text {
  font-weight: 500;
  color: var(--text);
}

.checkbox-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 1.5rem;
  margin-top: 0.25rem;
}

/* Atomic Tests Section */
.atomic-test-block {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.atomic-test-block:last-child {
  margin-bottom: 0;
}

.atomic-test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.atomic-test-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.atomic-test-badges {
  display: flex;
  gap: 0.5rem;
}

.safety-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 9999px;
}

.safety-safe {
  background: rgba(22, 163, 74, 0.15);
  color: var(--safety-safe);
}

.safety-medium {
  background: rgba(202, 138, 4, 0.15);
  color: var(--safety-medium);
}

.safety-dangerous {
  background: rgba(220, 38, 38, 0.15);
  color: var(--safety-dangerous);
}

.platform-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-table-header);
  color: var(--text-muted);
  border-radius: 9999px;
}

.atomic-test-meta {
  margin-bottom: 1rem;
}

.atomic-test-meta p {
  margin: 0.3rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.atomic-test-meta strong {
  color: var(--text);
}

.atomic-prerequisites {
  margin-bottom: 1rem;
}

.prereq-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.prereq-list {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.prereq-list li {
  margin-bottom: 0.25rem;
  color: var(--text);
}

/* Atomic command blocks */
.atomic-commands-container {
  margin: 1rem 0;
}

.atomic-commands-container.cleanup {
  margin-top: 0.75rem;
}

.atomic-commands-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.atomic-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.atomic-block {
  font-family: "Consolas", "Monaco", "Ubuntu Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 1rem;
  margin: 0;
  background: var(--atomic-bg);
  color: var(--atomic-text);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.cleanup-block {
  background: #2d2a36;
}

/* Safety notes */
.safety-notes {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(220, 38, 38, 0.1);
  border-left: 3px solid var(--safety-dangerous);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.safety-notes-label {
  font-weight: 600;
  color: var(--safety-dangerous);
}

.safety-notes-text {
  color: var(--text);
  margin-left: 0.25rem;
}

/* ============================================================================
   Phase 5A: Entry Review Controls
   ============================================================================ */
.entry-review-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.review-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.review-approve:hover { background: #dcfce7; border-color: #22c55e; color: #16a34a; }
.review-reject:hover { background: #fef2f2; border-color: #ef4444; color: #dc2626; }
html.dark .review-approve:hover { background: #14532d; }
html.dark .review-reject:hover { background: #450a0a; }

.review-status {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.review-approved { color: #16a34a; background: #dcfce7; }
.review-rejected { color: #dc2626; background: #fef2f2; }
html.dark .review-approved { background: #14532d; }
html.dark .review-rejected { background: #450a0a; }

tr.entry-approved { background: rgba(34, 197, 94, 0.05); }
tr.entry-rejected { opacity: 0.5; }

.col-status { width: 80px; }

/* MITRE validation warning */
.mitre-warn {
  color: #d97706;
  cursor: help;
}

/* ============================================================================
   KQL Validation Badges (Phase 4A)
   ============================================================================ */
.kql-validation-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kql-val-pass { background: #dcfce7; color: #16a34a; }
.kql-val-warn { background: #fef3c7; color: #d97706; }
.kql-val-fail { background: #fef2f2; color: #dc2626; }
.kql-val-unknown { background: var(--surface); color: var(--text-muted); }

html.dark .kql-val-pass { background: #14532d; color: #4ade80; }
html.dark .kql-val-warn { background: #451a03; color: #fbbf24; }
html.dark .kql-val-fail { background: #450a0a; color: #f87171; }

.kql-validation-details {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.kql-val-issue {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.kql-val-issue:last-child { border-bottom: none; }

.kql-val-issue-error .kql-val-icon { color: #dc2626; }
.kql-val-issue-warning .kql-val-icon { color: #d97706; }
.kql-val-issue-info .kql-val-icon { color: #3b82f6; }

.kql-val-msg { color: var(--text); }
.kql-val-suggestion {
  display: block;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 1.2rem;
  font-size: 0.75rem;
}

/* ============================================================================
   Phase 5B: Source Article View
   ============================================================================ */
.article-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.article-meta-item {
  background: var(--surface);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.article-meta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.article-meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.article-type-badge {
  color: var(--accent);
}

.source-section {
  margin: 1.25rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.source-section:last-child { border-bottom: none; }

.source-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.mitre-chip { cursor: pointer; text-decoration: none; }
.mitre-chip:hover { background: var(--accent); color: white; }
.path-chip { font-family: monospace; font-size: 0.75rem; }
.domain-chip { color: var(--accent); }
.cve-chip { text-decoration: none; }
.cve-chip:hover { background: #ef4444; color: white; }
.reg-chip { font-family: monospace; font-size: 0.75rem; }

.hash-type-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem;
}

.hash-value {
  font-family: monospace;
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--text-muted);
}

.article-text-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.article-text-block {
  font-family: "Georgia", serif;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1rem;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
  background: var(--surface);
}

.review-auto-fixed {
  color: #16a34a;
  font-style: italic;
  font-size: 0.85rem;
}

/* ============================================================================
   Correlations Tab
   ============================================================================ */
.correlation-summary {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

/* Threat landscape summary block */
.threat-landscape-block {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

/* Correlation type chips */
.corr-type-chip {
  font-weight: 600;
}

.corr-type-threat_actor { border-color: #ef4444; color: #ef4444; }
.corr-type-vulnerability { border-color: #f59e0b; color: #f59e0b; }
.corr-type-malware { border-color: #8b5cf6; color: #8b5cf6; }
.corr-type-technique { border-color: #3b82f6; color: #3b82f6; }
.corr-type-campaign { border-color: #10b981; color: #10b981; }
.corr-type-incident { border-color: #ec4899; color: #ec4899; }

html.dark .corr-type-threat_actor { color: #f87171; }
html.dark .corr-type-vulnerability { color: #fbbf24; }
html.dark .corr-type-malware { color: #a78bfa; }
html.dark .corr-type-technique { color: #60a5fa; }
html.dark .corr-type-campaign { color: #34d399; }
html.dark .corr-type-incident { color: #f472b6; }

.correlation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.correlation-item {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.correlation-item:hover {
  border-color: var(--accent);
}

/* Relevance left-border accent */
.corr-relevance-high { border-left: 3px solid #16a34a; }
.corr-relevance-medium { border-left: 3px solid #d97706; }
.corr-relevance-low { border-left: 3px solid #9ca3af; }

.correlation-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.correlation-url {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  flex: 1;
}

.correlation-url:hover { text-decoration: underline; }

.correlation-badges {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.correlation-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.corr-rel-high { background: #dcfce7; color: #16a34a; }
.corr-rel-medium { background: #fef3c7; color: #d97706; }
.corr-rel-low { background: #f3f4f6; color: #6b7280; }

html.dark .corr-rel-high { background: #14532d; color: #4ade80; }
html.dark .corr-rel-medium { background: #451a03; color: #fbbf24; }
html.dark .corr-rel-low { background: #1f2937; color: #9ca3af; }

.corr-type-badge {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.correlation-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.correlation-source {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.correlation-summary-text {
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.85;
}

/* Quality summary bar */
.quality-summary-bar, .correlation-summary-bar {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.quality-label, .correlation-icon {
  font-weight: 600;
  color: var(--text-muted);
}

.quality-score {
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.quality-high { background: #dcfce7; color: #16a34a; }
.quality-medium { background: #fef3c7; color: #d97706; }
.quality-low { background: #fef2f2; color: #dc2626; }
.quality-poor { background: #f3f4f6; color: #6b7280; }

html.dark .quality-high { background: #14532d; color: #4ade80; }
html.dark .quality-medium { background: #451a03; color: #fbbf24; }
html.dark .quality-low { background: #450a0a; color: #f87171; }

.quality-issues-details {
  margin-left: auto;
}

.quality-issues-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.quality-issues-list {
  font-size: 0.8rem;
  color: var(--text);
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.auto-fix-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

html.dark .auto-fix-badge {
  color: #4ade80;
  background: #14532d;
}

.auto-fix-list {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(22, 163, 74, 0.05);
  border-left: 3px solid #16a34a;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.auto-fix-list ul {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.auto-fix-item {
  color: #16a34a;
}

html.dark .auto-fix-item {
  color: #4ade80;
}

/* Style hints — less prominent than issues */
.quality-hints-details {
  margin-left: 0.5rem;
}

.quality-hints-toggle {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.quality-hints-toggle:hover {
  opacity: 1;
}

.quality-hints-list {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 1.5rem;
  margin-top: 0.35rem;
  list-style-type: "→ ";
}

/* Executive summary */
.executive-summary-block {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* Collapsible raw article text */
.article-text-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-text-toggle {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-text-toggle:hover {
  background: var(--hover);
}

.toggle-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.article-text-details[open] .article-text-container {
  border-top: 1px solid var(--border);
}

.quality-issues-list li { margin-bottom: 0.2rem; }

/* Navigator export button */
.btn-export-navigator {
  background: #7c3aed !important;
  color: white !important;
}

/* ============================================================================
   Coverage Gap Analysis (Phase 6B)
   ============================================================================ */
.coverage-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.coverage-pct {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  white-space: nowrap;
}

.coverage-text {
  font-size: 0.85rem;
  color: var(--text);
}

.coverage-subsection {
  font-size: 0.85rem;
  margin: 0.5rem 0 0.25rem;
}

.gap-chip {
  border: 1px dashed #d97706 !important;
  background: #fef3c7 !important;
  color: #92400e !important;
}

html.dark .gap-chip {
  background: #451a03 !important;
  color: #fbbf24 !important;
}

.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

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

.gap-severity {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
}

.gap-high .gap-severity { background: #fef2f2; color: #dc2626; }
.gap-medium .gap-severity { background: #fef3c7; color: #d97706; }
.gap-low .gap-severity { background: #f0f9ff; color: #3b82f6; }

html.dark .gap-high .gap-severity { background: #450a0a; }
html.dark .gap-medium .gap-severity { background: #451a03; }

.gap-desc { color: var(--text); }
