/* MAILSCOPE — H3AD-SEC Design System */

:root {
  --bg: #080c14;
  --panel: #0d1117;
  --panel-alt: #111827;
  --surface: #18253a;
  --border: #1c2333;
  --border-dim: #121e30;
  --accent: #00d4ff;
  --primary: #00d4ff;
  --primary-dim: rgba(0,212,255,0.08);
  --primary-glow: rgba(0,212,255,0.18);
  --secondary: #58a6ff;
  --text: #e6edf3;
  --text-dim: #96b0cc;
  --muted: #6b7280;
  --status-partial: #f59e0b;
  --nav-h: 48px;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Exo 2', sans-serif;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-base: 14px;
}

body.light {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-alt: #f1f5f9;
  --surface: #ccd8ec;
  --border: #e2e8f0;
  --border-dim: #c8d8ec;
  --text: #0d1117;
  --text-dim: #142540;
  --muted: #5c6b8a;
  --accent: #0284c7;
  --primary: #0284c7;
  --primary-dim: rgba(2,132,199,0.07);
  --secondary: #0ea5e9;
  --status-partial: #d97706;
}

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

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  font-size: var(--fs-base);
  line-height: 1.55;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(0,212,255,0.055) 0%, transparent 100%),
    radial-gradient(ellipse 50% 35% at 5% 100%, rgba(88,166,255,0.04) 0%, transparent 100%);
}

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

/* ── Nav ──────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center;
  padding: 0 1.25rem; height: var(--nav-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}

.nav-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; margin-right: 1rem; }
.nav-brand img { height: 22px; }

.xv-nav-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  margin-left: 10px; padding-left: 10px;
  border-left: 1px solid var(--border);
  flex-shrink: 0; white-space: nowrap; text-decoration: none;
}
.xv-pill-name { font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: 4px; line-height: 1; }
.xv-pill-accent { color: var(--accent); }
.xv-pill-text { color: var(--text); }
.xv-pill-tagline { font-family: var(--sans); font-weight: 400; font-size: 8px; color: var(--muted); letter-spacing: 1.5px; }

.nav-links {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; overflow: visible;
}
.nav-links a {
  font-family: var(--sans); font-weight: 500; font-size: var(--fs-xs);
  color: var(--text-dim); text-decoration: none; padding: 5px 8px;
  border-radius: 4px; border: 1px solid transparent; white-space: nowrap;
  transition: all .15s;
}
.nav-links a:hover { color: var(--accent); border-color: var(--border); background: var(--primary-dim); }
.nav-links a.nav-current { color: var(--accent); border: 1px solid var(--border); }
.nav-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.nav-item { position: relative; display: flex; align-items: center; }
.nav-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 140px; padding-top: 6px; z-index: 100; }
.nav-dropdown-inner { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.nav-item:hover .nav-dropdown { display: block; }
.nav-links .nav-dropdown a {
  display: block; padding: 7px 12px;
  font-size: var(--fs-xs); border: none;
  border-left: 2px solid transparent; border-radius: 0; transition: .15s;
}
.nav-links .nav-dropdown a:hover, .nav-links .nav-dropdown a.nav-current {
  color: var(--accent); border-left-color: var(--accent); background: var(--primary-dim);
}

.nav-right { margin-left: auto; flex-shrink: 0; padding-left: 1rem; }
.theme-toggle { cursor: pointer; }
.toggle-track { width: 44px; height: 22px; background: var(--border); border-radius: 50px; position: relative; }
.toggle-thumb {
  width: 16px; height: 16px; background: var(--accent);
  border-radius: 50%; position: absolute; top: 3px; left: 3px;
  transition: transform .3s; box-shadow: 0 0 6px var(--accent);
}
body.light .toggle-thumb { transform: translateX(22px); }

.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  cursor: pointer; padding: 6px; margin-right: 8px; flex-shrink: 0;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--muted); border-radius: 2px; }

.nav-drawer {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--panel); border-bottom: 1px solid var(--border);
  z-index: 49; padding: .75rem 1.25rem 1rem;
  flex-direction: column; gap: 2px;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-family: var(--sans); font-weight: 500; font-size: var(--fs-sm);
  color: var(--text-dim); text-decoration: none;
  padding: 8px 10px; border-radius: 4px;
  border-left: 2px solid transparent; transition: .15s;
}
.nav-drawer a:hover { color: var(--accent); border-left-color: var(--accent); background: var(--primary-dim); }
.nav-drawer a.nav-current { color: var(--accent); }
.drawer-sub { padding-left: 1.8rem !important; font-size: var(--fs-xs) !important; opacity: .8; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.ms-hero {
  position: relative; z-index: 1;
  border-bottom: 1px solid var(--border);
  padding: 24px 32px 20px;
  margin-top: var(--nav-h);
}
.hero-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.hero-left { display: flex; flex-direction: column; gap: 2px; }
.hero-breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: var(--fs-xs);
  color: var(--muted); letter-spacing: 1px; margin-bottom: 6px;
}
.hero-breadcrumb a { color: var(--muted); text-decoration: none; }
.hero-breadcrumb a:hover { color: var(--accent); }
.hero-breadcrumb .hero-current { color: var(--accent); }
.hero-title { display: flex; align-items: baseline; line-height: 1; }
.hero-accent { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: 5px; color: var(--accent); }
.hero-name { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: 5px; color: var(--text); }
.hero-tagline { font-family: var(--sans); font-weight: 300; font-size: var(--fs-xs); color: var(--muted); letter-spacing: 2px; margin-top: 4px; }

.hero-stats {
  display: flex; gap: 1px; background: var(--border);
  border: 1px solid var(--border); overflow: hidden; flex-shrink: 0;
}
.stat-item {
  background: var(--panel); padding: 11px 20px;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.stat-num { font-family: var(--mono); font-size: 1.15rem; color: var(--accent); }
.stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; }

/* ── Main layout ──────────────────────────────────────────────────────────── */

.ms-main { position: relative; z-index: 1; padding: 24px 32px 56px; }
.ms-layout {
  max-width: 1140px; margin: 0 auto;
  display: grid; grid-template-columns: 360px 1fr; gap: 20px;
  align-items: start;
}

/* ── Shared panel ─────────────────────────────────────────────────────────── */

.ms-panel {
  background: var(--panel); border: 1px solid var(--border);
  position: relative; overflow: hidden;
  animation: fadeIn .25s ease;
}
.ms-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, transparent);
}
.panel-header {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel-label {
  font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: 2.5px; color: var(--accent); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.panel-body { padding: 18px; }

/* ── Input panel ──────────────────────────────────────────────────────────── */

.ms-textarea {
  width: 100%; min-height: 240px; resize: vertical;
  padding: 14px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: var(--fs-xs);
  line-height: 1.8; outline: none; transition: border-color .15s; border-radius: 2px;
}
.ms-textarea:focus { border-color: var(--accent); }
.ms-textarea::placeholder { color: var(--muted); line-height: 1.8; }

.action-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn-analyze {
  flex: 1; padding: 10px 20px;
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent); cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 1.5px;
  font-weight: 600; transition: opacity .15s, transform .15s; border-radius: 4px;
  box-shadow: 0 0 18px rgba(0,212,255,.18);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-analyze:hover:not(:disabled) { opacity: .88; transform: scale(1.01); }
.btn-analyze:disabled { opacity: .3; cursor: not-allowed; transform: none; box-shadow: none; }
body.light .btn-analyze { color: #fff; }

.btn-ghost {
  padding: 10px 14px; background: transparent;
  color: var(--muted); border: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px;
  cursor: pointer; border-radius: 4px; transition: all .15s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }

.action-note { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); margin-left: auto; }

.tips-block { margin-top: 18px; display: flex; flex-direction: column; gap: 5px; }
.tips-label { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.tip-row { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); line-height: 1.7; }
.tip-row span { color: var(--secondary); }

/* ── Empty state ──────────────────────────────────────────────────────────── */

.empty-state {
  border: 1px dashed var(--border);
  padding: 52px 28px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 300px; justify-content: center;
}
.empty-icon { color: var(--border); }
.empty-text { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); letter-spacing: 1px; }
.empty-sub { font-size: var(--fs-xs); color: var(--muted); opacity: .7; max-width: 320px; line-height: 1.6; }

/* ── Copy analysis button ─────────────────────────────────────────────────── */

.btn-copy-analysis {
  width: 100%; padding: 9px 16px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1.5px;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-copy-analysis:hover { border-color: var(--secondary); color: var(--secondary); }

/* ── Verdict banner ───────────────────────────────────────────────────────── */

.verdict-banner {
  padding: 12px 18px; border: 1px solid; border-radius: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; position: relative; overflow: hidden;
}
.verdict-banner::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
}
.verdict-high   { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.05); }
.verdict-high::before { background: linear-gradient(90deg, transparent, var(--status-partial) 40%, transparent); }
.verdict-medium { border-color: rgba(88,166,255,.3); background: rgba(88,166,255,.04); }
.verdict-medium::before { background: linear-gradient(90deg, transparent, var(--secondary) 40%, transparent); }
.verdict-low    { border-color: var(--border); background: transparent; }
.verdict-clean  { border-color: rgba(0,212,255,.25); background: rgba(0,212,255,.03); }
.verdict-clean::before { background: linear-gradient(90deg, transparent, var(--accent) 40%, transparent); }

.verdict-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.verdict-label {
  font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 2px;
  font-weight: 600;
}
.verdict-high   .verdict-label { color: var(--status-partial); }
.verdict-medium .verdict-label { color: var(--secondary); }
.verdict-low    .verdict-label { color: var(--muted); }
.verdict-clean  .verdict-label { color: var(--accent); }

.verdict-auth { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: .5px; }

.verdict-counts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vc-high   { font-family: var(--mono); font-size: var(--fs-xs); color: var(--status-partial); letter-spacing: 1px; }
.vc-medium { font-family: var(--mono); font-size: var(--fs-xs); color: var(--secondary); letter-spacing: 1px; }
.vc-low    { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: 1px; }

/* ── Results sections ─────────────────────────────────────────────────────── */

.results-col { display: flex; flex-direction: column; gap: 12px; }
#results-section { display: flex; flex-direction: column; gap: 12px; }

.result-card {
  background: var(--panel); border: 1px solid var(--border);
  position: relative; overflow: hidden;
  animation: fadeIn .25s ease;
}
.result-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--secondary) 80%, transparent);
}
.card-header {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title {
  font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: 2.5px; color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.card-meta { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: .5px; }
.card-body { padding: 16px 18px; }

/* ── Overview table ───────────────────────────────────────────────────────── */

.ov-table { width: 100%; border-collapse: collapse; }
.ov-table tr { border-bottom: 1px solid var(--border-dim); animation: rowIn .2s ease both; }
.ov-table tr:last-child { border-bottom: none; }
.ov-key {
  width: 120px; padding: 8px 14px 8px 0;
  font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase;
  white-space: nowrap; vertical-align: top;
}
.ov-val {
  padding: 8px 0; font-family: var(--mono); font-size: var(--fs-xs);
  color: var(--text); word-break: break-all; line-height: 1.6;
}

/* ── Auth badges ──────────────────────────────────────────────────────────── */

.auth-badges { display: flex; gap: 10px; padding: 16px 18px; flex-wrap: wrap; }
.auth-badge {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 24px; border: 1px solid; border-radius: 4px; flex: 1; min-width: 90px;
}
.auth-proto { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 2px; color: var(--muted); }
.auth-val { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 1.5px; }
.auth-sub { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: .5px; margin-top: 2px; }

.auth-pass { border-color: rgba(0,212,255,.35); background: rgba(0,212,255,.05); }
.auth-pass .auth-val { color: var(--accent); }
.auth-fail { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.auth-fail .auth-val { color: var(--status-partial); }
.auth-warn { border-color: rgba(245,158,11,.2); background: rgba(245,158,11,.03); }
.auth-warn .auth-val { color: var(--status-partial); }
.auth-none { border-color: var(--border); background: transparent; }
.auth-none .auth-val { color: var(--muted); }

/* ── Hop chain ────────────────────────────────────────────────────────────── */

.hop-chain { display: flex; flex-direction: column; gap: 0; padding: 16px 18px; }

.hop-node { display: flex; gap: 14px; }
.hop-track { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; padding-top: 2px; }
.hop-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--muted); background: var(--bg);
  flex-shrink: 0;
}
.hop-origin .hop-dot { border-color: var(--accent); background: rgba(0,212,255,.15); }
.hop-line { width: 1px; flex: 1; background: var(--border); margin: 3px 0; min-height: 20px; }

.hop-body { padding-bottom: 18px; flex: 1; min-width: 0; }
.hop-node:last-child .hop-body { padding-bottom: 0; }

.hop-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.hop-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted);
}
.hop-origin .hop-label { color: var(--accent); }
.hop-ip {
  font-family: var(--mono); font-size: var(--fs-xs);
  color: var(--secondary); display: flex; align-items: center; gap: 4px;
}
.hop-icon-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 2px; display: flex; align-items: center; transition: color .15s; border-radius: 2px;
}
.hop-icon-btn:hover { color: var(--secondary); }
.hop-enrich-link {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 2px; padding: 1px 6px;
  transition: all .15s; white-space: nowrap;
}
.hop-enrich-link:hover { color: var(--accent); border-color: var(--accent); background: var(--primary-dim); }
.hop-delay {
  font-family: var(--mono); font-size: 9px; color: var(--muted);
  background: var(--panel-alt); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 2px;
}
.hop-detail { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.6; }
.hop-detail span { color: var(--text); }
.hop-detail.muted { color: var(--muted); }
.hop-detail.muted span { color: var(--muted); }
.hop-ts { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 3px; }

.no-data { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); padding: 16px 18px; }

/* ── Sender analysis ──────────────────────────────────────────────────────── */

.sa-table { width: 100%; border-collapse: collapse; }
.sa-table tr { border-bottom: 1px solid var(--border-dim); animation: rowIn .2s ease both; }
.sa-table tr:last-child { border-bottom: none; }
.sa-table td { padding: 9px 0 9px 0; vertical-align: top; }
.sa-field {
  width: 110px; font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; padding-right: 12px;
  white-space: nowrap;
}
.sa-addr { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dim); word-break: break-all; line-height: 1.6; padding-right: 12px; }
.sa-domain { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text); white-space: nowrap; }
.sa-mismatch { color: var(--status-partial); }
.tag-mismatch {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  color: var(--status-partial); border: 1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.06); padding: 1px 6px; border-radius: 2px;
  margin-left: 6px; vertical-align: middle;
}

/* ── Risk flags ───────────────────────────────────────────────────────────── */

.risk-flags { display: flex; flex-direction: column; gap: 1px; padding: 12px 18px; }
.risk-item { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-dim); animation: rowIn .2s ease both; }
.risk-item:last-child { border-bottom: none; }
.risk-num { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); flex-shrink: 0; padding-top: 1px; width: 22px; }
.risk-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.risk-title { font-size: var(--fs-sm); color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.4; }
.risk-detail { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.risk-badge {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  padding: 2px 7px; border-radius: 2px; border: 1px solid; flex-shrink: 0;
}
.risk-high { color: var(--status-partial); border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.07); }
.risk-medium { color: var(--secondary); border-color: rgba(88,166,255,.3); background: rgba(88,166,255,.06); }
.risk-low { color: var(--muted); border-color: var(--border); background: transparent; }

.no-flags { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); padding: 6px 0; }

/* ── First hop callout ────────────────────────────────────────────────────── */

.first-hop-card {
  background: var(--panel); border: 1px solid var(--border);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.first-hop-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, transparent);
}
.fh-label { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.fh-ip { font-family: var(--mono); font-size: 18px; color: var(--accent); letter-spacing: 1px; flex: 1; }
.fh-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-enrich {
  padding: 8px 16px; background: var(--primary-dim);
  color: var(--accent); border: 1px solid rgba(0,212,255,.3);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1.5px;
  cursor: pointer; border-radius: 4px; transition: all .15s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.btn-enrich:hover { background: rgba(0,212,255,.12); border-color: var(--accent); }
.btn-copy-sm {
  padding: 8px 14px; background: transparent;
  color: var(--muted); border: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px;
  cursor: pointer; border-radius: 4px; transition: all .15s;
}
.btn-copy-sm:hover { border-color: var(--muted); color: var(--text); }

/* ── Raw headers ──────────────────────────────────────────────────────────── */

.raw-toggle-row {
  padding: 12px 18px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.raw-toggle-row:hover .card-title { color: var(--secondary); }
.btn-raw-toggle {
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px;
  color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 3px;
  transition: all .15s;
}
.btn-raw-toggle:hover { border-color: var(--muted); color: var(--text); }
.raw-content {
  display: none; margin: 0 18px 16px;
  font-family: var(--mono); font-size: var(--fs-xs);
  color: var(--muted); line-height: 1.8; white-space: pre-wrap; word-break: break-all;
  background: var(--bg); border: 1px solid var(--border);
  padding: 14px; max-height: 280px; overflow-y: auto;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border-dim);
  padding: 16px 28px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  line-height: 1.7;
}
.footer-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.footer-brand { color: var(--accent); text-decoration: none; }
.footer-project { color: var(--secondary); }
.footer-sep { color: var(--border); }

/* ── Header count chip ────────────────────────────────────────────────────── */

.header-count-chip {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  color: var(--muted); background: var(--panel-alt);
  border: 1px solid var(--border); border-radius: 2px;
  padding: 2px 7px; flex-shrink: 0;
}

/* ── History ──────────────────────────────────────────────────────────────── */

.history-section { margin-top: 20px; }
.hist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.btn-hist-clear {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  color: var(--muted); background: none; border: 1px solid var(--border);
  border-radius: 2px; padding: 2px 6px; cursor: pointer; transition: all .15s;
}
.btn-hist-clear:hover { color: var(--text); border-color: var(--muted); }

.history-list { display: flex; flex-direction: column; gap: 4px; }
.hist-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 2px;
  padding: 8px 10px; transition: border-color .15s;
}
.hist-item:hover { border-color: var(--muted); }
.hist-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.hist-verdict {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  padding: 1px 5px; border-radius: 2px; border: 1px solid; flex-shrink: 0;
}
.hist-v-high   { color: var(--status-partial); border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.06); }
.hist-v-medium { color: var(--secondary); border-color: rgba(88,166,255,.3); background: rgba(88,166,255,.05); }
.hist-v-low    { color: var(--muted); border-color: var(--border); }
.hist-v-clean  { color: var(--accent); border-color: rgba(0,212,255,.25); background: rgba(0,212,255,.04); }
.hist-meta { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.hist-ago  { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-left: auto; }
.hist-from    { font-family: var(--mono); font-size: 10px; color: var(--text-dim); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-subject { font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-empty   { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); padding: 6px 0; text-align: center; }

/* ── ARC chain ────────────────────────────────────────────────────────────── */

.arc-chain { display: flex; flex-direction: column; gap: 0; }
.arc-instance {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--border-dim);
}
.arc-instance:last-child { border-bottom: none; }
.arc-inst-num {
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted);
  width: 36px; flex-shrink: 0;
}
.arc-inst-cv {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 8px; border-radius: 2px; border: 1px solid; letter-spacing: 1px;
  flex-shrink: 0;
}
.arc-pass { color: var(--accent); }
.arc-fail { color: var(--status-partial); }
.arc-none { color: var(--muted); }
.arc-inst-cv.arc-pass { border-color: rgba(0,212,255,.3); background: rgba(0,212,255,.05); }
.arc-inst-cv.arc-fail { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.06); }
.arc-inst-cv.arc-none { border-color: var(--border); }
.arc-inst-auth { display: flex; gap: 10px; flex-wrap: wrap; }
.arc-proto { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.arc-proto span { font-weight: 600; }

/* ── PHISHOPS button ──────────────────────────────────────────────────────── */

.btn-phishops {
  padding: 8px 14px; background: transparent;
  color: var(--status-partial); border: 1px solid rgba(245,158,11,.3);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px;
  cursor: pointer; border-radius: 4px; transition: all .15s; white-space: nowrap;
}
.btn-phishops:hover { background: rgba(245,158,11,.07); border-color: var(--status-partial); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

body.nav-compact .nav-links { display: none; }
body.nav-compact .hamburger { display: flex; }

@media (max-width: 1000px) {
  .ms-main { padding: 18px; }
  .ms-hero { padding: 20px 18px 16px; }
}
@media (max-width: 860px) {
  .ms-layout { grid-template-columns: 1fr; }
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero-stats { width: 100%; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .auth-badges { gap: 8px; }
  .auth-badge { padding: 12px 16px; }
  .fh-ip { font-size: 15px; }
  .sa-table td { display: block; padding: 4px 0; }
  .sa-field { display: block; width: auto; margin-bottom: 2px; }
}
@media (max-width: 480px) {
  .ms-hero { padding: 14px 14px 12px; }
  .ms-main { padding: 12px 14px 40px; }
  .hero-accent, .hero-name { font-size: 18px; letter-spacing: 3px; }
  .hero-stats { flex-wrap: wrap; }
  .stat-item { flex: 1 1 calc(50% - 1px); padding: 10px 12px; }
  .panel-body, .card-body { padding: 12px 14px; }
  .action-note { display: none; }
  .fh-actions { width: 100%; }
  .btn-enrich, .btn-copy-sm { flex: 1; justify-content: center; }
}
@media (max-width: 375px) {
  .ms-textarea { min-height: 180px; font-size: 10px; }
  .auth-badge { padding: 10px 10px; }
  .auth-val { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
