:root {
  --bg: #04070d;
  --bg-grid: rgba(0, 230, 118, 0.035);
  --surface: #0d1219;
  --surface-2: #121a24;
  --card-bg: #1a2535;
  --card-bg-top: #223040;
  --card-bg-hover: #283848;
  --card-border: rgba(0, 230, 118, 0.22);
  --card-border-hover: rgba(0, 230, 118, 0.42);
  --card-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(0, 230, 118, 0.08) inset,
    0 6px 18px rgba(0, 0, 0, 0.5);
  --card-shadow-hover:
    0 0 0 1px rgba(0, 230, 118, 0.1),
    0 1px 0 rgba(0, 230, 118, 0.12) inset,
    0 6px 20px rgba(0, 0, 0, 0.48);
  --border: #1e2a3a;
  --border-accent: rgba(0, 230, 118, 0.35);
  --text: #d4dce8;
  --muted: #7a8fa8;
  --accent: #00e676;
  --accent-dim: #00a152;
  --accent-glow: rgba(0, 230, 118, 0.15);
  --accent-hover: #33eb91;
  --brand-cyan: #00f5ff;
  --danger: #ff5252;
  --warn: #ffb74d;
  --nav-w: 220px;
  --nav-w-collapsed: 58px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  --heading-gradient: linear-gradient(90deg, #00f5ff 0%, #00ff88 100%);
  /* Overlay stack (low → high): assistant → modals → raised → nested → confirm */
  --z-assistant: 150;
  --z-modal: 200;
  --z-modal-raised: 210;
  --z-modal-nested: 220;
  --z-confirm: 300;
}

/* Gradient text — inline-block required for background-clip on spans */
.heading-gradient,
.nav-brand h1,
.page-header h2,
.metrics-panel-title,
.panel-title,
.modal h2,
.welcome-hero h2,
.history-label,
.intel-block-title,
.welcome-examples-label {
  display: inline-block;
  max-width: 100%;
  background-color: transparent;
  background-image: var(--heading-gradient);
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: none;
  text-shadow: none;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .heading-gradient,
  .nav-brand h1,
  .page-header h2,
  .metrics-panel-title,
  .panel-title,
  .modal h2,
  .welcome-hero h2,
  .history-label,
  .intel-block-title,
  .welcome-examples-label {
    background-image: none;
    -webkit-text-fill-color: currentColor;
    color: #00ff88;
    filter: none;
    text-shadow: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

.demo-mode-banner {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text);
}

.demo-mode-banner-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.demo-mode-banner-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-mode-banner-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.demo-mode-banner-exit:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.65);
}

.demo-mode-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  background: var(--accent);
  color: #041008;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.demo-mode-banner-cta:hover {
  background: var(--accent-hover);
}

body.has-demo-banner .workbench {
  height: calc(100vh - 2.65rem);
}

.demo-welcome-overlay {
  z-index: calc(var(--z-modal-raised) + 2);
}

body.demo-welcome-active {
  overflow: hidden;
}

.demo-welcome-modal {
  max-width: 520px;
  padding: 1.5rem 1.6rem 1.35rem;
  text-align: center;
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.demo-welcome-title {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.demo-welcome-subtitle {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.demo-welcome-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.demo-welcome-features {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  text-align: left;
}

.demo-welcome-features li {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.demo-welcome-features li:first-child {
  border-top: none;
  padding-top: 0;
}

.demo-welcome-features strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
  color: var(--text);
}

.demo-welcome-features span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.demo-welcome-footnote {
  margin: 0 0 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.demo-welcome-actions {
  display: flex;
  justify-content: center;
}

.demo-welcome-primary {
  padding: 0.65rem 1.35rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #041008;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.demo-welcome-primary:hover {
  background: var(--accent-hover);
}

.page-notice {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
  z-index: 0;
}

.workbench {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Global navigation */
.global-nav {
  flex: 0 0 var(--nav-w);
  width: var(--nav-w);
  min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  overflow: hidden;
  position: relative;
  transition:
    flex-basis 0.25s ease,
    width 0.25s ease,
    padding 0.25s ease,
    border-color 0.25s ease;
}

.workbench.nav-collapsed .global-nav {
  flex-basis: var(--nav-w-collapsed);
  width: var(--nav-w-collapsed);
  padding: 0.55rem 0.35rem 0.75rem;
  align-items: center;
  overflow: visible;
  z-index: 20;
}

.global-nav .nav-brand,
.global-nav .nav-links,
.global-nav .nav-help-btn,
.global-nav .nav-user,
.global-nav .nav-toggle {
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.nav-toggle {
  position: absolute;
  top: 0.65rem;
  right: 0.5rem;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}

.nav-toggle:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: rgba(0, 230, 118, 0.08);
}

.nav-toggle-icon {
  display: block;
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.nav-toggle-peek {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
}

.nav-toggle-peek:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.nav-toggle-peek[hidden] {
  display: none !important;
}

.nav-toggle-icon.peek {
  transform: rotate(-135deg);
  margin-left: -2px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem 1rem 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  min-width: 0;
}

.nav-brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  border-radius: 1px;
}

.nav-brand h1 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.nav-badge {
  display: block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.46rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 3px;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section {
  margin-bottom: 0.55rem;
}

.nav-section:last-child {
  margin-bottom: 0;
}

.nav-section-label {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.65;
  padding: 0.4rem 0.65rem 0.2rem;
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem 0.5rem 0.55rem;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border: none;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--text);
  background: rgba(0, 245, 255, 0.06);
  border-left-color: var(--brand-cyan);
  font-weight: 600;
}

.nav-item-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--muted);
  opacity: 0.85;
  transition: color 0.15s, opacity 0.15s;
}

.nav-link:hover .nav-item-icon {
  color: var(--text);
  opacity: 1;
}

.nav-link.active .nav-item-icon {
  color: var(--brand-cyan);
  opacity: 1;
}

.nav-link-label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  transition: opacity 0.15s ease, width 0.15s ease;
}

/* Collapsed icon rail */
.workbench.nav-collapsed .nav-brand {
  justify-content: center;
  padding: 0 0 0.45rem;
  margin-bottom: 0.35rem;
  border-bottom: none;
  width: 100%;
}

.workbench.nav-collapsed .nav-brand > div {
  display: flex;
  justify-content: center;
  width: 100%;
}

.workbench.nav-collapsed .nav-brand > div > div:first-child {
  justify-content: center;
}

.workbench.nav-collapsed .nav-brand h1,
.workbench.nav-collapsed .nav-badge,
.workbench.nav-collapsed .nav-section-label,
.workbench.nav-collapsed .nav-link-label,
.workbench.nav-collapsed .nav-help-label,
.workbench.nav-collapsed .nav-user {
  display: none;
}

.workbench.nav-collapsed .nav-toggle {
  position: static;
  margin: 0 auto 0.45rem;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  flex-shrink: 0;
}

.workbench.nav-collapsed .nav-toggle-icon {
  transform: rotate(-135deg);
  margin-left: -1px;
}

.workbench.nav-collapsed .nav-links {
  width: 100%;
  align-items: center;
  gap: 0.1rem;
  overflow: visible;
}

.workbench.nav-collapsed .nav-section {
  margin-bottom: 0.35rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workbench.nav-collapsed .nav-link {
  justify-content: center;
  width: 2.35rem;
  padding: 0.5rem;
  gap: 0;
  border-radius: 8px;
}

.workbench.nav-collapsed .nav-link.active {
  border-left: none;
  box-shadow: inset 3px 0 0 var(--brand-cyan);
  border-radius: 0 8px 8px 0;
}

.workbench.nav-collapsed .nav-item-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.workbench.nav-collapsed .nav-item-icon svg {
  width: 20px;
  height: 20px;
}

.workbench.nav-collapsed .nav-help-btn {
  justify-content: center;
  width: 2.35rem;
  padding: 0.5rem;
  margin: auto auto 0;
  border-radius: 8px;
}

.workbench.nav-collapsed .nav-help-icon {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0;
  border: none;
  background: transparent;
}

.workbench.nav-collapsed .nav-help-icon svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.workbench.nav-collapsed .nav-help-btn:hover .nav-help-icon svg {
  color: var(--text);
}

.workbench.nav-collapsed [data-nav-tooltip] {
  position: relative;
}

.workbench.nav-collapsed [data-nav-tooltip]:hover::after,
.workbench.nav-collapsed [data-nav-tooltip]:focus-visible::after {
  content: attr(data-nav-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  padding: 0.35rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--card-shadow);
}

.nav-help-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: auto;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-help-btn:hover {
  color: var(--text);
  border-color: var(--border-accent);
  background: rgba(0, 230, 118, 0.06);
}

.nav-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--accent);
}

.nav-help-icon svg {
  width: 18px;
  height: 18px;
}

.nav-help-label {
  font-weight: 500;
}

.layout-help-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.layout-help-btn:hover {
  color: var(--text);
  border-color: var(--border-accent);
}

.workbench:not(.nav-collapsed) .layout-help-btn {
  display: none;
}

.nav-user {
  margin-top: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-welcome {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout-btn {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-family: var(--font);
  cursor: pointer;
  box-sizing: border-box;
}

.nav-logout-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.mono-input {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.muted-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Main content */
.main-content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-pane {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.layout-chrome {
  flex: 0 0 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    padding 0.25s ease;
}

.workbench.nav-collapsed .layout-chrome {
  flex: 0 0 0;
  max-height: 0;
  opacity: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.layout-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.layout-body > .page-scroll,
.layout-body > .investigation-root {
  flex: 1 1 auto;
  min-height: 0;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

.page-scroll.dashboard-dense {
  padding: 0.55rem 0.75rem 0.65rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header-compact {
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.page-header h2 {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header-compact h2 {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.page-header p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.35rem;
}

.page-header-compact p {
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.dash-header-with-clock {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-header-main {
  min-width: 0;
}

.dash-clock-bar,
.theron-assistant-clock-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  white-space: nowrap;
}

.dash-clock-line,
.theron-assistant-clock-line {
  letter-spacing: 0.02em;
}

.dash-clock-sep,
.theron-assistant-clock-sep {
  color: var(--muted);
}

.theron-assistant-clock-bar {
  margin-top: 0.45rem;
}

.inv-open-modal {
  max-width: 420px;
}

.inv-open-modal-meta {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.inv-open-actions {
  flex-direction: column;
  align-items: stretch;
}

.inv-open-actions button {
  width: 100%;
}

/* Dense dashboard layout — fills viewport below header */
.dash-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 0.45rem;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 0;
  align-items: stretch;
}

.dash-module-summary {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
  flex-shrink: 0;
  line-height: 1.35;
}

.dash-module {
  --dash-module-accent: var(--brand-cyan);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(0, 230, 118, 0.08) inset,
    inset 3px 0 0 var(--dash-module-accent),
    0 6px 18px rgba(0, 0, 0, 0.5);
}

.dash-module--ioc {
  --dash-module-accent: var(--brand-cyan);
}

.dash-module--investigations {
  --dash-module-accent: #00e676;
}

.dash-module--escalations {
  --dash-module-accent: var(--warn);
}

.dash-module--handoff {
  --dash-module-accent: #b388ff;
}

.dash-module--threat-intel {
  --dash-module-accent: #64b5f6;
}

.dash-module--kev {
  --dash-module-accent: var(--danger);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.dash-module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--dash-module-accent);
}

.dash-module-icon svg {
  width: 16px;
  height: 16px;
}

.dash-module:hover {
  box-shadow:
    0 0 0 1px rgba(0, 230, 118, 0.1),
    0 1px 0 rgba(0, 230, 118, 0.12) inset,
    inset 3px 0 0 var(--dash-module-accent),
    0 6px 20px rgba(0, 0, 0, 0.48);
}

.dash-row > .panel-fill,
.dash-row > .panel-stack-fill {
  min-height: 0;
  align-self: stretch;
  height: 100%;
}

.dash-row .panel-body-fill {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Primary row: stacked modules beside IOC lookup */
.dash-row-primary .dash-primary-stack {
  gap: 0.45rem;
}

.dash-row-primary .dash-primary-stack > .dash-stack-panel {
  flex: 1 1 0;
  min-height: 0;
}

.dash-row-primary .dash-stack-panel .panel-body-fill {
  overflow: hidden;
}

.dash-row-primary .dash-stack-panel .compact-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.dash-row-primary .dash-stack-panel.panel-dense {
  padding: 0.35rem 0.45rem 0.4rem;
}

.dash-row-primary .dash-stack-panel .panel-head {
  margin-bottom: 0.2rem;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  flex-shrink: 0;
}

.stat-card,
.panel-dense,
.dashboard-dense .panel {
  position: relative;
  isolation: isolate;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 48%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.stat-card::before,
.panel-dense::before,
.dashboard-dense .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(0, 230, 118, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 230, 118, 0.015) 1px, transparent 1px);
  background-size: 100% 4px, 6px 100%;
}

.stat-card > *,
.panel-dense > * {
  position: relative;
  z-index: 1;
}

.panel-dense .panel-head .panel-title {
  z-index: 2;
}

.stat-card {
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 0;
}

.stat-card:hover,
.panel-dense:hover {
  background: linear-gradient(
    165deg,
    var(--card-bg-hover) 0%,
    #2a3a4e 50%,
    #1e2a3a 100%
  );
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.stat-card-accent {
  border-color: rgba(0, 230, 118, 0.28);
  background: linear-gradient(
    155deg,
    rgba(0, 230, 118, 0.1) 0%,
    var(--card-bg) 42%,
    #141e2c 100%
  );
}

.stat-card-accent:hover {
  border-color: rgba(0, 230, 118, 0.45);
  box-shadow:
    0 0 12px rgba(0, 230, 118, 0.08),
    var(--card-shadow-hover);
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}

.stat-link,
.stat-hint {
  font-size: 0.62rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
}

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

.panel-fill {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.panel-stack-fill {
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 200px;
}

.panel-dense {
  min-height: 0;
  padding: 0.45rem 0.55rem;
}

.panel-dense:not(.panel-fill) {
  display: block;
  height: auto;
}

/* Inset wells inside elevated dashboard cards */
.dashboard-dense .ti-card,
.dashboard-dense .compact-row,
.dashboard-dense .rule-card-compact,
.dashboard-dense .ioc-results,
.dashboard-dense .rules-editor-compact {
  background: rgba(4, 7, 13, 0.55);
  border: 1px solid rgba(30, 42, 58, 0.95);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dashboard-dense .ti-card:hover {
  background: rgba(9, 14, 22, 0.85);
  border-color: var(--card-border-hover);
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.06);
  transform: translateY(-1px);
}

.dashboard-dense .compact-row:hover,
.dashboard-dense .rule-card-compact:hover {
  background: rgba(10, 16, 24, 0.9);
  border-color: rgba(0, 230, 118, 0.22);
}

.dashboard-dense .report-row:hover {
  border-color: rgba(0, 230, 118, 0.25);
}

/* Dashboard reference feeds — compact list-style entries */
.dashboard-dense .ti-feed,
.dashboard-dense .kev-feed {
  gap: 0.15rem;
}

.dashboard-dense .ti-card {
  padding: 0.2rem 0.32rem;
}

.dashboard-dense .ti-card-head {
  margin-bottom: 0.12rem;
  gap: 0.35rem;
}

.dashboard-dense .ti-source,
.dashboard-dense .ti-date {
  font-size: 0.54rem;
}

.dashboard-dense .ti-card h3 {
  font-size: 0.68rem;
  line-height: 1.2;
}

.dashboard-dense .ti-card:hover {
  transform: none;
}

.dashboard-dense .kev-row {
  padding: 0.18rem 0.32rem;
}

.dashboard-dense .kev-top {
  margin-bottom: 0.08rem;
  gap: 0.28rem;
}

.dashboard-dense .kev-cve {
  font-size: 0.62rem;
}

.dashboard-dense .kev-pub {
  font-size: 0.54rem;
}

.dashboard-dense .kev-headline {
  font-size: 0.65rem;
  line-height: 1.25;
}

/* Dashboard module entries — compact, information-dense */
.dashboard-dense .compact-list {
  gap: 0.18rem;
}

.dashboard-dense .compact-row-wrap {
  gap: 0.18rem;
}

.dashboard-dense .compact-row.compact-row-btn {
  padding: 0.22rem 0.32rem;
  gap: 0.32rem;
  border-radius: 4px;
}

.dashboard-dense .compact-row-title {
  font-size: 0.72rem;
  line-height: 1.25;
}

.dashboard-dense .compact-row-meta {
  font-size: 0.58rem;
  line-height: 1.2;
}

.dashboard-dense .compact-row-close {
  padding: 0.14rem 0.3rem;
  font-size: 0.54rem;
}

.dashboard-dense .report-row .severity-pill,
.dashboard-dense .compact-row .handoff-priority-pill {
  font-size: 0.54rem;
  padding: 0.05rem 0.22rem;
  border-radius: 3px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.panel-dense .panel-head {
  margin-bottom: 0.3rem;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.panel-body {
  display: block;
  overflow: visible;
}

.panel-body-fill {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-body-static.panel-body-fill {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.panel-body-static.panel-body-fill .ioc-recent-lookups {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.dashboard-dense .rules-list-compact,
.dashboard-dense .compact-list {
  min-height: 0;
}

/* Reference row: Threat Intelligence + CISA KEV fill row height equally */
.dash-row-reference .panel-body-feed {
  display: flex;
  flex-direction: column;
}

.dash-row-reference .panel-body-feed > .feed-panel-scroll {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Default: exactly five entries fill the feed panel evenly */
.dash-row-reference .panel-body-feed > .feed-panel-scroll:not(.feed-expanded) {
  overflow-y: hidden;
}

.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .ti-card,
.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .ti-card-static,
.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .kev-row {
  flex: 1 1 0;
  min-height: 0;
}

.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .ti-card,
.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .ti-card-static,
.dash-row-reference .feed-panel-scroll:not(.feed-expanded) > .kev-row {
  justify-content: center;
}

.feed-panel-scroll.feed-expanded {
  justify-content: flex-start;
}

.feed-panel-scroll.feed-expanded > .ti-card,
.feed-panel-scroll.feed-expanded > .ti-card-static,
.feed-panel-scroll.feed-expanded > .kev-row {
  flex: 0 0 auto;
}

.dash-row-reference .panel-body-feed > .feed-panel-actions {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.feed-panel-scroll:not(.feed-expanded) .feed-item-extra {
  display: none;
}

.feed-show-more-btn {
  width: 100%;
  padding: 0.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.feed-show-more-btn:hover {
  background: rgba(0, 230, 118, 0.08);
  border-color: var(--border-accent);
}

.feed-panel-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 230, 118, 0.22) transparent;
}

.feed-panel-scroll::-webkit-scrollbar {
  width: 5px;
}

.feed-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 230, 118, 0.2);
  border-radius: 3px;
}

.feed-panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-dense .panel-title {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.panel-dense .panel-action {
  font-size: 0.65rem;
}

.panel-action {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
}

.panel-action:hover { text-decoration: underline; }

.panel-head-btn {
  padding: 0.22rem 0.5rem;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #041008;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
}

a.panel-head-btn {
  display: inline-block;
  text-decoration: none;
}

.panel-head-btn:hover {
  background: var(--accent-hover);
}

.empty-panel {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.compact-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  min-width: 0;
}

.compact-row-wrap .compact-row {
  flex: 1;
  min-width: 0;
}

.compact-row-close {
  flex-shrink: 0;
  align-self: center;
  padding: 0.2rem 0.45rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.compact-row-close:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--card-border-hover);
  background: rgba(4, 7, 13, 0.45);
}

.compact-row-close:disabled {
  opacity: 0.5;
  cursor: wait;
}

.compact-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  font-size: 0.75rem;
}

.compact-row-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.compact-row-meta {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  flex-shrink: 0;
}

.report-row .severity-pill,
.compact-row .handoff-priority-pill {
  font-size: 0.58rem;
  padding: 0.1rem 0.3rem;
}

/* IOC Lookup */
.ioc-lookup-form {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0;
}

.ioc-lookup-form input {
  flex: 1;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.ioc-lookup-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ioc-results {
  margin-top: 0.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 4px;
}

.ioc-results[hidden],
.ioc-error[hidden] {
  display: none !important;
}

.ioc-results-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.ioc-type-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-accent);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.08);
}

.ioc-value-display {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
}

.ioc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ioc-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ioc-link-btn:hover {
  border-color: var(--border-accent);
  background: rgba(0, 230, 118, 0.1);
  color: var(--accent);
}

.ioc-osint-results {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ioc-osint-results[hidden] {
  display: none !important;
}

.ioc-osint-loading,
.ioc-osint-fallback {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.ioc-osint-card {
  padding: 0.45rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.45);
}

.ioc-osint-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(30, 42, 58, 0.8);
}

.ioc-osint-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

.ioc-osint-verdict {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.ioc-osint-verdict.good {
  color: var(--accent);
  border-color: rgba(0, 230, 118, 0.35);
  background: rgba(0, 230, 118, 0.08);
}

.ioc-osint-verdict.warn {
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.08);
}

.ioc-osint-verdict.bad {
  color: var(--danger);
  border-color: rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.08);
}

.ioc-osint-verdict.neutral {
  color: var(--muted);
}

.ioc-osint-field {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.ioc-osint-field-label {
  color: var(--muted);
}

.ioc-osint-field-value {
  color: var(--text);
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.ioc-osint-indicators {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  font-size: 0.68rem;
  color: var(--text);
  line-height: 1.35;
}

.ioc-osint-indicators li {
  margin-bottom: 0.15rem;
}

.ioc-osint-message {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.ioc-osint-screenshot-link {
  display: block;
  margin-top: 0.35rem;
}

.ioc-osint-screenshot {
  display: block;
  max-width: 100%;
  max-height: 140px;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: top;
}

.ioc-osint-open {
  margin-top: 0.35rem;
}

.ioc-lookup-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

body.ioc-modal-open {
  overflow: hidden;
}

.ioc-lookup-overlay {
  z-index: var(--z-modal-raised);
  padding: 1.25rem;
  backdrop-filter: blur(2px);
}

.ioc-lookup-modal {
  position: relative;
  max-width: min(920px, 96vw);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.ioc-lookup-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 3.75rem 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.65);
  flex-shrink: 0;
}

.ioc-lookup-modal-header h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ioc-lookup-modal-ioc {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.ioc-lookup-modal-value {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  min-width: 0;
  flex: 1;
}

.ioc-lookup-modal-ioc .ioc-type-badge {
  flex-shrink: 0;
}

.ioc-lookup-modal-value.ioc-value-hash {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ioc-lookup-modal-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.1rem 1.25rem 1.25rem;
}

.ioc-training-sim-banner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.875rem;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.ioc-training-sim-banner[hidden] {
  display: none !important;
}

.ioc-training-sim-banner strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fbbf24;
}

.ioc-lookup-modal-error {
  margin: 0;
  padding: 0 1.25rem 1rem;
}

.ioc-osint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
  overflow-x: hidden;
  min-width: 0;
}

.ioc-lookup-modal .ioc-osint-card {
  padding: 0.85rem 0.95rem;
  border-radius: 8px;
  background: rgba(4, 7, 13, 0.55);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ioc-lookup-modal .ioc-osint-card-head {
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
}

.ioc-lookup-modal .ioc-osint-name {
  font-size: 0.82rem;
}

.ioc-lookup-modal .ioc-osint-verdict {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
}

.ioc-lookup-modal .ioc-osint-field {
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.ioc-lookup-modal .ioc-osint-field-value {
  font-size: 0.76rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ioc-osint-not-found-msg {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.ioc-lookup-modal .ioc-osint-card.ioc-osint-not_found .ioc-osint-open {
  margin-top: auto;
}

.ioc-lookup-modal .ioc-osint-indicators {
  font-size: 0.76rem;
  margin-top: 0.45rem;
}

.ioc-lookup-modal .ioc-osint-message {
  font-size: 0.78rem;
}

.ioc-lookup-modal .ioc-osint-screenshot {
  max-height: 180px;
  width: 100%;
  object-fit: cover;
  object-position: top;
}

.ioc-lookup-modal .ioc-osint-open {
  margin-top: auto;
  padding-top: 0.55rem;
}

.ioc-osint-pending-note {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.08);
}

.ioc-osint-pending-lead {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.ioc-osint-pending-time {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.ioc-osint-pending-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

.ioc-osint-open-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.5rem 0.85rem !important;
  background: var(--accent) !important;
  border: none !important;
  border-radius: 6px !important;
  color: #041008 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  text-decoration: none;
}

.ioc-osint-open-primary:hover {
  background: var(--accent-hover) !important;
  color: #041008 !important;
}

.ioc-lookup-modal-links-section {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.ioc-lookup-modal-links-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ioc-lookup-modal .ioc-links {
  gap: 0.55rem;
  flex-wrap: wrap;
  overflow-x: hidden;
  min-width: 0;
}

.ioc-lookup-modal .ioc-link-btn {
  font-size: 0.72rem;
  padding: 0.38rem 0.65rem;
}

.ioc-lookup-modal .ioc-osint-loading,
.ioc-lookup-modal .ioc-osint-fallback {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

.ioc-error {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--danger);
}

.ioc-input-clear {
  flex: 0 0 auto;
  padding: 0.38rem 0.55rem;
  font-size: 0.68rem;
}

.ioc-recent-lookups {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.ioc-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ioc-recent-clear-all {
  padding: 0.18rem 0.45rem;
  font-size: 0.62rem;
}

.ioc-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ioc-recent-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ioc-recent-lookups[hidden] {
  display: none !important;
}

.ioc-recent-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ioc-recent-row .ioc-recent-chip {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.ioc-recent-chip {
  padding: 0.22rem 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.ioc-recent-chip:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

/* Threat intelligence feed */
.ti-feed {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
}

.ti-card {
  flex: 0 0 auto;
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

.dash-row-reference .ti-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.ti-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.ti-source {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--accent);
}

.ti-date {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
}

.ti-card h3 {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kev-feed {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
}

.kev-row {
  flex: 0 0 auto;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.dash-row-reference .kev-feed {
  justify-content: flex-start;
}

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

.kev-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.kev-cve {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.kev-pub {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
}

.kev-headline {
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.investigation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.investigation-row a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.investigation-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  flex-shrink: 0;
}

.threat-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

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

.threat-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.threat-cve {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.threat-cve:hover { text-decoration: underline; }

.threat-publisher {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.threat-headline {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.threat-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.threat-meta {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--mono);
}


/* Reports page */
.reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.reports-toolbar input,
.reports-toolbar select {
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.reports-toolbar input { flex: 1; min-width: 160px; }

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.report-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.report-card:hover { border-color: var(--border-accent); }

.severity-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.severity-pill.low { background: rgba(79, 195, 247, 0.15); color: #4fc3f7; }
.severity-pill.medium { background: rgba(255, 183, 77, 0.15); color: var(--warn); }
.severity-pill.high { background: rgba(255, 138, 101, 0.15); color: #ff8a65; }
.severity-pill.critical { background: rgba(255, 82, 82, 0.15); color: var(--danger); }

.report-card-body { flex: 1; min-width: 0; }
.report-card-case {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.report-card-title { font-weight: 600; font-size: 0.9rem; }
.report-card-date { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }

.reports-editor {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
}

.reports-editor[hidden] { display: none; }

.reports-editor input,
.reports-editor select,
.reports-editor textarea {
  width: 100%;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.reports-editor textarea {
  min-height: 280px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  resize: vertical;
}

.editor-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Query library */
.rules-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
  flex-shrink: 0;
}

.query-library-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.query-library-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  width: 100%;
}

.query-library-toolbar input[type="search"] {
  flex: 1;
  min-width: 12rem;
}

.query-library-toolbar select {
  min-width: 10rem;
}

.query-library-list,
.query-library-page .rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: none;
  max-height: none;
  overflow-y: visible;
}

.query-library-page .rule-card {
  width: 100%;
  box-sizing: border-box;
}

.query-library-page .rules-editor {
  margin-top: 0.5rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.rules-toolbar input,
.rules-toolbar select {
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.rules-toolbar input {
  flex: 1;
  min-width: 180px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.rules-list-compact {
  gap: 0.3rem;
  max-height: none;
}

.rule-card-compact {
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}

.rule-card-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.rule-card-compact .rule-card-title {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rules-editor-compact {
  margin-top: 0.35rem;
  padding: 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.rules-editor-compact textarea {
  min-height: 72px;
  font-size: 0.72rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.list-more {
  font-size: 0.62rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
  font-family: var(--mono);
}

.list-more a {
  color: var(--accent);
}

.rule-card {
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.rule-card-meta {
  flex: 1;
  min-width: 0;
}

.rule-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.rule-card-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.rule-platform {
  color: var(--accent);
  font-weight: 600;
}

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.rule-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}

.rule-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.rule-content-preview {
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

.rules-editor {
  margin-top: 0.85rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rules-editor[hidden] {
  display: none !important;
}

.rules-editor textarea {
  min-height: 160px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  resize: vertical;
}

button, .btn {
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #041008;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled), .btn:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary, .btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover:not(:disabled) { background: var(--surface-2); }

button.danger { background: var(--danger); color: #fff; }

/* Uniform × close buttons — flex-centered glyph in a square control */
button.theron-x-close {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 0;
  font-weight: 400;
  line-height: 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

button.theron-x-close .theron-x-close-glyph {
  display: block;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
}

button.theron-x-close:hover:not(:disabled) {
  border-color: var(--border-accent);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.12);
}

button.theron-x-close--overlay {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
}

button.theron-x-close--compact {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 6px;
}

button.theron-x-close--compact .theron-x-close-glyph {
  font-size: 1.25rem;
}

button.theron-x-close--compact.theron-x-close--overlay {
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
}

button.theron-x-close--inline {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border-radius: 4px;
  background: transparent;
}

button.theron-x-close--inline .theron-x-close-glyph {
  font-size: 0.95rem;
}

button.theron-x-close--inline:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 82, 82, 0.08);
}

.form-field { margin-bottom: 0.85rem; }
.form-field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
}

.experience-level-field {
  border: none;
  padding: 0;
  margin-bottom: 0.85rem;
}

.experience-level-field legend {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.experience-level-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.experience-level-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.experience-level-option {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.experience-level-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(0, 230, 118, 0.06);
}

.experience-level-option:hover {
  border-color: var(--border-accent);
}

.experience-level-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.experience-level-option-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.experience-level-option-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.status { font-size: 0.85rem; color: var(--muted); }
.status.error { color: var(--danger); }

@media (max-width: 1100px) {
  .page-scroll.dashboard-dense {
    overflow-y: auto;
  }

  .dash-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .dash-layout {
    grid-template-rows: auto minmax(18rem, auto) minmax(14rem, auto);
    overflow-y: auto;
  }

  .dash-row {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

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

button.nav-toggle,
button.nav-toggle-peek {
  padding: 0;
  font-weight: 400;
}

button.nav-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

button.nav-toggle:hover {
  background: rgba(0, 230, 118, 0.08);
  color: var(--accent);
  border-color: var(--border-accent);
}

button.nav-toggle-peek {
  background: var(--surface);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}

button.nav-toggle-peek:hover {
  background: var(--surface-2);
}

button.feed-show-more-btn {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

button.feed-show-more-btn:hover {
  background: rgba(0, 230, 118, 0.08);
}

button.ioc-submit {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

button.panel-head-btn {
  background: var(--accent);
  color: #041008;
  font-weight: 600;
}

button.panel-head-btn:hover {
  background: var(--accent-hover);
}

button.rule-copy-btn,
button.rule-edit-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
}

@media (max-width: 768px) {
  .ioc-lookup-form { flex-direction: column; }
  .ioc-submit { width: 100%; }

  .workbench { flex-direction: column; }

  .global-nav {
    flex: 0 0 auto;
    width: 100%;
    flex-basis: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-links {
    max-height: 50vh;
  }

  .nav-section {
    width: 100%;
  }

  .workbench.nav-collapsed .global-nav {
    flex: 0 0 var(--nav-w-collapsed);
    width: var(--nav-w-collapsed);
    min-height: auto;
    flex-direction: column;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

}

/* MITRE ATT&CK quick reference */
.mitre-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.mitre-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  width: 100%;
}

.mitre-search-bar input[type="search"] {
  flex: 1;
  min-width: 16rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.mitre-search-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.15);
}

.mitre-search-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.mitre-results {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.mitre-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
}

.mitre-card-head {
  margin-bottom: 0.45rem;
}

.mitre-card-ids {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.mitre-tech-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.mitre-tech-id:hover {
  text-decoration: underline;
}

.mitre-sub-badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.mitre-tech-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.mitre-tactics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.mitre-tactic-pill {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.08);
}

.mitre-desc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.mitre-examples {
  margin-bottom: 0.5rem;
}

.mitre-examples-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.mitre-examples ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.mitre-examples li + li {
  margin-top: 0.25rem;
}

.mitre-mitre-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-decoration: none;
}

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

/* Shift handoff notes */
.handoff-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.handoff-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.handoff-filter-resolved {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.handoff-filter-resolved input {
  accent-color: var(--accent);
}

.handoff-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.handoff-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.handoff-section-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.handoff-section-resolved .handoff-section-label {
  color: var(--muted);
  opacity: 0.85;
}

.handoff-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  border-left: 3px solid var(--border);
}

.handoff-card.handoff-priority-high {
  border-left-color: var(--danger);
  box-shadow:
    0 0 0 1px rgba(255, 82, 82, 0.12),
    var(--card-shadow);
}

.handoff-card.handoff-priority-medium {
  border-left-color: var(--warn);
}

.handoff-card.handoff-priority-low {
  border-left-color: #4fc3f7;
}

.handoff-card-resolved {
  opacity: 0.72;
  border-left-color: var(--border);
  background: linear-gradient(
    165deg,
    rgba(26, 37, 53, 0.85) 0%,
    rgba(20, 30, 44, 0.9) 100%
  );
}

.handoff-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.handoff-card-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.handoff-priority-pill {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.handoff-priority-pill.high {
  background: rgba(255, 82, 82, 0.18);
  color: #ff8a80;
  border: 1px solid rgba(255, 82, 82, 0.35);
}

.handoff-priority-pill.medium {
  background: rgba(255, 183, 77, 0.15);
  color: var(--warn);
  border: 1px solid rgba(255, 183, 77, 0.3);
}

.handoff-priority-pill.low {
  background: rgba(79, 195, 247, 0.12);
  color: #4fc3f7;
  border: 1px solid rgba(79, 195, 247, 0.28);
}

.handoff-status-badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  color: var(--muted);
  border: 1px solid var(--border);
}

.handoff-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  flex: 1 1 100%;
  margin-top: 0.15rem;
}

.handoff-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
  text-align: right;
}

.handoff-author {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

.handoff-time {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.handoff-card-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 0.65rem;
}

.handoff-card-body.handoff-card-empty {
  color: var(--muted);
  font-style: italic;
}

.handoff-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.handoff-editor {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.handoff-editor-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.handoff-editor[hidden] {
  display: none !important;
}

/* Analyst metrics */
.metrics-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.page-header-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metrics-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.35rem;
  max-width: 42rem;
  line-height: 1.5;
}

.metrics-range-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 10rem;
}

.metrics-range-filter label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.metrics-range-filter select {
  padding: 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.metrics-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.metrics-stat-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.metrics-stat-value {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.metrics-stat-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.metrics-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metrics-panel {
  padding: 1rem 1.1rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  box-sizing: border-box;
}

.metrics-panel-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.metrics-panel-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.metrics-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .metrics-panel-row {
    grid-template-columns: 1fr;
  }
}

.metrics-chart {
  min-height: 2rem;
}

.metrics-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4rem, 8rem) 2rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.metrics-bar-label {
  font-size: 0.8rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-bar-track {
  height: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.metrics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f5ff, #00ff88);
  border-radius: 3px;
  min-width: 2px;
  transition: width 0.25s ease;
}

.metrics-bar-value {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

.metrics-timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 7rem;
  padding-top: 0.5rem;
}

.metrics-timeline-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.metrics-timeline-bar-wrap {
  width: 100%;
  height: 5.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.metrics-timeline-bar {
  width: 72%;
  max-width: 2.5rem;
  min-height: 4px;
  background: linear-gradient(180deg, #00f5ff, #00ff88);
  border-radius: 3px 3px 0 0;
  transition: height 0.25s ease;
}

.metrics-timeline-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* False Positive Library */
.fp-library-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.fp-library-toolbar {
  margin-bottom: 1rem;
}

.fp-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.fp-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color 0.15s;
}

.fp-card:hover {
  border-color: var(--border-accent);
}

.fp-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.fp-card-case {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.fp-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.fp-card-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.fp-card-preview {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.45rem;
}

.fp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fp-tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* SOP Library */
.sop-library-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.sop-library-toolbar {
  margin-bottom: 1rem;
}

.sop-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.sop-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  background: linear-gradient(
    165deg,
    var(--card-bg-top) 0%,
    var(--card-bg) 55%,
    #141e2c 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color 0.15s;
}

.sop-card:hover {
  border-color: var(--border-accent);
}

.sop-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.sop-card-platform {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.sop-card-title {
  flex: 1 1 100%;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.sop-card-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.sop-card-alert-type {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.sop-card-preview {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.sop-version-history {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sop-version-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  font-size: 0.82rem;
}

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

.sop-version-author {
  font-weight: 500;
  color: var(--text);
}

.sop-version-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.work-item-sop-body {
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.fp-editor {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.fp-editor[hidden] {
  display: none !important;
}

.fp-editor-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Settings — danger zone & delete account modal */
.danger-zone-panel {
  margin-top: 0;
  border-color: rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.04);
}

.danger-zone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 0.5rem;
}

.danger-zone-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 1rem;
}

.modal-overlay.modal-overlay-raised {
  z-index: var(--z-modal-raised);
}

.modal-overlay.modal-overlay-nested {
  z-index: var(--z-modal-nested);
}

.modal-overlay.theron-dialog-overlay {
  z-index: var(--z-confirm);
}

.theron-dialog-portal {
  position: fixed;
  inset: 0;
  z-index: var(--z-confirm);
  pointer-events: none;
}

.theron-dialog-portal .theron-dialog-overlay {
  pointer-events: auto;
}

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

body.theron-dialog-open {
  overflow: hidden;
}

.modal-overlay.session-timeout-overlay {
  z-index: calc(var(--z-confirm) + 20);
}

body.session-timeout-open {
  overflow: hidden;
}

.session-timeout-modal {
  max-width: 28rem;
}

.session-timeout-modal h2 {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.session-timeout-message {
  color: var(--text-muted, #9aa3b2);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.session-timeout-message strong {
  color: #fbbf24;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 600;
}

.theron-dialog h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.theron-dialog-message {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0.75rem 0 0;
  white-space: pre-wrap;
}

.modal-actions[hidden] {
  display: none !important;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
}

.danger-modal {
  border-color: rgba(255, 82, 82, 0.4);
  max-width: 480px;
}

.danger-modal-lead {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.75rem 0;
  line-height: 1.45;
}

.danger-modal-list {
  margin: 0 0 1rem 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.danger-modal-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.danger-email-hint {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 400;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.modal-actions .secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.modal-actions .secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

#deleteAccountError[hidden] {
  display: none;
}

/* Collaboration — attribution & threaded comments */
.handoff-meta-sep,
.report-card-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.report-card-meta {
  margin-top: 0.2rem;
}

.report-author-line {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.thread-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.thread-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

.thread-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.thread-item {
  padding: 0.65rem 0 0.65rem 0.85rem;
  border-left: 2px solid var(--border-accent);
  margin-bottom: 0.5rem;
}

.thread-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.thread-author {
  font-weight: 600;
  color: var(--text);
}

.thread-body {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-empty {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.thread-compose {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.thread-compose textarea,
.handoff-reply-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  resize: vertical;
}

.org-members-headline {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.org-members-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.88rem;
}

.org-members-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.org-members-list li:last-child {
  border-bottom: none;
}

/* Work item detail modal (reports, FP, handoff, queries) */
body.work-item-modal-open {
  overflow: hidden;
}

.work-item-overlay {
  z-index: var(--z-modal-raised);
  padding: 1.25rem;
  backdrop-filter: blur(2px);
}

.work-item-modal {
  position: relative;
  max-width: min(880px, 96vw);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.work-item-modal-header {
  padding: 1.15rem 3.75rem 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.65);
  flex-shrink: 0;
}

.work-item-modal-header h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}

.work-item-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.work-item-modal-meta .meta-sep {
  opacity: 0.5;
}

.work-item-modal-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
}

.work-item-modal-body .work-item-section {
  margin-bottom: 1.1rem;
}

.work-item-modal-body .work-item-section:last-child {
  margin-bottom: 0;
}

.work-item-modal-body .work-item-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.work-item-modal-body .work-item-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.work-item-modal-body .work-item-query {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.work-item-modal-body .form-field {
  margin-bottom: 0.85rem;
}

.work-item-modal-body .form-field:last-child {
  margin-bottom: 0;
}

.work-item-modal-body textarea {
  min-height: 5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.work-item-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.45);
  flex-shrink: 0;
}

.work-item-modal-footer .footer-spacer {
  flex: 1;
  min-width: 0.5rem;
}

.work-item-modal-status {
  margin: 0;
  padding: 0 1.25rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.work-item-modal-status.error {
  color: var(--error);
}

.work-item-modal-status[hidden] {
  display: none !important;
}

.compact-row-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.compact-row-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.report-card,
.fp-card,
.handoff-card,
.rule-card {
  cursor: pointer;
}

.handoff-card-actions,
.rule-card-actions {
  position: relative;
  z-index: 1;
}

/* Floating Theron assistant (global) */
.theron-assistant-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-assistant);
}

.theron-assistant-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  background: var(--accent);
  color: #041008;
  box-shadow: 0 8px 28px rgba(0, 230, 118, 0.28);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.15s ease;
}

.theron-assistant-fab:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 32px rgba(0, 230, 118, 0.38);
  transform: translateY(-1px);
}

.theron-assistant-fab.open {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--border-accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.theron-assistant-fab-mark {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.theron-assistant-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(24rem, calc(100vw - 1rem));
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.theron-assistant-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}

.theron-assistant-header {
  position: relative;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  padding-right: 3.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.92);
}

.theron-assistant-header-main {
  min-width: 0;
}

button.theron-assistant-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

button.theron-assistant-close:hover:not(:disabled) {
  border-color: var(--border-accent);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.12);
}

.theron-assistant-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.theron-assistant-context {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.theron-assistant-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.85rem 0.5rem;
}

.theron-assistant-welcome {
  padding: 0.5rem 0.25rem 0.75rem;
}

.theron-assistant-welcome p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.theron-assistant-log {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.theron-assistant-msg {
  display: flex;
  flex-direction: column;
}

.theron-assistant-msg.user {
  align-items: flex-end;
}

.theron-assistant-msg.assistant {
  align-items: flex-start;
}

.theron-assistant-msg-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.theron-assistant-bubble {
  max-width: 92%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.theron-assistant-msg.user .theron-assistant-bubble {
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.22);
  color: var(--text);
}

.theron-assistant-msg.assistant .theron-assistant-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.theron-assistant-msg.thinking .theron-assistant-bubble {
  color: var(--muted);
  font-style: italic;
}

.theron-assistant-msg.thinking .thinking-label {
  margin-right: 0.1em;
}

.theron-assistant-msg.thinking .thinking-dots span {
  animation: theron-assistant-dot 1.4s infinite;
  opacity: 0.25;
}

.theron-assistant-msg.thinking .thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.theron-assistant-msg.thinking .thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes theron-assistant-dot {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

.theron-assistant-footer {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, var(--bg) 80%, transparent);
}

.theron-assistant-compose {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.45rem 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.theron-assistant-compose:focus-within {
  border-color: var(--border-accent);
}

.theron-assistant-compose textarea {
  flex: 1;
  min-height: 22px;
  max-height: 120px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.15rem 0;
}

.theron-assistant-compose textarea:focus {
  outline: none;
}

button.theron-assistant-send {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  box-sizing: border-box;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #041008;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

button.theron-assistant-send:hover:not(:disabled) {
  background: var(--accent-hover);
}

button.theron-assistant-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.theron-assistant-status {
  margin: 0.4rem 0.15rem 0;
  font-size: 0.62rem;
  color: var(--muted);
}

.theron-assistant-status.error {
  color: #ff8a80;
}

body.theron-assistant-open .theron-assistant-fab {
  right: calc(min(24rem, calc(100vw - 1rem)) + 0.65rem);
}

@media (max-width: 520px) {
  .theron-assistant-fab {
    right: 0.85rem;
    bottom: 0.85rem;
    width: 3rem;
    height: 3rem;
  }

  body.theron-assistant-open .theron-assistant-fab {
    right: 0.85rem;
  }

  .theron-assistant-panel {
    width: 100vw;
    max-height: min(72vh, 100%);
    top: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }

  .theron-assistant-panel.open {
    transform: translateY(0);
  }
}

/* Help modal */
.help-modal-overlay {
  z-index: var(--z-modal-raised);
}

.help-modal {
  max-width: 640px;
  padding: 0;
}

.help-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 0;
}

.help-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.help-modal-close {
  flex-shrink: 0;
}

.help-modal-intro {
  margin: 0.35rem 1.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.help-modal-sections {
  padding: 0.85rem 1.25rem 0.5rem;
  max-height: min(62vh, 520px);
  overflow-y: auto;
}

.help-modal-section {
  margin-bottom: 1rem;
}

.help-modal-section:last-child {
  margin-bottom: 0;
}

.help-modal-section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.help-modal-section ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}

.help-modal-section li {
  margin-bottom: 0.35rem;
}

.help-modal-section li:last-child {
  margin-bottom: 0;
}

.help-modal-section a {
  color: var(--accent);
  text-decoration: none;
}

.help-modal-section a:hover {
  text-decoration: underline;
}

.help-modal-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.help-modal-dl > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 0.75rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.help-modal-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.help-modal-dl dd {
  margin: 0;
  color: var(--muted);
}

.help-modal-actions #startOnboardingTour {
  margin-right: auto;
}

.help-modal-actions {
  padding: 0.75rem 1.25rem 1.15rem;
  margin: 0;
  border-top: 1px solid var(--border);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Manager dashboard */
.manager-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.manager-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.manager-table-wrap,
.manager-leaderboard-wrap {
  overflow-x: auto;
}

.manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.manager-table th,
.manager-table td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.manager-table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.manager-table tbody tr:hover {
  background: rgba(0, 230, 118, 0.04);
}

.manager-org-panel .manager-org-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.manager-org-rename-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.manager-org-rename-row input {
  flex: 1;
  min-width: 0;
}

.manager-org-subtitle {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.manager-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.manager-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.manager-member-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.manager-level-select {
  padding: 0.3rem 0.45rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.78rem;
}

.manager-org-panel .settings-org-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

.manager-org-panel .settings-org-join-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.manager-org-panel .settings-org-join-row input {
  flex: 1;
  min-width: 10rem;
}

.manager-member-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.manager-member-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.manager-remove-btn {
  flex-shrink: 0;
}

.manager-promote-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.55rem;
  background: rgba(179, 136, 255, 0.14);
  border: 1px solid rgba(179, 136, 255, 0.35);
  border-radius: 4px;
  color: #d1b3ff;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.manager-promote-btn:hover {
  background: rgba(179, 136, 255, 0.22);
  border-color: rgba(179, 136, 255, 0.5);
}

.manager-self-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .manager-org-panel .manager-org-grid {
    grid-template-columns: 1fr;
  }

  .manager-org-rename-row {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .help-modal-dl > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

html.legal-layout-html,
html.legal-layout-html body.legal-layout {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.legal-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.legal-layout.has-demo-banner {
  min-height: 100vh;
}

.legal-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.legal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.legal-brand-name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.legal-header-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.legal-header-link {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}

.legal-header-link:hover {
  color: var(--text);
}

.legal-header-link-accent {
  color: var(--accent);
}

.legal-header-link-accent:hover {
  color: var(--accent-hover);
}

.legal-page {
  flex: 1 0 auto;
  width: 100%;
  padding: 2rem 1.5rem 3rem;
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
  color: var(--text);
  line-height: 1.65;
}

.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
}

.site-footer-copy,
.site-footer-links {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer-links {
  margin-top: 0.35rem;
}

.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer-sep {
  margin: 0 0.4rem;
  color: var(--border);
}

.legal-container h1 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 600;
  background-image: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.legal-container h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.legal-container h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.legal-container p,
.legal-container li {
  font-size: 0.95rem;
  color: var(--text);
}

.legal-container ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.35rem;
}

.legal-container li + li {
  margin-top: 0.35rem;
}

.legal-container a {
  color: var(--accent);
  text-decoration: none;
}

.legal-container a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.legal-container hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.legal-meta {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.legal-footer-note {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
