/* ============================================================
   Kyburn — Black/White Lab Theme
   ============================================================ */

/* ---- Theme tokens ---- */
:root {
  /* Dark — mysterious lab */
  --bg:         #080808;
  --surface:    #111111;
  --surface2:   #1a1a1a;
  --border:     #272727;
  --border-hi:  #3a3a3a;
  --text:       #a0a0a0;
  --text-hi:    #e8e8e8;
  --muted:      #484848;
  --accent:     #d8d8d8;
  --accent-dim: rgba(216,216,216,0.06);
  --red:        #cc4444;
  --orange:     #c47a20;
  --green:      #3a8f5a;
  --radius:     4px;
  --font:       'Inter', system-ui, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  /* Light — sterile lab */
  --bg:         #eeeeee;
  --surface:    #ffffff;
  --surface2:   #f5f5f5;
  --border:     #d8d8d8;
  --border-hi:  #aaaaaa;
  --text:       #333333;
  --text-hi:    #0a0a0a;
  --muted:      #777777;
  --accent:     #0a0a0a;
  --accent-dim: rgba(10,10,10,0.06);
  --red:        #bb2222;
  --orange:     #a05a00;
  --green:      #1e6b38;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.page { display: none; }
.page.active { display: block; }

/* ---- Body — dark: subtle vignette + radial warmth; light: clean ---- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
}

/* Subtle depth in dark mode only */
:root body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255,255,255,0.018) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before { display: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.7; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---- Sidebar ---- */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-hi);
  text-transform: uppercase;
}

.logo-owl {
  width: 20px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.88;
}

/* In dark mode, caret is white; light mode, black — both same var */
.logo-caret { color: var(--accent); margin-right: 4px; }
.logo-hi    { color: var(--accent); }

.logo-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 5px;
}

.sidebar-nav { padding: 8px 0; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }

.nav-item:hover  { background: var(--accent-dim); color: var(--text); }
.nav-item.active { color: var(--text-hi); background: var(--accent-dim); border-left-color: var(--accent); }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.signin-btn {
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.signin-btn:hover {
  background: var(--accent);
  color: #000;
}

/* ---- Sign In Modal ---- */
.signin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 14, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.signin-overlay.active {
  display: flex;
}
.signin-modal-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 36px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 0 40px rgba(0, 255, 157, 0.12);
  position: relative;
}
.signin-modal-card::before {
  content: '[ ';
  position: absolute;
  top: 12px; left: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0.5;
}
.signin-modal-card::after {
  content: ' ]';
  position: absolute;
  bottom: 12px; right: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0.5;
}
.signin-modal-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.signin-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-hi);
  margin: 0 0 8px;
}
.signin-modal-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}
.signin-modal-input {
  width: 100%;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 13px;
  box-sizing: border-box;
}
.signin-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.topbar-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-hi);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
}

.topbar-key span { color: var(--text-hi); }

/* Theme toggle */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text-hi); background: var(--accent-dim); }
.theme-toggle svg { width: 14px; height: 14px; }

.content { padding: 24px; overflow-y: auto; flex: 1; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ---- Stats grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-hi); }

.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--text-hi);
}

.stat-value.red    { color: var(--red); }
.stat-value.orange { color: var(--orange); }
.stat-value.green  { color: var(--green); }
.stat-value.blue   { color: var(--text-hi); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active { color: var(--text-hi); border-bottom-color: var(--accent); }
.tab-btn:hover  { color: var(--text); }

.tab-pane        { display: none; }
.tab-pane.active { display: block; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-hi);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-input::placeholder { color: var(--muted); }

.file-drop {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover, .file-drop.drag-over {
  border-color: var(--border-hi);
  background: var(--accent-dim);
}

.file-drop input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.file-drop-icon { font-size: 22px; margin-bottom: 8px; opacity: 0.5; }
.file-name { font-size: 12px; color: var(--text-hi); margin-top: 8px; font-family: var(--mono); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn:active   { transform: scale(0.98); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--text-hi);
  color: var(--bg);
  border: 1px solid var(--text-hi);
}

.btn-primary:hover { opacity: 0.85; }

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

.btn-ghost:hover { border-color: var(--border-hi); color: var(--text-hi); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--accent-dim); }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-malicious  { color: var(--red);    border: 1px solid var(--red);    background: transparent; }
.badge-suspicious { color: var(--orange); border: 1px solid var(--orange); background: transparent; }
.badge-clean      { color: var(--green);  border: 1px solid var(--green);  background: transparent; }
.badge-pending    { color: var(--muted);  border: 1px solid var(--border); background: transparent; }
.badge-error      { color: var(--red);    border: 1px solid var(--border); background: transparent; }

.type-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
}

.score-bar-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar { height: 2px; background: var(--border); flex: 1; max-width: 80px; border-radius: 1px; }
.score-bar-fill { height: 100%; border-radius: 1px; transition: width 0.4s; }

.view-btn {
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.view-btn:hover { border-color: var(--border-hi); color: var(--text-hi); }

/* ---- Report page ---- */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.report-verdict-block { display: flex; flex-direction: column; gap: 6px; }

.report-verdict {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.report-verdict.malicious  { color: var(--red); }
.report-verdict.suspicious { color: var(--orange); }
.report-verdict.clean      { color: var(--green); }

.report-url { font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all; }

.score-circle {
  width: 70px; height: 70px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.score-circle .score-num { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.score-circle .score-lbl { font-family: var(--mono); font-size: 9px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

.score-circle.malicious  { border-color: var(--red);    color: var(--red); }
.score-circle.suspicious { border-color: var(--orange); color: var(--orange); }
.score-circle.clean      { border-color: var(--green);  color: var(--green); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ---- Signal rows ---- */
.signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.signal-row:last-child { border-bottom: none; }

.signal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.signal-dot.fired   { background: var(--red); }
.signal-dot.unfired { background: var(--border); }

.signal-name   { font-family: var(--mono); font-weight: 500; font-size: 12px; flex-shrink: 0; min-width: 180px; color: var(--text-hi); }
.signal-result { font-family: var(--mono); color: var(--muted); font-size: 11px; flex: 1; }
.signal-weight { font-family: var(--mono); font-size: 12px; color: var(--red); font-weight: 600; flex-shrink: 0; }
.signal-weight.zero { color: var(--muted); }

.cat-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--surface2);
  color: var(--muted);
  flex-shrink: 0;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- IOC list ---- */
.ioc-list { display: flex; flex-direction: column; gap: 4px; }

.ioc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 12px;
  font-family: var(--mono);
  transition: border-color 0.15s;
}

.ioc-item:hover { border-color: var(--border-hi); }

.ioc-type {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ioc-value { word-break: break-all; color: var(--text); }

/* ---- Redirect chain ---- */
.redirect-chain { display: flex; flex-direction: column; gap: 4px; }

.redirect-hop {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hop-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.hop-status.ok  { color: var(--green); border: 1px solid var(--green); }
.hop-status.err { color: var(--red);   border: 1px solid var(--red); }
.hop-url { word-break: break-all; color: var(--muted); }

/* ---- Screenshot ---- */
.screenshot-wrap img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.no-screenshot { color: var(--muted); font-size: 12px; font-family: var(--mono); padding: 40px 0; text-align: center; }

/* ---- Spinner / Toast ---- */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 1px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
  max-width: 360px;
}

.toast.success { border-left: 2px solid var(--green); }
.toast.error   { border-left: 2px solid var(--red); }
.toast.info    { border-left: 2px solid var(--text-hi); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); font-family: var(--mono); }
.empty-state-icon { font-size: 28px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 12px; }

/* ---- Back button ---- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  margin-bottom: 20px;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text-hi); }

/* ---- Filter bar ---- */
.filter-bar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

.filter-btn {
  padding: 4px 12px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
}

.filter-btn:hover  { color: var(--text-hi); border-color: var(--border-hi); }
.filter-btn.active { color: var(--text-hi); border-color: var(--accent); background: var(--accent-dim); }

/* ---- Error banner ---- */
.error-banner {
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--red);
  font-size: 12px;
  font-family: var(--mono);
  margin-bottom: 16px;
  display: none;
}

/* ---- Email report sections ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.section-header:hover .section-title { color: var(--text); }

.section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  flex: 1;
}

.section-toggle { color: var(--muted); font-size: 12px; transition: transform 0.2s; }
.section-toggle.open { transform: rotate(180deg); }
.section-body.collapsed { display: none; }

/* ---- Header analysis grid ---- */
.header-grid { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; }
.header-key { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 500; padding: 4px 0; }
.header-val { font-family: var(--mono); font-size: 11px; color: var(--text); padding: 4px 0; word-break: break-all; }

/* ---- Auth badges ---- */
.auth-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.auth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 80px;
  background: transparent;
  transition: border-color 0.15s;
}

.auth-item.pass { border-color: var(--green); }
.auth-item.fail { border-color: var(--red); }
.auth-item.warn { border-color: var(--orange); }

.auth-label  { font-family: var(--mono); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.auth-status { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.auth-item.pass .auth-status { color: var(--green); }
.auth-item.fail .auth-status { color: var(--red); }
.auth-item.warn .auth-status { color: var(--orange); }

/* ---- URL reputation rows ---- */
.url-rep-row {
  display: grid;
  grid-template-columns: 1fr 80px 90px auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.url-rep-row:last-child { border-bottom: none; }
.url-rep-url   { font-family: var(--mono); font-size: 11px; word-break: break-all; color: var(--muted); }
.url-rep-score { font-family: var(--mono); font-weight: 600; text-align: right; }
.url-rep-score.malicious  { color: var(--red); }
.url-rep-score.suspicious { color: var(--orange); }
.url-rep-score.clean      { color: var(--green); }
.url-rep-score.unknown    { color: var(--muted); }

/* ---- Attachment cards ---- */
.attachment-cards { display: flex; flex-direction: column; gap: 10px; }

.attachment-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  align-items: start;
}

.attachment-card.risky { border-color: var(--red); }
.attachment-icon  { font-size: 22px; grid-row: span 3; align-self: center; opacity: 0.7; }
.attachment-name  { font-family: var(--mono); font-weight: 600; font-size: 12px; word-break: break-all; color: var(--text-hi); }
.attachment-meta  { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.attachment-hashes { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 4px; }
.attachment-hashes span { display: block; }

/* ---- Received chain ---- */
.received-chain { display: flex; flex-direction: column; }

.received-hop { display: grid; grid-template-columns: 28px 1fr; gap: 0 12px; }

.hop-line      { display: flex; flex-direction: column; align-items: center; }
.hop-dot       { width: 8px; height: 8px; border-radius: 50%; background: var(--border-hi); border: 2px solid var(--bg); flex-shrink: 0; margin-top: 4px; }
.hop-dot.last  { background: var(--text); }
.hop-connector { width: 1px; flex: 1; background: var(--border); min-height: 20px; }

.hop-body {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
}

.hop-from { font-weight: 600; color: var(--text-hi); margin-bottom: 2px; }
.hop-by   { color: var(--muted); }
.hop-time { color: var(--muted); font-size: 10px; margin-top: 4px; }

.hop-proto {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  margin-left: 6px;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- IOC Search ---- */
.search-wrap { margin-bottom: 20px; position: relative; z-index: 50; }

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  gap: 10px;
  transition: border-color 0.15s;
}

.search-bar:focus-within { border-color: var(--border-hi); }

.search-icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.search-bar:focus-within .search-icon { color: var(--text); }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 13px;
  padding: 11px 0;
}

.search-input::placeholder { color: var(--muted); }

.search-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 2px;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--text-hi); }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  animation: dropIn 0.1s ease;
}

.search-dropdown.visible { display: block; }

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

.search-dropdown::-webkit-scrollbar { width: 3px; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--border); }

.search-dropdown-header {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.search-dropdown-header .sh-hl { color: var(--text-hi); }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result-item:last-child  { border-bottom: none; }
.search-result-item:hover       { background: var(--accent-dim); }
.search-result-item.focused     { background: var(--accent-dim); }

.search-result-ioc  { font-family: var(--mono); font-size: 12px; color: var(--text-hi); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.search-result-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

.search-empty   { padding: 20px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; }
.search-loading { padding: 14px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

/* ---- Live Test button ---- */
.live-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.live-test-btn:hover { border-color: var(--border-hi); color: var(--text-hi); }
.live-test-btn svg { width: 10px; height: 10px; }

.live-test-btn .pro-tag {
  font-size: 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 4px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-left: 2px;
}

/* ---- Live Browser Session Overlay ---- */
.session-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #000;
  flex-direction: column;
}
.session-overlay.visible { display: flex; }

.session-toolbar {
  height: 46px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  flex-shrink: 0;
}

.session-status { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.session-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.session-live-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
}

.session-url-display {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-timer {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  flex-shrink: 0;
  min-width: 48px;
  text-align: right;
}

.session-end-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.session-end-btn:hover { border-color: var(--red); }

.session-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  background: var(--bg);
}
.session-loading.visible { display: flex; }

.session-loading-text { font-family: var(--mono); font-size: 13px; color: var(--text); }
.session-loading-sub  { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.session-iframe {
  display: none;
  flex: 1;
  width: 100%;
  border: none;
}
.session-iframe.visible { display: block; }
